]> git.eshelyaron.com Git - emacs.git/commitdiff
* keyboard.c (last_event_timestamp): Remove. For X selection and
authorDmitry Antipov <dmantipov@yandex.ru>
Thu, 10 Oct 2013 10:06:17 +0000 (14:06 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Thu, 10 Oct 2013 10:06:17 +0000 (14:06 +0400)
GTK popup menus, it may be obtained from per-frame X display info.
(kbd_buffer_store_event_hold, kbd_buffer_get_event)
(process_special_events): Adjust users.
* keyboard.h (last_event_timestamp): Remove declaration.
* xmenu.c (xmenu_show, create_and_show_popup_menu): Lost last arg.
Use FRAME_DISPLAY_INFO (f)->last_user_time for gtk_menu_popup.
* menu.h (xmenu_show): Adjust prototype.
* menu.c (Fx_popup_menu): Adjust user.
* xselect.c (x_own_selection, x_get_foreign_selection)
(Fx_disown_selection_internal): Use dpyinfo->last_user_time.

src/ChangeLog
src/keyboard.c
src/keyboard.h
src/menu.c
src/menu.h
src/xmenu.c
src/xselect.c

index d5862485a76b9af5ff2ce4ea772b17ae9beb8828..bdf3a9fb09f81cff257fb1a6dd359d9ffb09e830 100644 (file)
@@ -1,3 +1,17 @@
+2013-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * keyboard.c (last_event_timestamp): Remove.  For X selection and
+       GTK popup menus, it may be obtained from per-frame X display info.
+       (kbd_buffer_store_event_hold, kbd_buffer_get_event)
+       (process_special_events): Adjust users.
+       * keyboard.h (last_event_timestamp): Remove declaration.
+       * xmenu.c (xmenu_show, create_and_show_popup_menu): Lost last arg.
+       Use FRAME_DISPLAY_INFO (f)->last_user_time for gtk_menu_popup.
+       * menu.h (xmenu_show): Adjust prototype.
+       * menu.c (Fx_popup_menu): Adjust user.
+       * xselect.c (x_own_selection, x_get_foreign_selection)
+       (Fx_disown_selection_internal): Use dpyinfo->last_user_time.
+
 2013-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * keyboard.c (init_kboard): Now static.  Add arg
index 9d0ce14ce6fec62d80fd2bd18bf1933c9afdb775..e0cd4d4fda0dcf9c3f69d95117906a834a348bd7 100644 (file)
@@ -218,10 +218,6 @@ static ptrdiff_t last_point_position;
    'volatile' here.  */
 Lisp_Object internal_last_event_frame;
 
-/* The timestamp of the last input event we received from the X server.
-   X Windows wants this for selection ownership.  */
-Time last_event_timestamp;
-
 static Lisp_Object Qx_set_selection, Qhandle_switch_frame;
 static Lisp_Object Qhandle_select_window;
 Lisp_Object QPRIMARY;
@@ -3632,8 +3628,6 @@ kbd_buffer_store_event_hold (register struct input_event *event,
            Vlast_event_frame = focus;
          }
 
-         last_event_timestamp = event->timestamp;
-
          handle_interrupt (0);
          return;
        }
@@ -3938,8 +3932,6 @@ kbd_buffer_get_event (KBOARD **kbp,
               ? kbd_fetch_ptr
               : kbd_buffer);
 
-      last_event_timestamp = event->timestamp;
-
       *kbp = event_to_kboard (event);
       if (*kbp == 0)
        *kbp = current_kboard;  /* Better than returning null ptr?  */
@@ -4301,8 +4293,6 @@ process_special_events (void)
          else
            kbd_fetch_ptr++;
 
-         /* X wants last_event_timestamp for selection ownership.  */
-         last_event_timestamp = copy.timestamp;
          input_pending = readable_events (0);
          x_handle_selection_event (&copy);
 #else
index 26cb862e8a06982db55930dfe39125a787f0605f..6f5593bdf654d554da31ceb15a35341e63baac51 100644 (file)
@@ -496,10 +496,6 @@ extern Lisp_Object QCtoggle, QCradio;
    speed up parse_modifiers.  */
 extern Lisp_Object Qevent_symbol_element_mask;
 
-/* The timestamp of the last input event we received from the X server.
-   X Windows wants this for selection ownership.  */
-extern Time last_event_timestamp;
-
 extern int quit_char;
 
 extern unsigned int timers_run;
