aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Antipov2013-09-17 12:24:20 +0400
committerDmitry Antipov2013-09-17 12:24:20 +0400
commitbaed360360debdbe4926f69be41108890f394540 (patch)
tree5452b4f585c89b3cb8fa0f84a2b74b5c046bfa7b
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.
-rw-r--r--src/ChangeLog11
-rw-r--r--src/w32term.c16
-rw-r--r--src/w32term.h3
-rw-r--r--src/xterm.c37
-rw-r--r--src/xterm.h3
5 files changed, 37 insertions, 33 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 00b59e89e67..5763940a247 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12013-09-17 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * xterm.h (struct x_display_info): New member
4 x_pending_autoraise_frame, going to replace...
5 * xterm.c (pending_autoraise_frame): ...static variable.
6 (x_new_focus_frame, XTread_socket): Adjust users.
7 * w32term.h (struct w32_display_info): New member
8 w32_pending_autoraise_frame, going to replace...
9 * w32term.c (pending_autoraise_frame): ...global variable.
10 (x_new_focus_frame, w32_read_socket): Adjust users.
11
12013-09-17 Glenn Morris <rgm@gnu.org> 122013-09-17 Glenn Morris <rgm@gnu.org>
2 13
3 * xdisp.c (message_dolog): If we create *Messages*, 14 * xdisp.c (message_dolog): If we create *Messages*,
diff --git a/src/w32term.c b/src/w32term.c
index af73e66d882..912fb3cc68c 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -149,9 +149,6 @@ BOOL (WINAPI *pfnSetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
149#define SM_CYVIRTUALSCREEN 79 149#define SM_CYVIRTUALSCREEN 79
150#endif 150#endif
151 151
152/* This is a frame waiting to be autoraised, within w32_read_socket. */
153struct frame *pending_autoraise_frame;
154
155/* The handle of the frame that currently owns the system caret. */ 152/* The handle of the frame that currently owns the system caret. */
156HWND w32_system_caret_hwnd; 153HWND w32_system_caret_hwnd;
157int w32_system_caret_height; 154int w32_system_caret_height;
@@ -2823,9 +2820,9 @@ x_new_focus_frame (struct w32_display_info *dpyinfo, struct frame *frame)
2823 x_lower_frame (old_focus); 2820 x_lower_frame (old_focus);
2824 2821
2825 if (dpyinfo->w32_focus_frame && dpyinfo->w32_focus_frame->auto_raise) 2822 if (dpyinfo->w32_focus_frame && dpyinfo->w32_focus_frame->auto_raise)
2826 pending_autoraise_frame = dpyinfo->w32_focus_frame; 2823 dpyinfo->w32_pending_autoraise_frame = dpyinfo->w32_focus_frame;
2827 else 2824 else
2828 pending_autoraise_frame = 0; 2825 dpyinfo->w32_pending_autoraise_frame = NULL;
2829 } 2826 }
2830 2827
2831 x_frame_rehighlight (dpyinfo); 2828 x_frame_rehighlight (dpyinfo);
@@ -4981,12 +4978,11 @@ w32_read_socket (struct terminal *terminal,
4981 } 4978 }
4982 4979
4983 /* If the focus was just given to an autoraising frame, 4980 /* If the focus was just given to an autoraising frame,
4984 raise it now. */ 4981 raise it now. FIXME: handle more than one such frame. */
4985 /* ??? This ought to be able to handle more than one such frame. */ 4982 if (dpyinfo->w32_pending_autoraise_frame)
4986 if (pending_autoraise_frame)
4987 { 4983 {
4988 x_raise_frame (pending_autoraise_frame); 4984 x_raise_frame (dpyinfo->w32_pending_autoraise_frame);
4989 pending_autoraise_frame = 0; 4985 dpyinfo->w32_pending_autoraise_frame = NULL;
4990 } 4986 }
4991 4987
4992 /* Check which frames are still visible, if we have enqueued any user 4988 /* Check which frames are still visible, if we have enqueued any user
diff --git a/src/w32term.h b/src/w32term.h
index 1cbadadc84e..99253627e64 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -179,6 +179,9 @@ struct w32_display_info
179 frame. It differs from w32_focus_frame when we're using a global 179 frame. It differs from w32_focus_frame when we're using a global
180 minibuffer. */ 180 minibuffer. */
181 struct frame *x_highlight_frame; 181 struct frame *x_highlight_frame;
182
183 /* The frame waiting to be auto-raised in w32_read_socket. */
184 struct frame *w32_pending_autoraise_frame;
182}; 185};
183 186
184/* This is a chain of structures for all the displays currently in use. */ 187/* This is a chain of structures for all the displays currently in use. */
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);
diff --git a/src/xterm.h b/src/xterm.h
index 28b72969972..382cf30e1d6 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -302,6 +302,9 @@ struct x_display_info
302 minibuffer. */ 302 minibuffer. */
303 struct frame *x_highlight_frame; 303 struct frame *x_highlight_frame;
304 304
305 /* The frame waiting to be auto-raised in XTread_socket. */
306 struct frame *x_pending_autoraise_frame;
307
305 /* Time of last user interaction as returned in X events on this display. */ 308 /* Time of last user interaction as returned in X events on this display. */
306 Time last_user_time; 309 Time last_user_time;
307 310