aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-09-17 12:24:20 +0400
committerDmitry Antipov2013-09-17 12:24:20 +0400
commitbaed360360debdbe4926f69be41108890f394540 (patch)
tree5452b4f585c89b3cb8fa0f84a2b74b5c046bfa7b /src/xterm.c
parentf804aa63be2f551aed486587fefa86b87bd50745 (diff)
downloademacs-baed360360debdbe4926f69be41108890f394540.tar.gz
emacs-baed360360debdbe4926f69be41108890f394540.zip
* 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.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 44f0efab019..1adc5b3d03f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -155,10 +155,6 @@ struct x_display_info *x_display_list;
155 155
156Lisp_Object x_display_name_list; 156Lisp_Object x_display_name_list;
157 157
158/* This is a frame waiting to be auto-raised, within XTread_socket. */
159
160static struct frame *pending_autoraise_frame;
161
162#ifdef USE_X_TOOLKIT 158#ifdef USE_X_TOOLKIT
163 159
164/* The application context for Xt use. */ 160/* The application context for Xt use. */
@@ -3299,9 +3295,9 @@ x_new_focus_frame (struct x_display_info *dpyinfo, struct frame *frame)
3299 x_lower_frame (old_focus); 3295 x_lower_frame (old_focus);
3300 3296
3301 if (dpyinfo->x_focus_frame && dpyinfo->x_focus_frame->auto_raise) 3297 if (dpyinfo->x_focus_frame && dpyinfo->x_focus_frame->auto_raise)
3302 pending_autoraise_frame = dpyinfo->x_focus_frame; 3298 dpyinfo->x_pending_autoraise_frame = dpyinfo->x_focus_frame;
3303 else 3299 else
3304 pending_autoraise_frame = 0; 3300 dpyinfo->x_pending_autoraise_frame = NULL;
3305 } 3301 }
3306 3302
3307 x_frame_rehighlight (dpyinfo); 3303 x_frame_rehighlight (dpyinfo);
@@ -7088,6 +7084,7 @@ XTread_socket (struct terminal *terminal, struct input_event *hold_quit)
7088{ 7084{
7089 int count = 0; 7085 int count = 0;
7090 int event_found = 0; 7086 int event_found = 0;
7087 struct x_display_info *dpyinfo = terminal->display_info.x;
7091 7088
7092 block_input (); 7089 block_input ();
7093 7090
@@ -7095,36 +7092,33 @@ XTread_socket (struct terminal *terminal, struct input_event *hold_quit)
7095 input_signal_count++; 7092 input_signal_count++;
7096 7093
7097 /* For debugging, this gives a way to fake an I/O error. */ 7094 /* For debugging, this gives a way to fake an I/O error. */
7098 if (terminal->display_info.x == XTread_socket_fake_io_error) 7095 if (dpyinfo == XTread_socket_fake_io_error)
7099 { 7096 {
7100 XTread_socket_fake_io_error = 0; 7097 XTread_socket_fake_io_error = 0;
7101 x_io_error_quitter (terminal->display_info.x->display); 7098 x_io_error_quitter (dpyinfo->display);
7102 } 7099 }
7103 7100
7104#ifndef USE_GTK 7101#ifndef USE_GTK
7105 while (XPending (terminal->display_info.x->display)) 7102 while (XPending (dpyinfo->display))
7106 { 7103 {
7107 int finish; 7104 int finish;
7108 XEvent event; 7105 XEvent event;
7109 7106
7110 XNextEvent (terminal->display_info.x->display, &event); 7107 XNextEvent (dpyinfo->display, &event);
7111 7108
7112#ifdef HAVE_X_I18N 7109#ifdef HAVE_X_I18N
7113 /* Filter events for the current X input method. */ 7110 /* Filter events for the current X input method. */
7114 if (x_filter_event (terminal->display_info.x, &event)) 7111 if (x_filter_event (dpyinfo, &event))
7115 continue; 7112 continue;
7116#endif 7113#endif
7117 event_found = 1; 7114 event_found = 1;
7118 7115
7119 count += handle_one_xevent (terminal->display_info.x, 7116 count += handle_one_xevent (dpyinfo, &event, &finish, hold_quit);
7120 &event, &finish, hold_quit);
7121 7117
7122 if (finish == X_EVENT_GOTO_OUT) 7118 if (finish == X_EVENT_GOTO_OUT)
7123 goto out; 7119 break;
7124 } 7120 }
7125 7121
7126 out:;
7127
7128#else /* USE_GTK */ 7122#else /* USE_GTK */
7129 7123
7130 /* For GTK we must use the GTK event loop. But XEvents gets passed 7124 /* 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)
7174 } 7168 }
7175 7169
7176 /* If the focus was just given to an auto-raising frame, 7170 /* If the focus was just given to an auto-raising frame,
7177 raise it now. */ 7171 raise it now. FIXME: handle more than one such frame. */
7178 /* ??? This ought to be able to handle more than one such frame. */ 7172 if (dpyinfo->x_pending_autoraise_frame)
7179 if (pending_autoraise_frame)
7180 { 7173 {
7181 x_raise_frame (pending_autoraise_frame); 7174 x_raise_frame (dpyinfo->x_pending_autoraise_frame);
7182 pending_autoraise_frame = 0; 7175 dpyinfo->x_pending_autoraise_frame = NULL;
7183 } 7176 }
7184 7177
7185 unblock_input (); 7178 unblock_input ();
@@ -10651,8 +10644,6 @@ x_initialize (void)
10651#endif 10644#endif
10652#endif 10645#endif
10653 10646
10654 pending_autoraise_frame = 0;
10655
10656 /* Note that there is no real way portable across R3/R4 to get the 10647 /* Note that there is no real way portable across R3/R4 to get the
10657 original error handler. */ 10648 original error handler. */
10658 XSetErrorHandler (x_error_handler); 10649 XSetErrorHandler (x_error_handler);