aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2002-02-23 00:07:22 +0000
committerJason Rumney2002-02-23 00:07:22 +0000
commit48094ace89162b049f2bd9c1ce05488593fd1c5e (patch)
tree72fa566e2a6ad5162f49f1d32379d249593d8c75 /src
parent71f6b2951950a0a42dce3a62796080f606d50f6e (diff)
downloademacs-48094ace89162b049f2bd9c1ce05488593fd1c5e.tar.gz
emacs-48094ace89162b049f2bd9c1ce05488593fd1c5e.zip
(mouse_move_timer, mouse_button_timer): Initialize.
(menu_free_timer): New variable. (MENU_FREE_ID, MENU_FREE_DELAY): New constants. (w32_wnd_proc) <WM_TIMER>: Handle menu_free_timer. <WM_EXITMENULOOP>: Delay before freeing menu. Do nothing if a menu command is in progress. <WM_COMMAND>: Set the menu_command_in_progress flag. Kill any menu_free_timer that is running.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog19
-rw-r--r--src/w32fns.c45
2 files changed, 55 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 58b0dd0ae24..9233ab15333 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,22 @@
12002-02-22 Jason Rumney <jasonr@gnu.org>
2
3 * w32term.h (struct w32_output): New member menu_command_in_progress.
4
5 * w32menu.c (menubar_selection_callback): Free the menu and
6 clear the menu_command_in_progress flag.
7
8 * w32fns.c (mouse_move_timer, mouse_button_timer): Initialize.
9 (menu_free_timer): New variable.
10 (MENU_FREE_ID, MENU_FREE_DELAY): New constants.
11 (w32_wnd_proc) <WM_TIMER>: Handle menu_free_timer.
12 <WM_EXITMENULOOP>: Delay before freeing menu. Do nothing if a
13 menu command is in progress.
14 <WM_COMMAND>: Set the menu_command_in_progress flag. Kill
15 any menu_free_timer that is running.
16
17 * w32term.c (w32_text_out): Renamed from W32_TEXTOUT.
18 Call ExtTextOutA rather than ExtTextOut.
19
12002-02-22 Eli Zaretskii <eliz@gnu.org> 202002-02-22 Eli Zaretskii <eliz@gnu.org>
2 21
3 * puresize.h (BASE_PURESIZE): Increase to 755000. 22 * puresize.h (BASE_PURESIZE): Increase to 755000.
diff --git a/src/w32fns.c b/src/w32fns.c
index 1ecc7169065..b3f37131640 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -286,9 +286,9 @@ extern Lisp_Object Qtool_bar_lines;
286 286
287static int button_state = 0; 287static int button_state = 0;
288static W32Msg saved_mouse_button_msg; 288static W32Msg saved_mouse_button_msg;
289static unsigned mouse_button_timer; /* non-zero when timer is active */ 289static unsigned mouse_button_timer = 0; /* non-zero when timer is active */
290static W32Msg saved_mouse_move_msg; 290static W32Msg saved_mouse_move_msg;
291static unsigned mouse_move_timer; 291static unsigned mouse_move_timer = 0;
292 292
293/* Window that is tracking the mouse. */ 293/* Window that is tracking the mouse. */
294static HWND track_mouse_window; 294static HWND track_mouse_window;
@@ -297,8 +297,14 @@ FARPROC track_mouse_event_fn;
297/* W95 mousewheel handler */ 297/* W95 mousewheel handler */
298unsigned int msh_mousewheel = 0; 298unsigned int msh_mousewheel = 0;
299 299
300/* Timers */
300#define MOUSE_BUTTON_ID 1 301#define MOUSE_BUTTON_ID 1
301#define MOUSE_MOVE_ID 2 302#define MOUSE_MOVE_ID 2
303#define MENU_FREE_ID 3
304/* The delay (milliseconds) before a menu is freed after WM_EXITMENULOOP
305 is received. */
306#define MENU_FREE_DELAY 1000
307static unsigned menu_free_timer = 0;
302 308
303/* The below are defined in frame.c. */ 309/* The below are defined in frame.c. */
304 310
@@ -4769,6 +4775,17 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
4769 KillTimer (hwnd, mouse_move_timer); 4775 KillTimer (hwnd, mouse_move_timer);
4770 mouse_move_timer = 0; 4776 mouse_move_timer = 0;
4771 } 4777 }
4778 else if (wParam == menu_free_timer)
4779 {
4780 KillTimer (hwnd, menu_free_timer);
4781 menu_free_timer = 0;
4782 if (!f->output_data.w32->menu_command_in_progress)
4783 {
4784 /* Free memory used by owner-drawn and help-echo strings. */
4785 w32_free_menu_strings (hwnd);
4786 f->output_data.w32->menubar_active = 0;
4787 }
4788 }
4772 return 0; 4789 return 0;
4773 4790
4774 case WM_NCACTIVATE: 4791 case WM_NCACTIVATE:
@@ -4824,12 +4841,11 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
4824 case WM_EXITMENULOOP: 4841 case WM_EXITMENULOOP:
4825 f = x_window_to_frame (dpyinfo, hwnd); 4842 f = x_window_to_frame (dpyinfo, hwnd);
4826 4843
4827 /* Free memory used by owner-drawn and help-echo strings. */ 4844 /* If a menu command is not already in progress, check again
4828 w32_free_menu_strings (hwnd); 4845 after a short delay, since Windows often (always?) sends the
4829 4846 WM_EXITMENULOOP before the corresponding WM_COMMAND message. */
4830 /* Indicate that menubar can be modified again. */ 4847 if (f && !f->output_data.w32->menu_command_in_progress)
4831 if (f) 4848 menu_free_timer = SetTimer (hwnd, MENU_FREE_ID, MENU_FREE_DELAY, NULL);
4832 f->output_data.w32->menubar_active = 0;
4833 goto dflt; 4849 goto dflt;
4834 4850
4835 case WM_MENUSELECT: 4851 case WM_MENUSELECT:
@@ -4966,9 +4982,20 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
4966 w32_system_caret_hwnd = NULL; 4982 w32_system_caret_hwnd = NULL;
4967 DestroyCaret (); 4983 DestroyCaret ();
4968 } 4984 }
4985 goto command;
4986 case WM_COMMAND:
4987 f = x_window_to_frame (dpyinfo, hwnd);
4988 if (f && HIWORD (wParam) == 0)
4989 {
4990 f->output_data.w32->menu_command_in_progress = 1;
4991 if (menu_free_timer)
4992 {
4993 KillTimer (hwnd, menu_free_timer);
4994 menu_free_timer = 0;
4995 }
4996 }
4969 case WM_MOVE: 4997 case WM_MOVE:
4970 case WM_SIZE: 4998 case WM_SIZE:
4971 case WM_COMMAND:
4972 command: 4999 command:
4973 wmsg.dwModifiers = w32_get_modifiers (); 5000 wmsg.dwModifiers = w32_get_modifiers ();
4974 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 5001 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);