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 (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
'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;
Vlast_event_frame = focus;
}
- last_event_timestamp = event->timestamp;
-
handle_interrupt (0);
return;
}
? 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? */
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 (©);
#else
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;
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))
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 *);
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;
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);
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];
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;
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);
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;
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 ();
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)
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);