]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix dimensions of maximized frame on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Wed, 23 Jan 2013 16:52:05 +0000 (18:52 +0200)
committerEli Zaretskii <eliz@gnu.org>
Wed, 23 Jan 2013 16:52:05 +0000 (18:52 +0200)
 src/w32term.c (w32fullscreen_hook): Account correctly for the screen
 real estate used for the tool bar, the menu bar, and scroll bar.

src/ChangeLog
src/w32term.c

index 67b63eb1fdb3156480f048946b97451e4170ec30..644724f67b6987f1056ba62e5b77b68112ed1073 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32term.c (w32fullscreen_hook): Account correctly for the screen
+       real estate used for the tool bar and the menu bar.
+
 2013-01-23  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * insdel.c (prepare_to_modify_buffer): Force redisplay if
index 16c7bd415a500bf0094966b1caf541a210128d5f..0cb2effcda17743975e8b24146635d6140aa4356 100644 (file)
@@ -5674,24 +5674,33 @@ w32fullscreen_hook (FRAME_PTR f)
 
       switch (f->want_fullscreen)
        {
-         /* No difference between these two when there is no WM */
        case FULLSCREEN_MAXIMIZED:
-         PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, 0xf030, 0);
+         PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MAXIMIZE, 0);
          break;
        case FULLSCREEN_BOTH:
-         height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2;
-         width  = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width);
+         height =
+           FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height)
+           - XINT (Ftool_bar_lines_needed (selected_frame))
+           + (NILP (Vmenu_bar_mode) ? 1 : 0);
+         width  =
+           FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width)
+           - FRAME_SCROLL_BAR_COLS (f);
          left_pos = workarea_rect.left;
          top_pos = workarea_rect.top;
          break;
        case FULLSCREEN_WIDTH:
-         width  = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width);
+         width  =
+           FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width)
+           - FRAME_SCROLL_BAR_COLS (f);
          if (normal_height > 0)
            height = normal_height;
          left_pos = workarea_rect.left;
          break;
        case FULLSCREEN_HEIGHT:
-         height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2;
+         height =
+           FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height)
+           - XINT (Ftool_bar_lines_needed (selected_frame))
+           + (NILP (Vmenu_bar_mode) ? 1 : 0);
          if (normal_width > 0)
            width = normal_width;
          top_pos = workarea_rect.top;