Commit 64ed4306 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

* xterm.c (input_signal_count): Remove.

(x_dispatch_event): Define unconditionally.
(x_make_frame_visible): Process X events until the frame
is really visible (Bug#16027).
* xterm.h (x_dispatch_event): Declare unconditionally.
parent b2856a6f
2013-12-06 Dmitry Antipov <dmantipov@yandex.ru>
* xterm.c (input_signal_count): Remove.
(x_dispatch_event): Define unconditionally.
(x_make_frame_visible): Process X events until the frame
is really visible (Bug#16027).
* xterm.h (x_dispatch_event): Declare unconditionally.
2013-12-05 Jan Djärv <jan.h.d@swipnet.se> 2013-12-05 Jan Djärv <jan.h.d@swipnet.se>
* nsfns.m (ns_frame_parm_handlers): Add right/bottom_divider_width. * nsfns.m (ns_frame_parm_handlers): Add right/bottom_divider_width.
......
...@@ -165,11 +165,6 @@ static bool toolkit_scroll_bar_interaction; ...@@ -165,11 +165,6 @@ static bool toolkit_scroll_bar_interaction;
static Time ignore_next_mouse_click_timeout; static Time ignore_next_mouse_click_timeout;
/* Incremented by XTread_socket whenever it really tries to read
events. */
static int volatile input_signal_count;
/* Used locally within XTread_socket. */ /* Used locally within XTread_socket. */
static int x_noop_count; static int x_noop_count;
...@@ -253,9 +248,6 @@ static void x_sync_with_move (struct frame *, int, int, int); ...@@ -253,9 +248,6 @@ static void x_sync_with_move (struct frame *, int, int, int);
static int handle_one_xevent (struct x_display_info *, static int handle_one_xevent (struct x_display_info *,
const XEvent *, int *, const XEvent *, int *,
struct input_event *); struct input_event *);
#ifdef USE_GTK
static int x_dispatch_event (XEvent *, Display *);
#endif
/* Don't declare this _Noreturn because we want no /* Don't declare this _Noreturn because we want no
interference with debugging failing X calls. */ interference with debugging failing X calls. */
static void x_connection_closed (Display *, const char *); static void x_connection_closed (Display *, const char *);
...@@ -6853,8 +6845,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, ...@@ -6853,8 +6845,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
return count; return count;
} }
#if defined USE_GTK || defined USE_X_TOOLKIT
/* Handles the XEvent EVENT on display DISPLAY. /* Handles the XEvent EVENT on display DISPLAY.
This is used for event loops outside the normal event handling, This is used for event loops outside the normal event handling,
i.e. looping while a popup menu or a dialog is posted. i.e. looping while a popup menu or a dialog is posted.
...@@ -6873,8 +6863,6 @@ x_dispatch_event (XEvent *event, Display *display) ...@@ -6873,8 +6863,6 @@ x_dispatch_event (XEvent *event, Display *display)
return finish; return finish;
} }
#endif
/* Read events coming from the X server. /* Read events coming from the X server.
Return as soon as there are no more events to be read. Return as soon as there are no more events to be read.
...@@ -6893,9 +6881,6 @@ XTread_socket (struct terminal *terminal, struct input_event *hold_quit) ...@@ -6893,9 +6881,6 @@ XTread_socket (struct terminal *terminal, struct input_event *hold_quit)
block_input (); block_input ();
/* So people can tell when we have read the available input. */
input_signal_count++;
/* For debugging, this gives a way to fake an I/O error. */ /* For debugging, this gives a way to fake an I/O error. */
if (dpyinfo == XTread_socket_fake_io_error) if (dpyinfo == XTread_socket_fake_io_error)
{ {
...@@ -8826,9 +8811,6 @@ void ...@@ -8826,9 +8811,6 @@ void
x_make_frame_visible (struct frame *f) x_make_frame_visible (struct frame *f)
{ {
int original_top, original_left; int original_top, original_left;
int retry_count = 2;
retry:
block_input (); block_input ();
...@@ -8877,7 +8859,6 @@ x_make_frame_visible (struct frame *f) ...@@ -8877,7 +8859,6 @@ x_make_frame_visible (struct frame *f)
so that incoming events are handled. */ so that incoming events are handled. */
{ {
Lisp_Object frame; Lisp_Object frame;
int count;
/* This must be before UNBLOCK_INPUT /* This must be before UNBLOCK_INPUT
since events that arrive in response to the actions above since events that arrive in response to the actions above
will set it when they are handled. */ will set it when they are handled. */
...@@ -8931,46 +8912,18 @@ x_make_frame_visible (struct frame *f) ...@@ -8931,46 +8912,18 @@ x_make_frame_visible (struct frame *f)
XSETFRAME (frame, f); XSETFRAME (frame, f);
/* Wait until the frame is visible. Process X events until a /* Process X events until a MapNotify event has been seen. */
MapNotify event has been seen, or until we think we won't get a while (!FRAME_VISIBLE_P (f))
MapNotify at all.. */
for (count = input_signal_count + 10;
input_signal_count < count && !FRAME_VISIBLE_P (f);)
{ {
/* Force processing of queued events. */ /* Force processing of queued events. */
x_sync (f); x_sync (f);
if (XPending (FRAME_X_DISPLAY (f)))
/* Machines that do polling rather than SIGIO have been
observed to go into a busy-wait here. So we'll fake an
alarm signal to let the handler know that there's something
to be read. We used to raise a real alarm, but it seems
that the handler isn't always enabled here. This is
probably a bug. */
if (input_polling_used ())
{ {
/* It could be confusing if a real alarm arrives while XEvent xev;
processing the fake one. Turn it off and let the XNextEvent (FRAME_X_DISPLAY (f), &xev);
handler reset it. */ x_dispatch_event (&xev, FRAME_X_DISPLAY (f));
int old_poll_suppress_count = poll_suppress_count;
poll_suppress_count = 1;
poll_for_input_1 ();
poll_suppress_count = old_poll_suppress_count;
} }
} }
/* 2000-09-28: In
(let ((f (selected-frame)))
(iconify-frame f)
(raise-frame f))
the frame is not raised with various window managers on
FreeBSD, GNU/Linux and Solaris. It turns out that, for some
unknown reason, the call to XtMapWidget is completely ignored.
Mapping the widget a second time works. */
if (!FRAME_VISIBLE_P (f) && --retry_count != 0)
goto retry;
} }
} }
......
...@@ -945,9 +945,7 @@ extern void x_clear_area (Display *, Window, int, int, int, int); ...@@ -945,9 +945,7 @@ extern void x_clear_area (Display *, Window, int, int, int, int);
extern void x_mouse_leave (struct x_display_info *); extern void x_mouse_leave (struct x_display_info *);
#endif #endif
#ifdef USE_X_TOOLKIT
extern int x_dispatch_event (XEvent *, Display *); extern int x_dispatch_event (XEvent *, Display *);
#endif
extern int x_x_to_emacs_modifiers (struct x_display_info *, int); extern int x_x_to_emacs_modifiers (struct x_display_info *, int);
extern int x_display_pixel_height (struct x_display_info *); extern int x_display_pixel_height (struct x_display_info *);
extern int x_display_pixel_width (struct x_display_info *); extern int x_display_pixel_width (struct x_display_info *);
......
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