emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114099: * msdos.c (last_mouse_window): Move to...


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r114099: * msdos.c (last_mouse_window): Move to...
Date: Mon, 02 Sep 2013 06:46:17 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114099
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Mon 2013-09-02 10:45:04 +0400
message:
  * msdos.c (last_mouse_window): Move to...
  (dos_rawgetc): ...this function and adjust comment.
  * nsterm.m (last_window): Rename to last_mouse_window, move to...
  (mouseMoved): ...this function and adjust comment.
  * w32term.c (last_window): Likewise with...
  (w32_read_socket): ...this function.
  * xterm.c (last_window): Likewise with...
  (handle_one_xevent): ...this function.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/msdos.c                    msdos.c-20091113204419-o5vbwnq5f7feedwu-656
  src/nsterm.m                   nsterm.m-20091113204419-o5vbwnq5f7feedwu-8747
  src/w32term.c                  w32term.c-20091113204419-o5vbwnq5f7feedwu-950
  src/xterm.c                    xterm.c-20091113204419-o5vbwnq5f7feedwu-244
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-09-02 06:12:26 +0000
+++ b/src/ChangeLog     2013-09-02 06:45:04 +0000
@@ -1,5 +1,16 @@
 2013-09-02  Dmitry Antipov  <address@hidden>
 
+       * msdos.c (last_mouse_window): Move to...
+       (dos_rawgetc): ...this function and adjust comment.
+       * nsterm.m (last_window): Rename to last_mouse_window, move to...
+       (mouseMoved): ...this function and adjust comment.
+       * w32term.c (last_window): Likewise with...
+       (w32_read_socket): ...this function.
+       * xterm.c (last_window): Likewise with...
+       (handle_one_xevent): ...this function.
+
+2013-09-02  Dmitry Antipov  <address@hidden>
+
        * window.h (Vmouse_window, Vmouse_event): Remove the leftovers.
        * xterm.c (toplevel): Drop obsolete comment and move compose_status...
        (handle_one_xevent): ...to here.

=== modified file 'src/msdos.c'
--- a/src/msdos.c       2013-09-02 03:39:06 +0000
+++ b/src/msdos.c       2013-09-02 06:45:04 +0000
@@ -946,9 +946,6 @@
                          Mouse Highlight (and friends..)
  ************************************************************************/
 
-/* Last window where we saw the mouse.  Used by mouse-autoselect-window.  */
-static Lisp_Object last_mouse_window;
-
 static int mouse_preempted = 0;        /* non-zero when XMenu gobbles mouse 
events */
 
 int
@@ -2668,10 +2665,10 @@
          /* Generate SELECT_WINDOW_EVENTs when needed.  */
          if (!NILP (Vmouse_autoselect_window))
            {
-             mouse_window = window_from_coordinates (SELECTED_FRAME (),
-                                                     mouse_last_x,
-                                                     mouse_last_y,
-                                                     0, 0);
+             static Lisp_Object last_mouse_window;
+
+             mouse_window = window_from_coordinates
+               (SELECTED_FRAME (), mouse_last_x, mouse_last_y, 0, 0);
              /* A window will be selected only when it is not
                 selected now, and the last mouse movement event was
                 not in it.  A minibuffer window will be selected iff
@@ -2686,10 +2683,9 @@
                  event.timestamp = event_timestamp ();
                  kbd_buffer_store_event (&event);
                }
+             /* Remember the last window where we saw the mouse.  */
              last_mouse_window = mouse_window;
            }
-         else
-           last_mouse_window = Qnil;
 
          previous_help_echo_string = help_echo_string;
          help_echo_string = help_echo_object = help_echo_window = Qnil;

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2013-09-01 16:39:20 +0000
+++ b/src/nsterm.m      2013-09-02 06:45:04 +0000
@@ -184,9 +184,6 @@
 Lisp_Object ns_display_name_list;
 long context_menu_value = 0;
 
-/* Last window where we saw the mouse.  Used by mouse-autoselect-window.  */
-static Lisp_Object last_window;
-
 /* display update */
 NSPoint last_mouse_motion_position;
 static NSRect last_mouse_glyph;
@@ -5458,11 +5455,13 @@
   if (!NILP (Vmouse_autoselect_window))
     {
       NSTRACE (mouse_autoselect_window);
-      Lisp_Object window;
-      window = window_from_coordinates(emacsframe, 
last_mouse_motion_position.x,
-                                       last_mouse_motion_position.y, 0, 0);
+      static Lisp_Object last_mouse_window;
+      Lisp_Object window = window_from_coordinates
+       (emacsframe, last_mouse_motion_position.x,
+        last_mouse_motion_position.y, 0, 0);
+
       if (WINDOWP (window)
-          && !EQ (window, last_window)
+          && !EQ (window, last_mouse_window)
           && !EQ (window, selected_window)
           && (focus_follows_mouse
               || (EQ (XWINDOW (window)->frame,
@@ -5473,7 +5472,8 @@
           emacs_event->frame_or_window = window;
           EV_TRAILER2 (e);
         }
-      last_window = window;
+      /* Remember the last window where we saw the mouse.  */
+      last_mouse_window = window;
     }
 
   if (!note_mouse_movement (emacsframe, last_mouse_motion_position.x,

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2013-09-02 03:39:06 +0000
+++ b/src/w32term.c     2013-09-02 06:45:04 +0000
@@ -84,9 +84,6 @@
 
 static int any_help_event_p;
 
-/* Last window where we saw the mouse.  Used by mouse-autoselect-window.  */
-static Lisp_Object last_window;
-
 extern unsigned int msh_mousewheel;
 
 extern void free_frame_menubar (struct frame *);
@@ -4503,18 +4500,16 @@
              /* Generate SELECT_WINDOW_EVENTs when needed.  */
              if (!NILP (Vmouse_autoselect_window))
                {
-                 Lisp_Object window;
-                 int x = LOWORD (msg.msg.lParam);
-                 int y = HIWORD (msg.msg.lParam);
-
-                 window = window_from_coordinates (f, x, y, 0, 0);
+                 static Lisp_Object last_mouse_window;
+                 Lisp_Object window = window_from_coordinates
+                   (f, LOWORD (msg.msg.lParam), HIWORD (msg.msg.lParam), 0, 0);
 
                  /* Window will be selected only when it is not
                     selected now and last mouse movement event was
                     not in it.  Minibuffer window will be selected
                     only when it is active.  */
                  if (WINDOWP (window)
-                     && !EQ (window, last_window)
+                     && !EQ (window, last_mouse_window)
                      && !EQ (window, selected_window)
                      /* For click-to-focus window managers
                         create event iff we don't leave the
@@ -4526,8 +4521,8 @@
                      inev.kind = SELECT_WINDOW_EVENT;
                      inev.frame_or_window = window;
                    }
-
-                 last_window = window;
+                 /* Remember the last window where we saw the mouse.  */
+                 last_mouse_window = window;
                }
              if (!note_mouse_movement (f, &msg.msg))
                help_echo_string = previous_help_echo_string;

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2013-09-02 05:59:35 +0000
+++ b/src/xterm.c       2013-09-02 06:45:04 +0000
@@ -140,16 +140,11 @@
 int use_xim = 0;  /* configure --without-xim */
 #endif
 
-
-
 /* Non-zero means that a HELP_EVENT has been generated since Emacs
    start.  */
 
 static bool any_help_event_p;
 
-/* Last window where we saw the mouse.  Used by mouse-autoselect-window.  */
-static Lisp_Object last_window;
-
 /* This is a chain of structures for all the X displays currently in
    use.  */
 
@@ -6656,18 +6651,16 @@
             /* Generate SELECT_WINDOW_EVENTs when needed.
                Don't let popup menus influence things (bug#1261).  */
             if (!NILP (Vmouse_autoselect_window) && !popup_activated ())
-              {
-                Lisp_Object window;
-
-                window = window_from_coordinates (f,
-                                                  event.xmotion.x, 
event.xmotion.y,
-                                                  0, 0);
-
-                /* Window will be selected only when it is not selected now and
-                   last mouse movement event was not in it.  Minibuffer window
-                   will be selected only when it is active.  */
-                if (WINDOWP (window)
-                    && !EQ (window, last_window)
+             {
+               static Lisp_Object last_mouse_window;
+               Lisp_Object window = window_from_coordinates
+                 (f, event.xmotion.x, event.xmotion.y, 0, 0);
+
+               /* Window will be selected only when it is not selected now and
+                  last mouse movement event was not in it.  Minibuffer window
+                  will be selected only when it is active.  */
+               if (WINDOWP (window)
+                   && !EQ (window, last_mouse_window)
                    && !EQ (window, selected_window)
                    /* For click-to-focus window managers
                       create event iff we don't leave the
@@ -6675,13 +6668,13 @@
                    && (focus_follows_mouse
                        || (EQ (XWINDOW (window)->frame,
                                XWINDOW (selected_window)->frame))))
-                  {
-                    inev.ie.kind = SELECT_WINDOW_EVENT;
-                    inev.ie.frame_or_window = window;
-                  }
-
-                last_window=window;
-              }
+                 {
+                   inev.ie.kind = SELECT_WINDOW_EVENT;
+                   inev.ie.frame_or_window = window;
+                 }
+               /* Remember the last window where we saw the mouse.  */
+               last_mouse_window = window;
+             }
             if (!note_mouse_movement (f, &event.xmotion))
              help_echo_string = previous_help_echo_string;
           }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]