+2013-09-17 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xterm.h (struct x_display_info): New member
+ x_pending_autoraise_frame, going to replace...
+ * xterm.c (pending_autoraise_frame): ...static variable.
+ (x_new_focus_frame, XTread_socket): Adjust users.
+ * w32term.h (struct w32_display_info): New member
+ w32_pending_autoraise_frame, going to replace...
+ * w32term.c (pending_autoraise_frame): ...global variable.
+ (x_new_focus_frame, w32_read_socket): Adjust users.
+
2013-09-17 Glenn Morris <rgm@gnu.org>
* xdisp.c (message_dolog): If we create *Messages*,
#define SM_CYVIRTUALSCREEN 79
#endif
-/* This is a frame waiting to be autoraised, within w32_read_socket. */
-struct frame *pending_autoraise_frame;
-
/* The handle of the frame that currently owns the system caret. */
HWND w32_system_caret_hwnd;
int w32_system_caret_height;
x_lower_frame (old_focus);
if (dpyinfo->w32_focus_frame && dpyinfo->w32_focus_frame->auto_raise)
- pending_autoraise_frame = dpyinfo->w32_focus_frame;
+ dpyinfo->w32_pending_autoraise_frame = dpyinfo->w32_focus_frame;
else
- pending_autoraise_frame = 0;
+ dpyinfo->w32_pending_autoraise_frame = NULL;
}
x_frame_rehighlight (dpyinfo);
}
/* If the focus was just given to an autoraising frame,
- raise it now. */
- /* ??? This ought to be able to handle more than one such frame. */
- if (pending_autoraise_frame)
+ raise it now. FIXME: handle more than one such frame. */
+ if (dpyinfo->w32_pending_autoraise_frame)
{
- x_raise_frame (pending_autoraise_frame);
- pending_autoraise_frame = 0;
+ x_raise_frame (dpyinfo->w32_pending_autoraise_frame);
+ dpyinfo->w32_pending_autoraise_frame = NULL;
}
/* Check which frames are still visible, if we have enqueued any user
Lisp_Object x_display_name_list;
-/* This is a frame waiting to be auto-raised, within XTread_socket. */
-
-static struct frame *pending_autoraise_frame;
-
#ifdef USE_X_TOOLKIT
/* The application context for Xt use. */
x_lower_frame (old_focus);
if (dpyinfo->x_focus_frame && dpyinfo->x_focus_frame->auto_raise)
- pending_autoraise_frame = dpyinfo->x_focus_frame;
+ dpyinfo->x_pending_autoraise_frame = dpyinfo->x_focus_frame;
else
- pending_autoraise_frame = 0;
+ dpyinfo->x_pending_autoraise_frame = NULL;
}
x_frame_rehighlight (dpyinfo);
{
int count = 0;
int event_found = 0;
+ struct x_display_info *dpyinfo = terminal->display_info.x;
block_input ();
input_signal_count++;
/* For debugging, this gives a way to fake an I/O error. */
- if (terminal->display_info.x == XTread_socket_fake_io_error)
+ if (dpyinfo == XTread_socket_fake_io_error)
{
XTread_socket_fake_io_error = 0;
- x_io_error_quitter (terminal->display_info.x->display);
+ x_io_error_quitter (dpyinfo->display);
}
#ifndef USE_GTK
- while (XPending (terminal->display_info.x->display))
+ while (XPending (dpyinfo->display))
{
int finish;
XEvent event;
- XNextEvent (terminal->display_info.x->display, &event);
+ XNextEvent (dpyinfo->display, &event);
#ifdef HAVE_X_I18N
/* Filter events for the current X input method. */
- if (x_filter_event (terminal->display_info.x, &event))
+ if (x_filter_event (dpyinfo, &event))
continue;
#endif
event_found = 1;
- count += handle_one_xevent (terminal->display_info.x,
- &event, &finish, hold_quit);
+ count += handle_one_xevent (dpyinfo, &event, &finish, hold_quit);
if (finish == X_EVENT_GOTO_OUT)
- goto out;
+ break;
}
- out:;
-
#else /* USE_GTK */
/* For GTK we must use the GTK event loop. But XEvents gets passed
}
/* If the focus was just given to an auto-raising frame,
- raise it now. */
- /* ??? This ought to be able to handle more than one such frame. */
- if (pending_autoraise_frame)
+ raise it now. FIXME: handle more than one such frame. */
+ if (dpyinfo->x_pending_autoraise_frame)
{
- x_raise_frame (pending_autoraise_frame);
- pending_autoraise_frame = 0;
+ x_raise_frame (dpyinfo->x_pending_autoraise_frame);
+ dpyinfo->x_pending_autoraise_frame = NULL;
}
unblock_input ();
#endif
#endif
- pending_autoraise_frame = 0;
-
/* Note that there is no real way portable across R3/R4 to get the
original error handler. */
XSetErrorHandler (x_error_handler);