Commit baed3603 authored by Dmitry Antipov's avatar Dmitry Antipov

* 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.
parent f804aa63
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*,
......
......@@ -149,9 +149,6 @@ BOOL (WINAPI *pfnSetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
#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;
......@@ -2823,9 +2820,9 @@ x_new_focus_frame (struct w32_display_info *dpyinfo, struct frame *frame)
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);
......@@ -4981,12 +4978,11 @@ w32_read_socket (struct terminal *terminal,
}
/* 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
......
......@@ -179,6 +179,9 @@ struct w32_display_info
frame. It differs from w32_focus_frame when we're using a global
minibuffer. */
struct frame *x_highlight_frame;
/* The frame waiting to be auto-raised in w32_read_socket. */
struct frame *w32_pending_autoraise_frame;
};
/* This is a chain of structures for all the displays currently in use. */
......
......@@ -155,10 +155,6 @@ struct x_display_info *x_display_list;
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. */
......@@ -3299,9 +3295,9 @@ x_new_focus_frame (struct x_display_info *dpyinfo, struct frame *frame)
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);
......@@ -7088,6 +7084,7 @@ XTread_socket (struct terminal *terminal, struct input_event *hold_quit)
{
int count = 0;
int event_found = 0;
struct x_display_info *dpyinfo = terminal->display_info.x;
block_input ();
......@@ -7095,36 +7092,33 @@ XTread_socket (struct terminal *terminal, struct input_event *hold_quit)
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
......@@ -7174,12 +7168,11 @@ XTread_socket (struct terminal *terminal, struct input_event *hold_quit)
}
/* 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 ();
......@@ -10651,8 +10644,6 @@ x_initialize (void)
#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);
......
......@@ -302,6 +302,9 @@ struct x_display_info
minibuffer. */
struct frame *x_highlight_frame;
/* The frame waiting to be auto-raised in XTread_socket. */
struct frame *x_pending_autoraise_frame;
/* Time of last user interaction as returned in X events on this display. */
Time last_user_time;
......
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