index 9e135b56ce5ffac1e924579ded226df629fb5a16..d87d495f96bf3717321a28e518b4bbe4201a2e98 100644 (file)
@@ -1440,14 +1440,9 @@ no quit occurs and `x-popup-menu' returns nil.  */)
   else
 #endif
 #if (defined (HAVE_X_WINDOWS) || defined (MSDOS))
-  /* 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).  */
   if (FRAME_X_P (f) || FRAME_MSDOS_P (f))
     selection = xmenu_show (f, xpos, ypos, for_click,
-                           keymaps, title, &error_name,
-                           last_event_timestamp);
+                           keymaps, title, &error_name);
   else
 #endif
   if (FRAME_TERMCAP_P (f))
index c83f7431c45e90477fc61810d612ad612f4b737d..17d6629064722f5f77ab0f4e463c5e178e698230 100644 (file)
@@ -50,7 +50,7 @@ extern Lisp_Object w32_menu_show (struct frame *, int, int, int, int,
 extern Lisp_Object ns_menu_show (struct frame *, int, int, bool, bool,
                                 Lisp_Object, const char **);
 extern Lisp_Object xmenu_show (struct frame *, int, int, bool, bool,
-                              Lisp_Object, const char **, Time);
+                              Lisp_Object, const char **);
 extern Lisp_Object tty_menu_show (struct frame *, int, int, int, int,
                                  Lisp_Object, int, const char **);
 extern ptrdiff_t menu_item_width (const unsigned char *);
index fe0e229ef200126ffd4d163bb34c051068464ed8..d910100f77f6824e23ba58f9f6d3a43bd1120512 100644 (file)
@@ -1262,8 +1262,8 @@ pop_down_menu (void *arg)
    menu pops down.
    menu_item_selection will be set to the selection.  */
 static void
-create_and_show_popup_menu (struct frame *f, widget_value *first_wv, int x, int y,
-                           bool for_click, Time timestamp)
+create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
+                           int x, int y, bool for_click)
 {
   int i;
   GtkWidget *menu;
@@ -1314,7 +1314,7 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv, int x, int
   gtk_widget_show_all (menu);
 
   gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i,
-                 timestamp ? timestamp : gtk_get_current_event_time ());
+                 FRAME_DISPLAY_INFO (f)->last_user_time);
 
   record_unwind_protect_ptr (pop_down_menu, menu);
 
@@ -1372,7 +1372,7 @@ pop_down_menu (Lisp_Object arg)
    menu_item_selection will be set to the selection.  */
 static void
 create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
-                           int x, int y, bool for_click, Time timestamp)
+                           int x, int y, bool for_click)
 {
   int i;
   Arg av[2];
@@ -1451,7 +1451,7 @@ cleanup_widget_value_tree (void *arg)
 
 Lisp_Object
 xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
-           Lisp_Object title, const char **error_name, Time timestamp)
+           Lisp_Object title, const char **error_name)
 {
   int i;
   widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
@@ -1664,7 +1664,7 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
   record_unwind_protect_ptr (cleanup_widget_value_tree, first_wv);
 
   /* Actually create and show the menu until popped down.  */
-  create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp);
+  create_and_show_popup_menu (f, first_wv, x, y, for_click);
 
   unbind_to (specpdl_count, Qnil);
 
@@ -2133,7 +2133,7 @@ pop_down_menu (Lisp_Object arg)
 
 Lisp_Object
 xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
-           Lisp_Object title, const char **error_name, Time timestamp)
+           Lisp_Object title, const char **error_name)
 {
   Window root;
   XMenu *menu;
index 5eb263d8d0cf5cd7f39e6ee1ae5e786720cf2454..b4f4f9d43b60cadf8e9081dcf31f672254268caa 100644 (file)
@@ -320,7 +320,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value,
   Window selecting_window = FRAME_X_WINDOW (f);
   struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
   Display *display = dpyinfo->display;
-  Time timestamp = last_event_timestamp;
+  Time timestamp = dpyinfo->last_user_time;
   Atom selection_atom = symbol_to_x_atom (dpyinfo, selection_name);
 
   block_input ();
@@ -1188,7 +1188,7 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type,
   struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
   Display *display = dpyinfo->display;
   Window requestor_window = FRAME_X_WINDOW (f);
-  Time requestor_time = last_event_timestamp;
+  Time requestor_time = dpyinfo->last_user_time;
   Atom target_property = dpyinfo->Xatom_EMACS_TMP;
   Atom selection_atom = symbol_to_x_atom (dpyinfo, selection_symbol);
   Atom type_atom = (CONSP (target_type)
@@ -2067,7 +2067,7 @@ On MS-DOS, all this does is return non-nil if we own the selection.  */)
 
   block_input ();
   if (NILP (time_object))
-    timestamp = last_event_timestamp;
+    timestamp = dpyinfo->last_user_time;
   else
     CONS_TO_INTEGER (time_object, Time, timestamp);
   XSetSelectionOwner (dpyinfo->display, selection_atom, None, timestamp);