Commit d148e14d authored by Jason Rumney's avatar Jason Rumney
Browse files

* w32fns.c (hourglass_timer, hourglass_hwnd): New variables.

(syms_of_w32fns): Initialize them.
(HOURGLASS_ID): New constant.
(x_window_to_frame): Don't check hourglass_window.
(w32_wnd_proc) <WM_TIMER>: Handle hourglass_timer.
(w32_wnd_proc) <WM_EXITMENULOOP>: Set pending hourglass cursor.
(w32_wnd_proc) <WM_SETCURSOR>: Set the hourglass or current cursor.
(w32_wnd_proc) <WM_EMACS_SETCURSOR>: Set frame's current_cursor.
Only change the cursor if hourglass is not active.
(Fx_create_frame): Initialize frame's current_cursor.
(hourglass_atimer): Remove.
(hourglass_started): New function.
(start_hourglass, cancel_hourglass, hide_hourglass): Adapt to w32.
(show_hourglass): Adapt to w32, changing argument to frame.

* w32term.h (struct w32_output): Remove hourglass_window.
Add current_cursor.

* eval.c (call_debugger, Fsignal):
* keyboard.c (recursive_edit_1, cmd_error, Ftop_level)
(command_loop_1, Fread_key_sequence, Fread_key_sequence_vector)
(Fexecute_extended_command, cancel_hourglass_unwind):
* minibuf.c (read_minibuf):
* fns.c (Fy_or_n_p): Enable hourglass when HAVE_WINDOW_SYSTEM.
parent cdf8b62f
2008-03-19 Stefan Monnier <monnier@iro.umontreal.ca> 2008-03-19 Jason Rumney <jasonr@gnu.org>
* window.c (run_funs): New fun. * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
(run_window_configuration_change_hook): Use it to run the buffer-local (syms_of_w32fns): Initialize them.
and the global part of the hook. (HOURGLASS_ID): New constant.
(x_window_to_frame): Don't check hourglass_window.
* xdisp.c (format_mode_line_unwind_data): Add window argument. (w32_wnd_proc) <WM_TIMER>: Handle hourglass_timer.
(unwind_format_mode_line): Restore selected window. (w32_wnd_proc) <WM_EXITMENULOOP>: Set pending hourglass cursor.
(x_consider_frame_title, Fformat_mode_line): Set selected window. (w32_wnd_proc) <WM_SETCURSOR>: Set the hourglass or current cursor.
(w32_wnd_proc) <WM_EMACS_SETCURSOR>: Set frame's current_cursor.
Only change the cursor if hourglass is not active.
(Fx_create_frame): Initialize frame's current_cursor.
(hourglass_atimer): Remove.
(hourglass_started): New function.
(start_hourglass, cancel_hourglass, hide_hourglass): Adapt to w32.
(show_hourglass): Adapt to w32, changing argument to frame.
* w32term.h (struct w32_output): Remove hourglass_window.
Add current_cursor.
* eval.c (call_debugger, Fsignal):
* keyboard.c (recursive_edit_1, cmd_error, Ftop_level)
(command_loop_1, Fread_key_sequence, Fread_key_sequence_vector)
(Fexecute_extended_command, cancel_hourglass_unwind):
* minibuf.c (read_minibuf):
* fns.c (Fy_or_n_p): Enable hourglass when HAVE_WINDOW_SYSTEM.
2008-03-17 Stefan Monnier <monnier@iro.umontreal.ca> 2008-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
......
...@@ -283,7 +283,7 @@ call_debugger (arg) ...@@ -283,7 +283,7 @@ call_debugger (arg)
if (SPECPDL_INDEX () + 100 > max_specpdl_size) if (SPECPDL_INDEX () + 100 > max_specpdl_size)
max_specpdl_size = SPECPDL_INDEX () + 100; max_specpdl_size = SPECPDL_INDEX () + 100;
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p) if (display_hourglass_p)
cancel_hourglass (); cancel_hourglass ();
#endif #endif
...@@ -1640,7 +1640,7 @@ See also the function `condition-case'. */) ...@@ -1640,7 +1640,7 @@ See also the function `condition-case'. */)
#if 0 /* rms: I don't know why this was here, #if 0 /* rms: I don't know why this was here,
but it is surely wrong for an error that is handled. */ but it is surely wrong for an error that is handled. */
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p) if (display_hourglass_p)
cancel_hourglass (); cancel_hourglass ();
#endif #endif
......
...@@ -2600,7 +2600,7 @@ is nil and `use-dialog-box' is non-nil. */) ...@@ -2600,7 +2600,7 @@ is nil and `use-dialog-box' is non-nil. */)
xprompt = prompt; xprompt = prompt;
GCPRO2 (prompt, xprompt); GCPRO2 (prompt, xprompt);
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p) if (display_hourglass_p)
cancel_hourglass (); cancel_hourglass ();
#endif #endif
......
...@@ -935,7 +935,7 @@ recursive_edit_1 () ...@@ -935,7 +935,7 @@ recursive_edit_1 ()
specbind (Qstandard_input, Qt); specbind (Qstandard_input, Qt);
} }
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
/* The command loop has started an hourglass timer, so we have to /* The command loop has started an hourglass timer, so we have to
cancel it here, otherwise it will fire because the recursive edit cancel it here, otherwise it will fire because the recursive edit
can take some time. Do not check for display_hourglass_p here, can take some time. Do not check for display_hourglass_p here,
...@@ -1220,7 +1220,7 @@ cmd_error (data) ...@@ -1220,7 +1220,7 @@ cmd_error (data)
Lisp_Object old_level, old_length; Lisp_Object old_level, old_length;
char macroerror[50]; char macroerror[50];
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p) if (display_hourglass_p)
cancel_hourglass (); cancel_hourglass ();
#endif #endif
...@@ -1396,7 +1396,7 @@ DEFUN ("top-level", Ftop_level, Stop_level, 0, 0, "", ...@@ -1396,7 +1396,7 @@ DEFUN ("top-level", Ftop_level, Stop_level, 0, 0, "",
doc: /* Exit all recursive editing levels. */) doc: /* Exit all recursive editing levels. */)
() ()
{ {
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p) if (display_hourglass_p)
cancel_hourglass (); cancel_hourglass ();
#endif #endif
...@@ -1519,7 +1519,7 @@ static void adjust_point_for_property P_ ((int, int)); ...@@ -1519,7 +1519,7 @@ static void adjust_point_for_property P_ ((int, int));
/* Cancel hourglass from protect_unwind. /* Cancel hourglass from protect_unwind.
ARG is not used. */ ARG is not used. */
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
static Lisp_Object static Lisp_Object
cancel_hourglass_unwind (arg) cancel_hourglass_unwind (arg)
Lisp_Object arg; Lisp_Object arg;
...@@ -1891,7 +1891,7 @@ command_loop_1 () ...@@ -1891,7 +1891,7 @@ command_loop_1 ()
/* Here for a command that isn't executed directly */ /* Here for a command that isn't executed directly */
{ {
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
int scount = SPECPDL_INDEX (); int scount = SPECPDL_INDEX ();
if (display_hourglass_p if (display_hourglass_p
...@@ -1907,7 +1907,7 @@ command_loop_1 () ...@@ -1907,7 +1907,7 @@ command_loop_1 ()
Fundo_boundary (); Fundo_boundary ();
Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil); Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
/* Do not check display_hourglass_p here, because /* Do not check display_hourglass_p here, because
Fcommand_execute could change it, but we should cancel Fcommand_execute could change it, but we should cancel
hourglass cursor anyway. hourglass cursor anyway.
...@@ -10273,7 +10273,7 @@ will read just one key sequence. */) ...@@ -10273,7 +10273,7 @@ will read just one key sequence. */)
this_single_command_key_start = 0; this_single_command_key_start = 0;
} }
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p) if (display_hourglass_p)
cancel_hourglass (); cancel_hourglass ();
#endif #endif
...@@ -10285,7 +10285,7 @@ will read just one key sequence. */) ...@@ -10285,7 +10285,7 @@ will read just one key sequence. */)
#if 0 /* The following is fine for code reading a key sequence and #if 0 /* The following is fine for code reading a key sequence and
then proceeding with a lenghty computation, but it's not good then proceeding with a lenghty computation, but it's not good
for code reading keys in a loop, like an input method. */ for code reading keys in a loop, like an input method. */
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p) if (display_hourglass_p)
start_hourglass (); start_hourglass ();
#endif #endif
...@@ -10333,7 +10333,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector, ...@@ -10333,7 +10333,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
this_single_command_key_start = 0; this_single_command_key_start = 0;
} }
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p) if (display_hourglass_p)
cancel_hourglass (); cancel_hourglass ();
#endif #endif
...@@ -10342,7 +10342,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector, ...@@ -10342,7 +10342,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
prompt, ! NILP (dont_downcase_last), prompt, ! NILP (dont_downcase_last),
! NILP (can_return_switch_frame), 0); ! NILP (can_return_switch_frame), 0);
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p) if (display_hourglass_p)
start_hourglass (); start_hourglass ();
#endif #endif
...@@ -10465,7 +10465,7 @@ give to the command you invoke, if it asks for an argument. */) ...@@ -10465,7 +10465,7 @@ give to the command you invoke, if it asks for an argument. */)
Lisp_Object saved_keys, saved_last_point_position_buffer; Lisp_Object saved_keys, saved_last_point_position_buffer;
Lisp_Object bindings, value; Lisp_Object bindings, value;
struct gcpro gcpro1, gcpro2, gcpro3; struct gcpro gcpro1, gcpro2, gcpro3;
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
/* The call to Fcompleting_read wil start and cancel the hourglass, /* The call to Fcompleting_read wil start and cancel the hourglass,
but if the hourglass was already scheduled, this means that no but if the hourglass was already scheduled, this means that no
hourglass will be shown for the actual M-x command itself. hourglass will be shown for the actual M-x command itself.
...@@ -10505,7 +10505,7 @@ give to the command you invoke, if it asks for an argument. */) ...@@ -10505,7 +10505,7 @@ give to the command you invoke, if it asks for an argument. */)
Qt, Qnil, Qextended_command_history, Qnil, Qt, Qnil, Qextended_command_history, Qnil,
Qnil); Qnil);
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (hstarted) start_hourglass (); if (hstarted) start_hourglass ();
#endif #endif
......
...@@ -497,7 +497,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, ...@@ -497,7 +497,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
if (EQ (Vminibuffer_completing_file_name, Qlambda)) if (EQ (Vminibuffer_completing_file_name, Qlambda))
Vminibuffer_completing_file_name = Qnil; Vminibuffer_completing_file_name = Qnil;
#ifdef HAVE_X_WINDOWS #ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p) if (display_hourglass_p)
cancel_hourglass (); cancel_hourglass ();
#endif #endif
......
...@@ -154,6 +154,11 @@ Lisp_Object Vx_no_window_manager; ...@@ -154,6 +154,11 @@ Lisp_Object Vx_no_window_manager;
int display_hourglass_p; int display_hourglass_p;
/* If non-zero, a w32 timer that, when it expires, displays an
hourglass cursor on all frames. */
static unsigned hourglass_timer = 0;
static HWND hourglass_hwnd = NULL;
/* The background and shape of the mouse pointer, and shape when not /* The background and shape of the mouse pointer, and shape when not
over text or in the modeline. */ over text or in the modeline. */
...@@ -304,6 +309,7 @@ unsigned int msh_mousewheel = 0; ...@@ -304,6 +309,7 @@ unsigned int msh_mousewheel = 0;
#define MOUSE_BUTTON_ID 1 #define MOUSE_BUTTON_ID 1
#define MOUSE_MOVE_ID 2 #define MOUSE_MOVE_ID 2
#define MENU_FREE_ID 3 #define MENU_FREE_ID 3
#define HOURGLASS_ID 4
/* The delay (milliseconds) before a menu is freed after WM_EXITMENULOOP /* The delay (milliseconds) before a menu is freed after WM_EXITMENULOOP
is received. */ is received. */
#define MENU_FREE_DELAY 1000 #define MENU_FREE_DELAY 1000
...@@ -335,6 +341,11 @@ static HWND w32_visible_system_caret_hwnd; ...@@ -335,6 +341,11 @@ static HWND w32_visible_system_caret_hwnd;
extern HMENU current_popup_menu; extern HMENU current_popup_menu;
static int menubar_in_use = 0; static int menubar_in_use = 0;
/* Function prototypes for hourglass support. */
static void show_hourglass P_ ((struct frame *));
static void hide_hourglass P_ ((void));
/* Error if we are not connected to MS-Windows. */ /* Error if we are not connected to MS-Windows. */
void void
...@@ -423,8 +434,6 @@ x_window_to_frame (dpyinfo, wdesc) ...@@ -423,8 +434,6 @@ x_window_to_frame (dpyinfo, wdesc)
f = XFRAME (frame); f = XFRAME (frame);
if (!FRAME_W32_P (f) || FRAME_W32_DISPLAY_INFO (f) != dpyinfo) if (!FRAME_W32_P (f) || FRAME_W32_DISPLAY_INFO (f) != dpyinfo)
continue; continue;
if (f->output_data.w32->hourglass_window == wdesc)
return f;
if (FRAME_W32_WINDOW (f) == wdesc) if (FRAME_W32_WINDOW (f) == wdesc)
return f; return f;
...@@ -3525,6 +3534,12 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) ...@@ -3525,6 +3534,12 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
menubar_in_use = 0; menubar_in_use = 0;
} }
} }
else if (wParam == hourglass_timer)
{
KillTimer (hwnd, hourglass_timer);
hourglass_timer = 0;
show_hourglass (x_window_to_frame (dpyinfo, hwnd));
}
return 0; return 0;
case WM_NCACTIVATE: case WM_NCACTIVATE:
...@@ -3590,6 +3605,11 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) ...@@ -3590,6 +3605,11 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
*/ */
if (f && menubar_in_use && current_popup_menu == NULL) if (f && menubar_in_use && current_popup_menu == NULL)
menu_free_timer = SetTimer (hwnd, MENU_FREE_ID, MENU_FREE_DELAY, NULL); menu_free_timer = SetTimer (hwnd, MENU_FREE_ID, MENU_FREE_DELAY, NULL);
/* If hourglass cursor should be displayed, display it now. */
if (f && f->output_data.w32->hourglass_p)
SetCursor (f->output_data.w32->hourglass_cursor);
goto dflt; goto dflt;
case WM_MENUSELECT: case WM_MENUSELECT:
...@@ -3858,15 +3878,27 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) ...@@ -3858,15 +3878,27 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
case WM_SETCURSOR: case WM_SETCURSOR:
if (LOWORD (lParam) == HTCLIENT) if (LOWORD (lParam) == HTCLIENT)
{
f = x_window_to_frame (dpyinfo, hwnd);
if (f->output_data.w32->hourglass_p && !menubar_in_use
&& !current_popup_menu)
SetCursor (f->output_data.w32->hourglass_cursor);
else
SetCursor (f->output_data.w32->current_cursor);
return 0; return 0;
}
goto dflt; goto dflt;
case WM_EMACS_SETCURSOR: case WM_EMACS_SETCURSOR:
{ {
Cursor cursor = (Cursor) wParam; Cursor cursor = (Cursor) wParam;
if (cursor) f = x_window_to_frame (dpyinfo, hwnd);
if (f && cursor)
{
f->output_data.w32->current_cursor = cursor;
if (!f->output_data.w32->hourglass_p)
SetCursor (cursor); SetCursor (cursor);
}
return 0; return 0;
} }
...@@ -4528,6 +4560,8 @@ This function is an internal primitive--use `make-frame' instead. */) ...@@ -4528,6 +4560,8 @@ This function is an internal primitive--use `make-frame' instead. */)
f->output_data.w32->hourglass_cursor = w32_load_cursor (IDC_WAIT); f->output_data.w32->hourglass_cursor = w32_load_cursor (IDC_WAIT);
f->output_data.w32->horizontal_drag_cursor = w32_load_cursor (IDC_SIZEWE); f->output_data.w32->horizontal_drag_cursor = w32_load_cursor (IDC_SIZEWE);
f->output_data.w32->current_cursor = f->output_data.w32->nontext_cursor;
window_prompting = x_figure_window_size (f, parameters, 1); window_prompting = x_figure_window_size (f, parameters, 1);
tem = w32_get_arg (parameters, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); tem = w32_get_arg (parameters, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
...@@ -7216,11 +7250,6 @@ value. */) ...@@ -7216,11 +7250,6 @@ value. */)
Busy cursor Busy cursor
***********************************************************************/ ***********************************************************************/
/* If non-null, an asynchronous timer that, when it expires, displays
an hourglass cursor on all frames. */
static struct atimer *hourglass_atimer;
/* Non-zero means an hourglass cursor is currently shown. */ /* Non-zero means an hourglass cursor is currently shown. */
static int hourglass_shown_p; static int hourglass_shown_p;
...@@ -7234,20 +7263,22 @@ static Lisp_Object Vhourglass_delay; ...@@ -7234,20 +7263,22 @@ static Lisp_Object Vhourglass_delay;
#define DEFAULT_HOURGLASS_DELAY 1 #define DEFAULT_HOURGLASS_DELAY 1
/* Function prototypes. */ /* Return non-zero if houglass timer has been started or hourglass is shown. */
static void show_hourglass P_ ((struct atimer *));
static void hide_hourglass P_ ((void));
int
hourglass_started ()
{
return hourglass_shown_p || hourglass_timer;
}
/* Cancel a currently active hourglass timer, and start a new one. */ /* Cancel a currently active hourglass timer, and start a new one. */
void void
start_hourglass () start_hourglass ()
{ {
#if 0 /* TODO: cursor shape changes. */ DWORD delay;
EMACS_TIME delay; int secs, msecs = 0;
int secs, usecs = 0; struct frame * f = SELECTED_FRAME ();
cancel_hourglass (); cancel_hourglass ();
...@@ -7260,15 +7291,14 @@ start_hourglass () ...@@ -7260,15 +7291,14 @@ start_hourglass ()
Lisp_Object tem; Lisp_Object tem;
tem = Ftruncate (Vhourglass_delay, Qnil); tem = Ftruncate (Vhourglass_delay, Qnil);
secs = XFASTINT (tem); secs = XFASTINT (tem);
usecs = (XFLOAT_DATA (Vhourglass_delay) - secs) * 1000000; msecs = (XFLOAT_DATA (Vhourglass_delay) - secs) * 1000;
} }
else else
secs = DEFAULT_HOURGLASS_DELAY; secs = DEFAULT_HOURGLASS_DELAY;
EMACS_SET_SECS_USECS (delay, secs, usecs); delay = secs * 1000 + msecs;
hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, hourglass_hwnd = FRAME_W32_WINDOW (f);
show_hourglass, NULL); hourglass_timer = SetTimer (hourglass_hwnd, HOURGLASS_ID, delay, NULL);
#endif
} }
...@@ -7278,10 +7308,10 @@ start_hourglass () ...@@ -7278,10 +7308,10 @@ start_hourglass ()
void void
cancel_hourglass () cancel_hourglass ()
{ {
if (hourglass_atimer) if (hourglass_timer)
{ {
cancel_atimer (hourglass_atimer); KillTimer (hourglass_hwnd, hourglass_timer);
hourglass_atimer = NULL; hourglass_timer = 0;
} }
if (hourglass_shown_p) if (hourglass_shown_p)
...@@ -7289,62 +7319,22 @@ cancel_hourglass () ...@@ -7289,62 +7319,22 @@ cancel_hourglass ()
} }
/* Timer function of hourglass_atimer. TIMER is equal to /* Timer function of hourglass_timer.
hourglass_atimer.
Display an hourglass cursor on all frames by mapping the frames' Display an hourglass cursor. Set the hourglass_p flag in display info
hourglass_window. Set the hourglass_p flag in the frames' to indicate that an hourglass cursor is shown. */
output_data.x structure to indicate that an hourglass cursor is
shown on the frames. */
static void static void
show_hourglass (timer) show_hourglass (f)
struct atimer *timer; struct frame *f;
{ {
#if 0 /* TODO: cursor shape changes. */
/* The timer implementation will cancel this timer automatically
after this function has run. Set hourglass_atimer to null
so that we know the timer doesn't have to be canceled. */
hourglass_atimer = NULL;
if (!hourglass_shown_p) if (!hourglass_shown_p)
{ {
Lisp_Object rest, frame;
BLOCK_INPUT;
FOR_EACH_FRAME (rest, frame)
if (FRAME_W32_P (XFRAME (frame)))
{
struct frame *f = XFRAME (frame);
f->output_data.w32->hourglass_p = 1; f->output_data.w32->hourglass_p = 1;
if (!menubar_in_use && !current_popup_menu)
if (!f->output_data.w32->hourglass_window) SetCursor (f->output_data.w32->hourglass_cursor);
{
unsigned long mask = CWCursor;
XSetWindowAttributes attrs;
attrs.cursor = f->output_data.w32->hourglass_cursor;
f->output_data.w32->hourglass_window
= XCreateWindow (FRAME_X_DISPLAY (f),
FRAME_OUTER_WINDOW (f),
0, 0, 32000, 32000, 0, 0,
InputOnly,
CopyFromParent,
mask, &attrs);
}
XMapRaised (FRAME_X_DISPLAY (f),
f->output_data.w32->hourglass_window);
XFlush (FRAME_X_DISPLAY (f));
}
hourglass_shown_p = 1; hourglass_shown_p = 1;
UNBLOCK_INPUT;
} }
#endif
} }
...@@ -7353,33 +7343,15 @@ show_hourglass (timer) ...@@ -7353,33 +7343,15 @@ show_hourglass (timer)
static void static void
hide_hourglass () hide_hourglass ()
{ {
#if 0 /* TODO: cursor shape changes. */
if (hourglass_shown_p) if (hourglass_shown_p)
{ {
Lisp_Object rest, frame; struct frame *f = x_window_to_frame (&one_w32_display_info,
hourglass_hwnd);
BLOCK_INPUT;
FOR_EACH_FRAME (rest, frame)
{
struct frame *f = XFRAME (frame);
if (FRAME_W32_P (f)
/* Watch out for newly created frames. */
&& f->output_data.x->hourglass_window)
{
XUnmapWindow (FRAME_X_DISPLAY (f),
f->output_data.x->hourglass_window);
/* Sync here because XTread_socket looks at the
hourglass_p flag that is reset to zero below. */
XSync (FRAME_X_DISPLAY (f), False);
f->output_data.x->hourglass_p = 0;
}
}
f->output_data.w32->hourglass_p = 0;
SetCursor (f->output_data.w32->current_cursor);
hourglass_shown_p = 0; hourglass_shown_p = 0;
UNBLOCK_INPUT;
} }
#endif
} }
...@@ -9323,7 +9295,8 @@ versions of Windows) characters. */); ...@@ -9323,7 +9295,8 @@ versions of Windows) characters. */);
check_window_system_func = check_w32; check_window_system_func = check_w32;
hourglass_atimer = NULL; hourglass_timer = 0;
hourglass_hwnd = NULL;
hourglass_shown_p = 0; hourglass_shown_p = 0;
defsubr (&Sx_show_tip); defsubr (&Sx_show_tip);
defsubr (&Sx_hide_tip); defsubr (&Sx_hide_tip);
......
...@@ -361,13 +361,12 @@ struct w32_output ...@@ -361,13 +361,12 @@ struct w32_output
Cursor hourglass_cursor; Cursor hourglass_cursor;
Cursor horizontal_drag_cursor; Cursor horizontal_drag_cursor;
/* Window whose cursor is hourglass_cursor. This window is
temporarily mapped to display an hourglass cursor. */
Window hourglass_window;
/* Non-zero means hourglass cursor is currently displayed. */ /* Non-zero means hourglass cursor is currently displayed. */
unsigned hourglass_p : 1; unsigned hourglass_p : 1;
/* Non-hourglass cursor that is currently active. */
Cursor current_cursor;
/* Flag to set when the window needs to be completely repainted. */ /* Flag to set when the window needs to be completely repainted. */
int needs_exposure; int needs_exposure;
......