emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r99704: * menu.c (Fx_popup_menu):


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r99704: * menu.c (Fx_popup_menu): Use last_event_timestamp (Bug#4930).
Date: Tue, 30 Mar 2010 19:26:38 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99704
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Tue 2010-03-30 19:26:38 -0400
message:
  * menu.c (Fx_popup_menu): Use last_event_timestamp (Bug#4930).
modified:
  src/ChangeLog
  src/menu.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-03-30 17:26:58 +0000
+++ b/src/ChangeLog     2010-03-30 23:26:38 +0000
@@ -1,3 +1,7 @@
+2010-03-30  Bernhard Herzog  <address@hidden>  (tiny change)
+
+       * menu.c (Fx_popup_menu): Use last_event_timestamp (Bug#4930).
+
 2010-03-30  Jan Djärv  <address@hidden>
 
        * xdisp.c (note_mouse_highlight): Don't do highlight if pointer is

=== modified file 'src/menu.c'
--- a/src/menu.c        2010-01-13 08:35:10 +0000
+++ b/src/menu.c        2010-03-30 23:26:38 +0000
@@ -61,6 +61,10 @@
 #define HAVE_BOXES 1
 #endif
 
+/* The timestamp of the last input event Emacs received from the X server.  */
+/* Defined in keyboard.c.  */
+extern unsigned long last_event_timestamp;
+
 extern Lisp_Object QCtoggle, QCradio;
 
 Lisp_Object menu_items;
@@ -1073,7 +1077,6 @@
   int keymaps = 0;
   int for_click = 0;
   int specpdl_count = SPECPDL_INDEX ();
-  Lisp_Object timestamp = Qnil;
   struct gcpro gcpro1;
 
   if (NILP (position))
@@ -1107,10 +1110,9 @@
            for_click = 1;
            tem = Fcar (Fcdr (position));  /* EVENT_START (position) */
            window = Fcar (tem);             /* POSN_WINDOW (tem) */
-           tem = Fcdr (Fcdr (tem));
-           x = Fcar (Fcar (tem));
-           y = Fcdr (Fcar (tem));
-           timestamp = Fcar (Fcdr (tem));
+           tem = Fcar (Fcdr (Fcdr (tem))); /* POSN_WINDOW_POSN (tem) */
+           x = Fcar (tem);
+           y = Fcdr (tem);
          }
 
        /* If a click happens in an external tool bar or a detached
@@ -1318,9 +1320,13 @@
   selection = ns_menu_show (f, xpos, ypos, for_click,
                            keymaps, title, &error_name);
 #else /* MSDOS and X11 */
+  /* Assume last_event_timestamp is the timestamp of the button event.
+     Is this assumption ever violated?  We can't use the timestamp
+     stored within POSITION because there the top bits from the actual
+     timestamp may be truncated away (Bug#4930).  */
   selection = xmenu_show (f, xpos, ypos, for_click,
                          keymaps, title, &error_name,
-                         INTEGERP (timestamp) ? XUINT (timestamp) : 0);
+                         last_event_timestamp);
 #endif
 
   UNBLOCK_INPUT;


reply via email to

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