diff options
| author | Dmitry Antipov | 2014-05-28 12:00:10 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-05-28 12:00:10 +0400 |
| commit | 632fd57c5b4aa2cface82b43e17879147c4c1308 (patch) | |
| tree | cb5ff8a7b63057d16a90933570214c591b73e079 /src | |
| parent | 6c2038223bffd69bf643a923968fa6851a302fd8 (diff) | |
| download | emacs-632fd57c5b4aa2cface82b43e17879147c4c1308.tar.gz emacs-632fd57c5b4aa2cface82b43e17879147c4c1308.zip | |
On X, always make pointer visible when deleting frame (Bug#17609).
* frame.c (frame_make_pointer_visible, frame_make_pointer_invisible):
Pass frame as arg.
* frame.h (frame_make_pointer_visible, frame_make_pointer_invisible):
Adjust prototypes.
* cmds.c (Fself_insert_command): Use SELECTED_FRAME.
* keyboard.c (gobble_input): If there is no terminal input error,
make sure the pointer is visible for all frames on this terminal.
* xterm.c (x_free_frame_resources): Always enable pointer visibility.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/cmds.c | 2 | ||||
| -rw-r--r-- | src/frame.c | 19 | ||||
| -rw-r--r-- | src/frame.h | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 16 | ||||
| -rw-r--r-- | src/xterm.c | 4 |
6 files changed, 37 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b57aec9770e..c1e29dd206c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2014-05-28 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | On X, always make pointer visible when deleting frame (Bug#17609). | ||
| 4 | * frame.c (frame_make_pointer_visible, frame_make_pointer_invisible): | ||
| 5 | Pass frame as arg. | ||
| 6 | * frame.h (frame_make_pointer_visible, frame_make_pointer_invisible): | ||
| 7 | Adjust prototypes. | ||
| 8 | * cmds.c (Fself_insert_command): Use SELECTED_FRAME. | ||
| 9 | * keyboard.c (gobble_input): If there is no terminal input error, | ||
| 10 | make sure the pointer is visible for all frames on this terminal. | ||
| 11 | * xterm.c (x_free_frame_resources): Always enable pointer visibility. | ||
| 12 | |||
| 1 | 2014-05-28 Stefan Monnier <monnier@iro.umontreal.ca> | 13 | 2014-05-28 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 14 | ||
| 3 | * data.c (Fzerop): Move to Elisp. | 15 | * data.c (Fzerop): Move to Elisp. |
diff --git a/src/cmds.c b/src/cmds.c index 7459908828d..b5aa69d6391 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -315,7 +315,7 @@ At the end, it runs `post-self-insert-hook'. */) | |||
| 315 | int val = internal_self_insert (character, XFASTINT (n)); | 315 | int val = internal_self_insert (character, XFASTINT (n)); |
| 316 | if (val == 2) | 316 | if (val == 2) |
| 317 | nonundocount = 0; | 317 | nonundocount = 0; |
| 318 | frame_make_pointer_invisible (); | 318 | frame_make_pointer_invisible (SELECTED_FRAME ()); |
| 319 | } | 319 | } |
| 320 | 320 | ||
| 321 | return Qnil; | 321 | return Qnil; |
diff --git a/src/frame.c b/src/frame.c index 08d0efb6ea2..ece0537a203 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -4373,16 +4373,11 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p) | |||
| 4373 | #endif /* HAVE_WINDOW_SYSTEM */ | 4373 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 4374 | 4374 | ||
| 4375 | void | 4375 | void |
| 4376 | frame_make_pointer_invisible (void) | 4376 | frame_make_pointer_invisible (struct frame *f) |
| 4377 | { | 4377 | { |
| 4378 | if (! NILP (Vmake_pointer_invisible)) | 4378 | if (! NILP (Vmake_pointer_invisible)) |
| 4379 | { | 4379 | { |
| 4380 | struct frame *f; | 4380 | if (f && FRAME_LIVE_P (f) && !f->pointer_invisible |
| 4381 | if (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame))) | ||
| 4382 | return; | ||
| 4383 | |||
| 4384 | f = SELECTED_FRAME (); | ||
| 4385 | if (f && !f->pointer_invisible | ||
| 4386 | && FRAME_TERMINAL (f)->toggle_invisible_pointer_hook) | 4381 | && FRAME_TERMINAL (f)->toggle_invisible_pointer_hook) |
| 4387 | { | 4382 | { |
| 4388 | f->mouse_moved = 0; | 4383 | f->mouse_moved = 0; |
| @@ -4393,17 +4388,11 @@ frame_make_pointer_invisible (void) | |||
| 4393 | } | 4388 | } |
| 4394 | 4389 | ||
| 4395 | void | 4390 | void |
| 4396 | frame_make_pointer_visible (void) | 4391 | frame_make_pointer_visible (struct frame *f) |
| 4397 | { | 4392 | { |
| 4398 | /* We don't check Vmake_pointer_invisible here in case the | 4393 | /* We don't check Vmake_pointer_invisible here in case the |
| 4399 | pointer was invisible when Vmake_pointer_invisible was set to nil. */ | 4394 | pointer was invisible when Vmake_pointer_invisible was set to nil. */ |
| 4400 | struct frame *f; | 4395 | if (f && FRAME_LIVE_P (f) && f->pointer_invisible && f->mouse_moved |
| 4401 | |||
| 4402 | if (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame))) | ||
| 4403 | return; | ||
| 4404 | |||
| 4405 | f = SELECTED_FRAME (); | ||
| 4406 | if (f && f->pointer_invisible && f->mouse_moved | ||
| 4407 | && FRAME_TERMINAL (f)->toggle_invisible_pointer_hook) | 4396 | && FRAME_TERMINAL (f)->toggle_invisible_pointer_hook) |
| 4408 | { | 4397 | { |
| 4409 | FRAME_TERMINAL (f)->toggle_invisible_pointer_hook (f, 0); | 4398 | FRAME_TERMINAL (f)->toggle_invisible_pointer_hook (f, 0); |
diff --git a/src/frame.h b/src/frame.h index ff696df9eff..c0c206d7c6a 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -995,8 +995,8 @@ extern struct frame *make_frame_without_minibuffer (Lisp_Object, | |||
| 995 | #endif /* HAVE_WINDOW_SYSTEM */ | 995 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 996 | extern bool window_system_available (struct frame *); | 996 | extern bool window_system_available (struct frame *); |
| 997 | extern void check_window_system (struct frame *); | 997 | extern void check_window_system (struct frame *); |
| 998 | extern void frame_make_pointer_invisible (void); | 998 | extern void frame_make_pointer_invisible (struct frame *); |
| 999 | extern void frame_make_pointer_visible (void); | 999 | extern void frame_make_pointer_visible (struct frame *); |
| 1000 | extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object); | 1000 | extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object); |
| 1001 | 1001 | ||
| 1002 | extern Lisp_Object Vframe_list; | 1002 | extern Lisp_Object Vframe_list; |
diff --git a/src/keyboard.c b/src/keyboard.c index 0308b7106d7..e92c86b7dbf 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -6877,6 +6877,20 @@ gobble_input (void) | |||
| 6877 | } | 6877 | } |
| 6878 | } | 6878 | } |
| 6879 | 6879 | ||
| 6880 | /* If there was no error, make sure the pointer | ||
| 6881 | is visible for all frames on this terminal. */ | ||
| 6882 | if (nr >= 0) | ||
| 6883 | { | ||
| 6884 | Lisp_Object tail, frame; | ||
| 6885 | |||
| 6886 | FOR_EACH_FRAME (tail, frame) | ||
| 6887 | { | ||
| 6888 | struct frame *f = XFRAME (frame); | ||
| 6889 | if (FRAME_TERMINAL (f) == t) | ||
| 6890 | frame_make_pointer_visible (f); | ||
| 6891 | } | ||
| 6892 | } | ||
| 6893 | |||
| 6880 | if (hold_quit.kind != NO_EVENT) | 6894 | if (hold_quit.kind != NO_EVENT) |
| 6881 | kbd_buffer_store_event (&hold_quit); | 6895 | kbd_buffer_store_event (&hold_quit); |
| 6882 | } | 6896 | } |
| @@ -6887,8 +6901,6 @@ gobble_input (void) | |||
| 6887 | if (err && !nread) | 6901 | if (err && !nread) |
| 6888 | nread = -1; | 6902 | nread = -1; |
| 6889 | 6903 | ||
| 6890 | frame_make_pointer_visible (); | ||
| 6891 | |||
| 6892 | return nread; | 6904 | return nread; |
| 6893 | } | 6905 | } |
| 6894 | 6906 | ||
diff --git a/src/xterm.c b/src/xterm.c index 0693d101f16..6ee764aeebc 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -9233,6 +9233,10 @@ x_free_frame_resources (struct frame *f) | |||
| 9233 | commands to the X server. */ | 9233 | commands to the X server. */ |
| 9234 | if (dpyinfo->display) | 9234 | if (dpyinfo->display) |
| 9235 | { | 9235 | { |
| 9236 | /* Always exit with visible pointer to avoid weird issue | ||
| 9237 | with Xfixes (Bug#17609). */ | ||
| 9238 | FRAME_DISPLAY_INFO (f)->toggle_visible_pointer (f, 0); | ||
| 9239 | |||
| 9236 | /* We must free faces before destroying windows because some | 9240 | /* We must free faces before destroying windows because some |
| 9237 | font-driver (e.g. xft) access a window while finishing a | 9241 | font-driver (e.g. xft) access a window while finishing a |
| 9238 | face. */ | 9242 | face. */ |