From 54ab1c5acf892f07dd8121d4bbafe7601a54bcb5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 23 Jan 2013 18:52:05 +0200 Subject: [PATCH] Fix dimensions of maximized frame on MS-Windows. 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 | 5 +++++ src/w32term.c | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 67b63eb1fdb..644724f67b6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-01-23 Eli Zaretskii + + * 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 * insdel.c (prepare_to_modify_buffer): Force redisplay if diff --git a/src/w32term.c b/src/w32term.c index 16c7bd415a5..0cb2effcda1 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -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; -- 2.39.2