diff options
| author | Po Lu | 2022-03-27 19:53:49 +0800 |
|---|---|---|
| committer | Po Lu | 2022-03-27 19:53:49 +0800 |
| commit | 46863b7dfa210e73244af9bc790222dd66d5051d (patch) | |
| tree | 7ea45870ae53962d97454858da4f7c597041ffc6 /src/pgtkterm.c | |
| parent | 9f43549cdfaeb26392f6b99524ae35c4101d0eb7 (diff) | |
| download | emacs-46863b7dfa210e73244af9bc790222dd66d5051d.tar.gz emacs-46863b7dfa210e73244af9bc790222dd66d5051d.zip | |
Clean up PGTK cursor blanking code
* src/pgtkterm.c (XTframe_rehighlight): Rename to
`pgtk_frame_rehighlight_hook'. All callers changed.
(x_toggle_visible_pointer): Rename to
`pgtk_toggle_visible_pointer'. All callers changed.
(x_setup_pointer_blanking, XTtoggle_invisible_pointer): Delete
functions.
(pgtk_create_terminal): Use new names for various hooks.
(pgtk_term_init): Set up blank cursor directly.
* src/pgtkterm.h (struct pgtk_display_info): Remove
`toggle_visible_pointer'.
Diffstat (limited to 'src/pgtkterm.c')
| -rw-r--r-- | src/pgtkterm.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c index e00ed7fa85d..216b5ee7dd5 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c | |||
| @@ -4697,16 +4697,17 @@ pgtk_frame_rehighlight (struct pgtk_display_info *dpyinfo) | |||
| 4697 | the appropriate X display info. */ | 4697 | the appropriate X display info. */ |
| 4698 | 4698 | ||
| 4699 | static void | 4699 | static void |
| 4700 | XTframe_rehighlight (struct frame *frame) | 4700 | pgtk_frame_rehighlight_hook (struct frame *frame) |
| 4701 | { | 4701 | { |
| 4702 | pgtk_frame_rehighlight (FRAME_DISPLAY_INFO (frame)); | 4702 | pgtk_frame_rehighlight (FRAME_DISPLAY_INFO (frame)); |
| 4703 | } | 4703 | } |
| 4704 | 4704 | ||
| 4705 | 4705 | ||
| 4706 | /* Toggle mouse pointer visibility on frame F by using invisible cursor. */ | 4706 | /* Set whether or not the mouse pointer should be visible on frame |
| 4707 | F. */ | ||
| 4707 | 4708 | ||
| 4708 | static void | 4709 | static void |
| 4709 | x_toggle_visible_pointer (struct frame *f, bool invisible) | 4710 | pgtk_toggle_invisible_pointer (struct frame *f, bool invisible) |
| 4710 | { | 4711 | { |
| 4711 | Emacs_Cursor cursor; | 4712 | Emacs_Cursor cursor; |
| 4712 | if (invisible) | 4713 | if (invisible) |
| @@ -4718,22 +4719,6 @@ x_toggle_visible_pointer (struct frame *f, bool invisible) | |||
| 4718 | f->pointer_invisible = invisible; | 4719 | f->pointer_invisible = invisible; |
| 4719 | } | 4720 | } |
| 4720 | 4721 | ||
| 4721 | static void | ||
| 4722 | x_setup_pointer_blanking (struct pgtk_display_info *dpyinfo) | ||
| 4723 | { | ||
| 4724 | dpyinfo->toggle_visible_pointer = x_toggle_visible_pointer; | ||
| 4725 | dpyinfo->invisible_cursor = | ||
| 4726 | gdk_cursor_new_for_display (dpyinfo->gdpy, GDK_BLANK_CURSOR); | ||
| 4727 | } | ||
| 4728 | |||
| 4729 | static void | ||
| 4730 | XTtoggle_invisible_pointer (struct frame *f, bool invisible) | ||
| 4731 | { | ||
| 4732 | block_input (); | ||
| 4733 | FRAME_DISPLAY_INFO (f)->toggle_visible_pointer (f, invisible); | ||
| 4734 | unblock_input (); | ||
| 4735 | } | ||
| 4736 | |||
| 4737 | /* The focus has changed. Update the frames as necessary to reflect | 4722 | /* The focus has changed. Update the frames as necessary to reflect |
| 4738 | the new situation. Note that we can't change the selected frame | 4723 | the new situation. Note that we can't change the selected frame |
| 4739 | here, because the Lisp code we are interrupting might become confused. | 4724 | here, because the Lisp code we are interrupting might become confused. |
| @@ -4790,13 +4775,13 @@ pgtk_create_terminal (struct pgtk_display_info *dpyinfo) | |||
| 4790 | 4775 | ||
| 4791 | terminal->clear_frame_hook = pgtk_clear_frame; | 4776 | terminal->clear_frame_hook = pgtk_clear_frame; |
| 4792 | terminal->ring_bell_hook = pgtk_ring_bell; | 4777 | terminal->ring_bell_hook = pgtk_ring_bell; |
| 4793 | terminal->toggle_invisible_pointer_hook = XTtoggle_invisible_pointer; | 4778 | terminal->toggle_invisible_pointer_hook = pgtk_toggle_invisible_pointer; |
| 4794 | terminal->update_begin_hook = pgtk_update_begin; | 4779 | terminal->update_begin_hook = pgtk_update_begin; |
| 4795 | terminal->update_end_hook = pgtk_update_end; | 4780 | terminal->update_end_hook = pgtk_update_end; |
| 4796 | terminal->read_socket_hook = pgtk_read_socket; | 4781 | terminal->read_socket_hook = pgtk_read_socket; |
| 4797 | terminal->frame_up_to_date_hook = pgtk_frame_up_to_date; | 4782 | terminal->frame_up_to_date_hook = pgtk_frame_up_to_date; |
| 4798 | terminal->mouse_position_hook = pgtk_mouse_position; | 4783 | terminal->mouse_position_hook = pgtk_mouse_position; |
| 4799 | terminal->frame_rehighlight_hook = XTframe_rehighlight; | 4784 | terminal->frame_rehighlight_hook = pgtk_frame_rehighlight_hook; |
| 4800 | terminal->buffer_flipping_unblocked_hook = pgtk_buffer_flipping_unblocked_hook; | 4785 | terminal->buffer_flipping_unblocked_hook = pgtk_buffer_flipping_unblocked_hook; |
| 4801 | terminal->frame_raise_lower_hook = pgtk_frame_raise_lower; | 4786 | terminal->frame_raise_lower_hook = pgtk_frame_raise_lower; |
| 4802 | terminal->frame_visible_invisible_hook = pgtk_make_frame_visible_invisible; | 4787 | terminal->frame_visible_invisible_hook = pgtk_make_frame_visible_invisible; |
| @@ -5772,7 +5757,7 @@ x_focus_changed (gboolean is_enter, int state, | |||
| 5772 | } | 5757 | } |
| 5773 | 5758 | ||
| 5774 | if (frame->pointer_invisible) | 5759 | if (frame->pointer_invisible) |
| 5775 | XTtoggle_invisible_pointer (frame, false); | 5760 | pgtk_toggle_invisible_pointer (frame, false); |
| 5776 | } | 5761 | } |
| 5777 | } | 5762 | } |
| 5778 | 5763 | ||
| @@ -6754,7 +6739,8 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) | |||
| 6754 | init_sigio (dpyinfo->connection); | 6739 | init_sigio (dpyinfo->connection); |
| 6755 | } | 6740 | } |
| 6756 | 6741 | ||
| 6757 | x_setup_pointer_blanking (dpyinfo); | 6742 | dpyinfo->invisible_cursor |
| 6743 | = gdk_cursor_new_for_display (dpyinfo->gdpy, GDK_BLANK_CURSOR); | ||
| 6758 | 6744 | ||
| 6759 | xsettings_initialize (dpyinfo); | 6745 | xsettings_initialize (dpyinfo); |
| 6760 | 6746 | ||