emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114609: * keyboard.c (last_event_timestamp): Remove


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r114609: * keyboard.c (last_event_timestamp): Remove. For X selection and
Date: Thu, 10 Oct 2013 10:06:51 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114609
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Thu 2013-10-10 14:06:17 +0400
message:
  * 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.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/keyboard.c                 keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
  src/keyboard.h                 keyboard.h-20091113204419-o5vbwnq5f7feedwu-450
  src/menu.c                     menu.c-20091113204419-o5vbwnq5f7feedwu-8676
  src/menu.h                     menu.h-20091113204419-o5vbwnq5f7feedwu-8702
  src/xmenu.c                    xmenu.c-20091113204419-o5vbwnq5f7feedwu-161
  src/xselect.c                  xselect.c-20091113204419-o5vbwnq5f7feedwu-543
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-10-10 06:48:42 +0000
+++ b/src/ChangeLog     2013-10-10 10:06:17 +0000
@@ -1,5 +1,19 @@
 2013-10-10  Dmitry Antipov  <address@hidden>
 
+       * 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  <address@hidden>
+
        * keyboard.c (init_kboard): Now static.  Add arg
        to denote window system.  Adjust comment.
        (init_keyboard): Adjust user.

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2013-10-10 06:48:42 +0000
+++ b/src/keyboard.c    2013-10-10 10:06:17 +0000
@@ -218,10 +218,6 @@
    '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 @@
            Vlast_event_frame = focus;
          }
 
-         last_event_timestamp = event->timestamp;
-
          handle_interrupt (0);
          return;
        }
@@ -3938,8 +3932,6 @@
               ? 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 @@
          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

=== modified file 'src/keyboard.h'
--- a/src/keyboard.h    2013-10-10 06:48:42 +0000
+++ b/src/keyboard.h    2013-10-10 10:06:17 +0000
@@ -496,10 +496,6 @@
    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;

=== modified file 'src/menu.c'
--- a/src/menu.c        2013-10-08 20:04:40 +0000
+++ b/src/menu.c        2013-10-10 10:06:17 +0000
@@ -1440,14 +1440,9 @@
   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))

=== modified file 'src/menu.h'
--- a/src/menu.h        2013-10-08 20:04:40 +0000
+++ b/src/menu.h        2013-10-10 10:06:17 +0000
@@ -50,7 +50,7 @@
 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 *);

=== modified file 'src/xmenu.c'
--- a/src/xmenu.c       2013-09-29 18:38:56 +0000
+++ b/src/xmenu.c       2013-10-10 10:06:17 +0000
@@ -1262,8 +1262,8 @@
    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 @@
   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 @@
    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 @@
 
 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 @@
   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 @@
 
 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;

=== modified file 'src/xselect.c'
--- a/src/xselect.c     2013-09-17 07:06:42 +0000
+++ b/src/xselect.c     2013-10-10 10:06:17 +0000
@@ -320,7 +320,7 @@
   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 @@
   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 @@
 
   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);


reply via email to

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