Commit 632fd57c authored by Dmitry Antipov's avatar Dmitry Antipov

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.
parent 6c203822
2014-05-28 Dmitry Antipov <dmantipov@yandex.ru>
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.
2014-05-28 Stefan Monnier <monnier@iro.umontreal.ca> 2014-05-28 Stefan Monnier <monnier@iro.umontreal.ca>
* data.c (Fzerop): Move to Elisp. * data.c (Fzerop): Move to Elisp.
......
...@@ -315,7 +315,7 @@ At the end, it runs `post-self-insert-hook'. */) ...@@ -315,7 +315,7 @@ At the end, it runs `post-self-insert-hook'. */)
int val = internal_self_insert (character, XFASTINT (n)); int val = internal_self_insert (character, XFASTINT (n));
if (val == 2) if (val == 2)
nonundocount = 0; nonundocount = 0;
frame_make_pointer_invisible (); frame_make_pointer_invisible (SELECTED_FRAME ());
} }
return Qnil; return Qnil;
......
...@@ -4373,16 +4373,11 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p) ...@@ -4373,16 +4373,11 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
#endif /* HAVE_WINDOW_SYSTEM */ #endif /* HAVE_WINDOW_SYSTEM */
void void
frame_make_pointer_invisible (void) frame_make_pointer_invisible (struct frame *f)
{ {
if (! NILP (Vmake_pointer_invisible)) if (! NILP (Vmake_pointer_invisible))
{ {
struct frame *f; if (f && FRAME_LIVE_P (f) && !f->pointer_invisible
if (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
return;
f = SELECTED_FRAME ();
if (f && !f->pointer_invisible
&& FRAME_TERMINAL (f)->toggle_invisible_pointer_hook) && FRAME_TERMINAL (f)->toggle_invisible_pointer_hook)
{ {
f->mouse_moved = 0; f->mouse_moved = 0;
...@@ -4393,17 +4388,11 @@ frame_make_pointer_invisible (void) ...@@ -4393,17 +4388,11 @@ frame_make_pointer_invisible (void)
} }
void void
frame_make_pointer_visible (void) frame_make_pointer_visible (struct frame *f)
{ {
/* We don't check Vmake_pointer_invisible here in case the /* We don't check Vmake_pointer_invisible here in case the
pointer was invisible when Vmake_pointer_invisible was set to nil. */ pointer was invisible when Vmake_pointer_invisible was set to nil. */
struct frame *f; if (f && FRAME_LIVE_P (f) && f->pointer_invisible && f->mouse_moved
if (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
return;
f = SELECTED_FRAME ();
if (f && f->pointer_invisible && f->mouse_moved
&& FRAME_TERMINAL (f)->toggle_invisible_pointer_hook) && FRAME_TERMINAL (f)->toggle_invisible_pointer_hook)
{ {
FRAME_TERMINAL (f)->toggle_invisible_pointer_hook (f, 0); FRAME_TERMINAL (f)->toggle_invisible_pointer_hook (f, 0);
......
...@@ -995,8 +995,8 @@ extern struct frame *make_frame_without_minibuffer (Lisp_Object, ...@@ -995,8 +995,8 @@ extern struct frame *make_frame_without_minibuffer (Lisp_Object,
#endif /* HAVE_WINDOW_SYSTEM */ #endif /* HAVE_WINDOW_SYSTEM */
extern bool window_system_available (struct frame *); extern bool window_system_available (struct frame *);
extern void check_window_system (struct frame *); extern void check_window_system (struct frame *);
extern void frame_make_pointer_invisible (void); extern void frame_make_pointer_invisible (struct frame *);
extern void frame_make_pointer_visible (void); extern void frame_make_pointer_visible (struct frame *);
extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object); extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
extern Lisp_Object Vframe_list; extern Lisp_Object Vframe_list;
......
...@@ -6877,6 +6877,20 @@ gobble_input (void) ...@@ -6877,6 +6877,20 @@ gobble_input (void)
} }
} }
/* If there was no error, make sure the pointer
is visible for all frames on this terminal. */
if (nr >= 0)
{
Lisp_Object tail, frame;
FOR_EACH_FRAME (tail, frame)
{
struct frame *f = XFRAME (frame);
if (FRAME_TERMINAL (f) == t)
frame_make_pointer_visible (f);
}
}
if (hold_quit.kind != NO_EVENT) if (hold_quit.kind != NO_EVENT)
kbd_buffer_store_event (&hold_quit); kbd_buffer_store_event (&hold_quit);
} }
...@@ -6887,8 +6901,6 @@ gobble_input (void) ...@@ -6887,8 +6901,6 @@ gobble_input (void)
if (err && !nread) if (err && !nread)
nread = -1; nread = -1;
frame_make_pointer_visible ();
return nread; return nread;
} }
......
...@@ -9233,6 +9233,10 @@ x_free_frame_resources (struct frame *f) ...@@ -9233,6 +9233,10 @@ x_free_frame_resources (struct frame *f)
commands to the X server. */ commands to the X server. */
if (dpyinfo->display) if (dpyinfo->display)
{ {
/* Always exit with visible pointer to avoid weird issue
with Xfixes (Bug#17609). */
FRAME_DISPLAY_INFO (f)->toggle_visible_pointer (f, 0);
/* We must free faces before destroying windows because some /* We must free faces before destroying windows because some
font-driver (e.g. xft) access a window while finishing a font-driver (e.g. xft) access a window while finishing a
face. */ face. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment