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>
* data.c (Fzerop): Move to Elisp.
......
......@@ -315,7 +315,7 @@ At the end, it runs `post-self-insert-hook'. */)
int val = internal_self_insert (character, XFASTINT (n));
if (val == 2)
nonundocount = 0;
frame_make_pointer_invisible ();
frame_make_pointer_invisible (SELECTED_FRAME ());
}
return Qnil;
......
......@@ -4373,16 +4373,11 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
#endif /* HAVE_WINDOW_SYSTEM */
void
frame_make_pointer_invisible (void)
frame_make_pointer_invisible (struct frame *f)
{
if (! NILP (Vmake_pointer_invisible))
{
struct frame *f;
if (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
return;
f = SELECTED_FRAME ();
if (f && !f->pointer_invisible
if (f && FRAME_LIVE_P (f) && !f->pointer_invisible
&& FRAME_TERMINAL (f)->toggle_invisible_pointer_hook)
{
f->mouse_moved = 0;
......@@ -4393,17 +4388,11 @@ frame_make_pointer_invisible (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
pointer was invisible when Vmake_pointer_invisible was set to nil. */
struct frame *f;
if (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
return;
f = SELECTED_FRAME ();
if (f && f->pointer_invisible && f->mouse_moved
if (f && FRAME_LIVE_P (f) && f->pointer_invisible && f->mouse_moved
&& FRAME_TERMINAL (f)->toggle_invisible_pointer_hook)
{
FRAME_TERMINAL (f)->toggle_invisible_pointer_hook (f, 0);
......
......@@ -995,8 +995,8 @@ extern struct frame *make_frame_without_minibuffer (Lisp_Object,
#endif /* HAVE_WINDOW_SYSTEM */
extern bool window_system_available (struct frame *);
extern void check_window_system (struct frame *);
extern void frame_make_pointer_invisible (void);
extern void frame_make_pointer_visible (void);
extern void frame_make_pointer_invisible (struct frame *);
extern void frame_make_pointer_visible (struct frame *);
extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
extern Lisp_Object Vframe_list;
......
......@@ -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)
kbd_buffer_store_event (&hold_quit);
}
......@@ -6887,8 +6901,6 @@ gobble_input (void)
if (err && !nread)
nread = -1;
frame_make_pointer_visible ();
return nread;
}
......
......@@ -9233,6 +9233,10 @@ x_free_frame_resources (struct frame *f)
commands to the X server. */
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
font-driver (e.g. xft) access a window while finishing a
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