diff options
author | Jason Rumney <jasonr@gnu.org> | 2007-02-22 22:50:04 +0000 |
---|---|---|
committer | Jason Rumney <jasonr@gnu.org> | 2007-02-22 22:50:04 +0000 |
commit | 5d22ded9ffdcc3d6ad29f7470768de49ee6d7829 (patch) | |
tree | 224e4c00576ed51d2db36c952687b4e4010ebbc3 /src/w32fns.c | |
parent | b2a916a0f4be7baad98e2498c2ef7618f39e51b9 (diff) | |
download | emacs-5d22ded9ffdcc3d6ad29f7470768de49ee6d7829.tar.gz |
(current_popup_menu): Use from w32menu.c.
(w32_wnd_proc): Use menubar_active and current_popup_menu to
determine whether a menubar menu has been cancelled.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r-- | src/w32fns.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 885ade0e4bb..2fc83ce50a3 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -297,6 +297,9 @@ extern int w32_use_visible_system_caret; static HWND w32_visible_system_caret_hwnd; +/* From w32menu.c */ +extern HMENU current_popup_menu; + /* Error if we are not connected to MS-Windows. */ void @@ -3411,7 +3414,9 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) KillTimer (hwnd, menu_free_timer); menu_free_timer = 0; f = x_window_to_frame (dpyinfo, hwnd); - if (!f->output_data.w32->menu_command_in_progress) + /* If a popup menu is active, don't wipe its strings. */ + if (f->output_data.w32->menubar_active + && current_popup_menu == NULL) { /* Free memory used by owner-drawn and help-echo strings. */ w32_free_menu_strings (hwnd); @@ -3473,10 +3478,13 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) case WM_EXITMENULOOP: f = x_window_to_frame (dpyinfo, hwnd); - /* If a menu command is not already in progress, check again - after a short delay, since Windows often (always?) sends the - WM_EXITMENULOOP before the corresponding WM_COMMAND message. */ - if (f && !f->output_data.w32->menu_command_in_progress) + /* If a menu is still active, check again after a short delay, + since Windows often (always?) sends the WM_EXITMENULOOP + before the corresponding WM_COMMAND message. + Don't do this if a popup menu is active, since it is only + menubar menus that require cleaning up in this way. + */ + if (f && f->output_data.w32->menubar_active && current_popup_menu == NULL) menu_free_timer = SetTimer (hwnd, MENU_FREE_ID, MENU_FREE_DELAY, NULL); goto dflt; @@ -3634,7 +3642,6 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) f = x_window_to_frame (dpyinfo, hwnd); if (f && HIWORD (wParam) == 0) { - f->output_data.w32->menu_command_in_progress = 1; if (menu_free_timer) { KillTimer (hwnd, menu_free_timer); |