From 52c701266e2876ba744d4d198f26d2cbc4fa2aa8 Mon Sep 17 00:00:00 2001 From: jacob Date: Sat, 15 Aug 2009 17:45:17 +0000 Subject: [PATCH] Keep the state of the "Full Screen" menu item on the Ctrl+right-click context menu in sync with reality and the system menu. git-svn-id: svn://svn.tartarus.org/sgt/putty@8620 cda61777-01e9-0310-a592-d414129be87e --- windows/window.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/windows/window.c b/windows/window.c index 416be3fd..670a1ace 100644 --- a/windows/window.c +++ b/windows/window.c @@ -2112,10 +2112,12 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, { /* Disable full-screen if resizing forbidden */ - HMENU m = GetSystemMenu (hwnd, FALSE); - EnableMenuItem(m, IDM_FULLSCREEN, MF_BYCOMMAND | - (cfg.resize_action == RESIZE_DISABLED) - ? MF_GRAYED : MF_ENABLED); + int i; + for (i = 0; i < lenof(popup_menus); i++) + EnableMenuItem(popup_menus[i].menu, IDM_FULLSCREEN, + MF_BYCOMMAND | + (cfg.resize_action == RESIZE_DISABLED) + ? MF_GRAYED : MF_ENABLED); /* Gracefully unzoom if necessary */ if (IsZoomed(hwnd) && (cfg.resize_action == RESIZE_DISABLED)) { @@ -5370,9 +5372,12 @@ static void make_full_screen() reset_window(0); - /* Tick the menu item in the System menu. */ - CheckMenuItem(GetSystemMenu(hwnd, FALSE), IDM_FULLSCREEN, - MF_CHECKED); + /* Tick the menu item in the System and context menus. */ + { + int i; + for (i = 0; i < lenof(popup_menus); i++) + CheckMenuItem(popup_menus[i].menu, IDM_FULLSCREEN, MF_CHECKED); + } } /* @@ -5400,9 +5405,12 @@ static void clear_full_screen() SWP_FRAMECHANGED); } - /* Untick the menu item in the System menu. */ - CheckMenuItem(GetSystemMenu(hwnd, FALSE), IDM_FULLSCREEN, - MF_UNCHECKED); + /* Untick the menu item in the System and context menus. */ + { + int i; + for (i = 0; i < lenof(popup_menus); i++) + CheckMenuItem(popup_menus[i].menu, IDM_FULLSCREEN, MF_UNCHECKED); + } } /* -- 2.11.0