diff options
| author | Jason Rumney | 2007-02-22 22:50:04 +0000 |
|---|---|---|
| committer | Jason Rumney | 2007-02-22 22:50:04 +0000 |
| commit | 5d22ded9ffdcc3d6ad29f7470768de49ee6d7829 (patch) | |
| tree | 224e4c00576ed51d2db36c952687b4e4010ebbc3 /src | |
| parent | b2a916a0f4be7baad98e2498c2ef7618f39e51b9 (diff) | |
| download | emacs-5d22ded9ffdcc3d6ad29f7470768de49ee6d7829.tar.gz emacs-5d22ded9ffdcc3d6ad29f7470768de49ee6d7829.zip | |
(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')
| -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; | |||
| 297 | 297 | ||
| 298 | static HWND w32_visible_system_caret_hwnd; | 298 | static HWND w32_visible_system_caret_hwnd; |
| 299 | 299 | ||
| 300 | /* From w32menu.c */ | ||
| 301 | extern HMENU current_popup_menu; | ||
| 302 | |||
| 300 | 303 | ||
| 301 | /* Error if we are not connected to MS-Windows. */ | 304 | /* Error if we are not connected to MS-Windows. */ |
| 302 | void | 305 | void |
| @@ -3411,7 +3414,9 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3411 | KillTimer (hwnd, menu_free_timer); | 3414 | KillTimer (hwnd, menu_free_timer); |
| 3412 | menu_free_timer = 0; | 3415 | menu_free_timer = 0; |
| 3413 | f = x_window_to_frame (dpyinfo, hwnd); | 3416 | f = x_window_to_frame (dpyinfo, hwnd); |
| 3414 | if (!f->output_data.w32->menu_command_in_progress) | 3417 | /* If a popup menu is active, don't wipe its strings. */ |
| 3418 | if (f->output_data.w32->menubar_active | ||
| 3419 | && current_popup_menu == NULL) | ||
| 3415 | { | 3420 | { |
| 3416 | /* Free memory used by owner-drawn and help-echo strings. */ | 3421 | /* Free memory used by owner-drawn and help-echo strings. */ |
| 3417 | w32_free_menu_strings (hwnd); | 3422 | w32_free_menu_strings (hwnd); |
| @@ -3473,10 +3478,13 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3473 | case WM_EXITMENULOOP: | 3478 | case WM_EXITMENULOOP: |
| 3474 | f = x_window_to_frame (dpyinfo, hwnd); | 3479 | f = x_window_to_frame (dpyinfo, hwnd); |
| 3475 | 3480 | ||
| 3476 | /* If a menu command is not already in progress, check again | 3481 | /* If a menu is still active, check again after a short delay, |
| 3477 | after a short delay, since Windows often (always?) sends the | 3482 | since Windows often (always?) sends the WM_EXITMENULOOP |
| 3478 | WM_EXITMENULOOP before the corresponding WM_COMMAND message. */ | 3483 | before the corresponding WM_COMMAND message. |
| 3479 | if (f && !f->output_data.w32->menu_command_in_progress) | 3484 | Don't do this if a popup menu is active, since it is only |
| 3485 | menubar menus that require cleaning up in this way. | ||
| 3486 | */ | ||
| 3487 | if (f && f->output_data.w32->menubar_active && current_popup_menu == NULL) | ||
| 3480 | menu_free_timer = SetTimer (hwnd, MENU_FREE_ID, MENU_FREE_DELAY, NULL); | 3488 | menu_free_timer = SetTimer (hwnd, MENU_FREE_ID, MENU_FREE_DELAY, NULL); |
| 3481 | goto dflt; | 3489 | goto dflt; |
| 3482 | 3490 | ||
| @@ -3634,7 +3642,6 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3634 | f = x_window_to_frame (dpyinfo, hwnd); | 3642 | f = x_window_to_frame (dpyinfo, hwnd); |
| 3635 | if (f && HIWORD (wParam) == 0) | 3643 | if (f && HIWORD (wParam) == 0) |
| 3636 | { | 3644 | { |
| 3637 | f->output_data.w32->menu_command_in_progress = 1; | ||
| 3638 | if (menu_free_timer) | 3645 | if (menu_free_timer) |
| 3639 | { | 3646 | { |
| 3640 | KillTimer (hwnd, menu_free_timer); | 3647 | KillTimer (hwnd, menu_free_timer); |