]> git.eshelyaron.com Git - emacs.git/commitdiff
* xterm.h (struct x_display_info): New member
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 17 Sep 2013 08:24:20 +0000 (12:24 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 17 Sep 2013 08:24:20 +0000 (12:24 +0400)
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.

src/ChangeLog
src/w32term.c
src/w32term.h
src/xterm.c
src/xterm.h

index 00b59e89e6746f5f7572f284bc850bfaf0733d8a..5763940a2472dec0d6ca8b3bc50a0025c3206a01 100644 (file)
@@ -1,3 +1,14 @@
+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*,
index af73e66d8820d05da76412034609c444c335b5fc..912fb3cc68c8be1022a467fbbfe77933d6c77e36 100644 (file)
@@ -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
index 1cbadadc84e2cc67c8b2115fa3cfe07a7e56a5a3..99253627e649003d52b67966a5222313d373dc13 100644 (file)
@@ -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.  */
index 44f0efab019771835123ac635540d5569c103940..1adc5b3d03f4f9af56090b98418a4f2f005f8a30 100644 (file)
@@ -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);
index 28b72969972f8532b6d835faf4070ec18a501391..382cf30e1d61db1f99e2e2bb100c221cb4126f1f 100644 (file)
@@ -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;