diff options
| author | Dmitry Antipov | 2014-07-03 22:12:41 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-07-03 22:12:41 +0400 |
| commit | af8ee9ca886f2863716f209a51ef9c547a8aecc9 (patch) | |
| tree | bdcee2605717f1bd7fdd2e1f2381a9ef545d5f1e /src | |
| parent | 046d53d46e0b619d5504bad92ab9e7c98a7b1c61 (diff) | |
| download | emacs-af8ee9ca886f2863716f209a51ef9c547a8aecc9.tar.gz emacs-af8ee9ca886f2863716f209a51ef9c547a8aecc9.zip | |
On MS-Windows, display busy cursor on all GUI frames.
This is similar to what we have on X. Quickly tested by Dani Moncayo.
* w32fns.c (toplevel): Remove hourglass_hwnd; no longer used.
(w32_show_hourglass, w32_hide_hourglass, w32_note_current_window):
Likewise.
(hide_hourglass, show_hourglass): Redesign to match X counterparts.
* xdisp.c (start_hourglass): Remove Windows-specific bits.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/w32fns.c | 107 | ||||
| -rw-r--r-- | src/xdisp.c | 7 |
3 files changed, 42 insertions, 82 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7fb620fc533..cbb89300cad 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,15 @@ | |||
| 1 | 2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> | 1 | 2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 2 | ||
| 3 | On MS-Windows, display busy cursor on all GUI frames. | ||
| 4 | This is similar to what we have on X. Quickly tested by Dani Moncayo. | ||
| 5 | * w32fns.c (toplevel): Remove hourglass_hwnd; no longer used. | ||
| 6 | (w32_show_hourglass, w32_hide_hourglass, w32_note_current_window): | ||
| 7 | Likewise. | ||
| 8 | (hide_hourglass, show_hourglass): Redesign to match X counterparts. | ||
| 9 | * xdisp.c (start_hourglass): Remove Windows-specific bits. | ||
| 10 | |||
| 11 | 2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 12 | |||
| 3 | Use convenient alists to manage per-frame font driver-specific data. | 13 | Use convenient alists to manage per-frame font driver-specific data. |
| 4 | * frame.h (struct frame): Rename font_data_list to... | 14 | * frame.h (struct frame): Rename font_data_list to... |
| 5 | [HAVE_XFT || HAVE_FREETYPE]: ... font_data, which is a Lisp_Object now. | 15 | [HAVE_XFT || HAVE_FREETYPE]: ... font_data, which is a Lisp_Object now. |
diff --git a/src/w32fns.c b/src/w32fns.c index e24148af4ff..def9d8acb7a 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -89,9 +89,6 @@ extern void w32_free_menu_strings (HWND); | |||
| 89 | extern const char *map_w32_filename (const char *, const char **); | 89 | extern const char *map_w32_filename (const char *, const char **); |
| 90 | extern char * w32_strerror (int error_no); | 90 | extern char * w32_strerror (int error_no); |
| 91 | 91 | ||
| 92 | /* If non-NULL, a handle to a frame where to display the hourglass cursor. */ | ||
| 93 | static HWND hourglass_hwnd = NULL; | ||
| 94 | |||
| 95 | #ifndef IDC_HAND | 92 | #ifndef IDC_HAND |
| 96 | #define IDC_HAND MAKEINTRESOURCE(32649) | 93 | #define IDC_HAND MAKEINTRESOURCE(32649) |
| 97 | #endif | 94 | #endif |
| @@ -233,10 +230,6 @@ static int menubar_in_use = 0; | |||
| 233 | extern void syms_of_w32uniscribe (void); | 230 | extern void syms_of_w32uniscribe (void); |
| 234 | extern int uniscribe_available; | 231 | extern int uniscribe_available; |
| 235 | 232 | ||
| 236 | /* Function prototypes for hourglass support. */ | ||
| 237 | static void w32_show_hourglass (struct frame *); | ||
| 238 | static void w32_hide_hourglass (void); | ||
| 239 | |||
| 240 | #ifdef WINDOWSNT | 233 | #ifdef WINDOWSNT |
| 241 | /* From w32inevt.c */ | 234 | /* From w32inevt.c */ |
| 242 | extern int faked_key; | 235 | extern int faked_key; |
| @@ -5500,95 +5493,62 @@ no value of TYPE (always string in the MS Windows case). */) | |||
| 5500 | Busy cursor | 5493 | Busy cursor |
| 5501 | ***********************************************************************/ | 5494 | ***********************************************************************/ |
| 5502 | 5495 | ||
| 5503 | void | 5496 | /* Display an hourglass cursor. Set the hourglass_p flag in display info |
| 5504 | w32_note_current_window (void) | 5497 | to indicate that an hourglass cursor is shown. */ |
| 5505 | { | ||
| 5506 | struct frame * f = SELECTED_FRAME (); | ||
| 5507 | |||
| 5508 | if (!FRAME_W32_P (f)) | ||
| 5509 | return; | ||
| 5510 | |||
| 5511 | hourglass_hwnd = FRAME_W32_WINDOW (f); | ||
| 5512 | } | ||
| 5513 | 5498 | ||
| 5514 | void | 5499 | void |
| 5515 | show_hourglass (struct atimer *timer) | 5500 | show_hourglass (struct atimer *timer) |
| 5516 | { | 5501 | { |
| 5517 | struct frame *f; | ||
| 5518 | |||
| 5519 | hourglass_atimer = NULL; | 5502 | hourglass_atimer = NULL; |
| 5520 | 5503 | ||
| 5521 | block_input (); | 5504 | if (!hourglass_shown_p) |
| 5522 | f = x_window_to_frame (&one_w32_display_info, | ||
| 5523 | hourglass_hwnd); | ||
| 5524 | |||
| 5525 | if (f) | ||
| 5526 | f->output_data.w32->hourglass_p = 0; | ||
| 5527 | else | ||
| 5528 | f = SELECTED_FRAME (); | ||
| 5529 | |||
| 5530 | if (!FRAME_W32_P (f)) | ||
| 5531 | { | 5505 | { |
| 5532 | unblock_input (); | 5506 | Lisp_Object tail, frame; |
| 5533 | return; | ||
| 5534 | } | ||
| 5535 | |||
| 5536 | w32_show_hourglass (f); | ||
| 5537 | unblock_input (); | ||
| 5538 | } | ||
| 5539 | 5507 | ||
| 5540 | void | 5508 | block_input (); |
| 5541 | hide_hourglass (void) | 5509 | FOR_EACH_FRAME (tail, frame) |
| 5542 | { | 5510 | { |
| 5543 | block_input (); | 5511 | struct frame *f = XFRAME (frame); |
| 5544 | w32_hide_hourglass (); | ||
| 5545 | unblock_input (); | ||
| 5546 | } | ||
| 5547 | |||
| 5548 | |||
| 5549 | /* Display an hourglass cursor. Set the hourglass_p flag in display info | ||
| 5550 | to indicate that an hourglass cursor is shown. */ | ||
| 5551 | 5512 | ||
| 5552 | static void | 5513 | if (FRAME_W32_P (f) && !menubar_in_use && !current_popup_menu) |
| 5553 | w32_show_hourglass (struct frame *f) | 5514 | { |
| 5554 | { | 5515 | f->output_data.w32->hourglass_p = 1; |
| 5555 | if (!hourglass_shown_p) | 5516 | SetCursor (f->output_data.w32->hourglass_cursor); |
| 5556 | { | 5517 | } |
| 5557 | f->output_data.w32->hourglass_p = 1; | 5518 | } |
| 5558 | if (!menubar_in_use && !current_popup_menu) | 5519 | unblock_input (); |
| 5559 | SetCursor (f->output_data.w32->hourglass_cursor); | ||
| 5560 | hourglass_shown_p = 1; | 5520 | hourglass_shown_p = 1; |
| 5561 | } | 5521 | } |
| 5562 | } | 5522 | } |
| 5563 | 5523 | ||
| 5564 | |||
| 5565 | /* Hide the hourglass cursor on all frames, if it is currently shown. */ | 5524 | /* Hide the hourglass cursor on all frames, if it is currently shown. */ |
| 5566 | 5525 | ||
| 5567 | static void | 5526 | void |
| 5568 | w32_hide_hourglass (void) | 5527 | hide_hourglass (void) |
| 5569 | { | 5528 | { |
| 5570 | if (hourglass_shown_p) | 5529 | if (hourglass_shown_p) |
| 5571 | { | 5530 | { |
| 5572 | struct frame *f = x_window_to_frame (&one_w32_display_info, | 5531 | Lisp_Object tail, frame; |
| 5573 | hourglass_hwnd); | ||
| 5574 | if (f) | ||
| 5575 | f->output_data.w32->hourglass_p = 0; | ||
| 5576 | else | ||
| 5577 | /* If frame was deleted, restore to selected frame's cursor. */ | ||
| 5578 | f = SELECTED_FRAME (); | ||
| 5579 | 5532 | ||
| 5580 | if (FRAME_W32_P (f)) | 5533 | block_input (); |
| 5581 | SetCursor (f->output_data.w32->current_cursor); | 5534 | FOR_EACH_FRAME (tail, frame) |
| 5582 | else | 5535 | { |
| 5583 | /* No cursors on non GUI frames - restore to stock arrow cursor. */ | 5536 | struct frame *f = XFRAME (frame); |
| 5584 | SetCursor (w32_load_cursor (IDC_ARROW)); | ||
| 5585 | 5537 | ||
| 5538 | if (FRAME_W32_P (f)) | ||
| 5539 | { | ||
| 5540 | f->output_data.w32->hourglass_p = 0; | ||
| 5541 | SetCursor (f->output_data.w32->current_cursor); | ||
| 5542 | } | ||
| 5543 | else | ||
| 5544 | /* No cursors on non GUI frames - restore to stock arrow cursor. */ | ||
| 5545 | SetCursor (w32_load_cursor (IDC_ARROW)); | ||
| 5546 | } | ||
| 5547 | unblock_input (); | ||
| 5586 | hourglass_shown_p = 0; | 5548 | hourglass_shown_p = 0; |
| 5587 | } | 5549 | } |
| 5588 | } | 5550 | } |
| 5589 | 5551 | ||
| 5590 | |||
| 5591 | |||
| 5592 | /*********************************************************************** | 5552 | /*********************************************************************** |
| 5593 | Tool tips | 5553 | Tool tips |
| 5594 | ***********************************************************************/ | 5554 | ***********************************************************************/ |
| @@ -8415,9 +8375,6 @@ only be necessary if the default setting causes problems. */); | |||
| 8415 | #endif | 8375 | #endif |
| 8416 | 8376 | ||
| 8417 | defsubr (&Sset_message_beep); | 8377 | defsubr (&Sset_message_beep); |
| 8418 | |||
| 8419 | hourglass_hwnd = NULL; | ||
| 8420 | |||
| 8421 | defsubr (&Sx_show_tip); | 8378 | defsubr (&Sx_show_tip); |
| 8422 | defsubr (&Sx_hide_tip); | 8379 | defsubr (&Sx_hide_tip); |
| 8423 | tip_timer = Qnil; | 8380 | tip_timer = Qnil; |
diff --git a/src/xdisp.c b/src/xdisp.c index 3e76d3df9f9..6cec0bf1925 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -30683,13 +30683,6 @@ start_hourglass (void) | |||
| 30683 | else | 30683 | else |
| 30684 | delay = make_timespec (DEFAULT_HOURGLASS_DELAY, 0); | 30684 | delay = make_timespec (DEFAULT_HOURGLASS_DELAY, 0); |
| 30685 | 30685 | ||
| 30686 | #ifdef HAVE_NTGUI | ||
| 30687 | { | ||
| 30688 | extern void w32_note_current_window (void); | ||
| 30689 | w32_note_current_window (); | ||
| 30690 | } | ||
| 30691 | #endif /* HAVE_NTGUI */ | ||
| 30692 | |||
| 30693 | hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, | 30686 | hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, |
| 30694 | show_hourglass, NULL); | 30687 | show_hourglass, NULL); |
| 30695 | } | 30688 | } |