From 7cfea75ed6897c81dc129490dd894b1ddeebf433 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 22 Jun 2010 06:07:12 +0200 Subject: Fixes for time in clipboard request. Also fix ownership. (David Fries) --- src/gui_gtk_x11.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gui_gtk_x11.c') diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 2db203b855..5cbe9a3c3a 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -88,6 +88,7 @@ extern void bonobo_dock_item_set_behavior(BonoboDockItem *dock_item, BonoboDockI #ifdef HAVE_X11_SUNKEYSYM_H # include +static guint32 clipboard_event_time = CurrentTime; #endif /* @@ -996,6 +997,7 @@ key_press_event(GtkWidget *widget UNUSED, guint state; char_u *s, *d; + clipboard_event_time = event->time; key_sym = event->keyval; state = event->state; #ifndef HAVE_GTK2 /* deprecated */ @@ -1258,6 +1260,7 @@ key_release_event(GtkWidget *widget UNUSED, GdkEventKey *event, gpointer data UNUSED) { + clipboard_event_time = event->time; /* * GTK+ 2 input methods may do fancy stuff on key release events too. * With the default IM for instance, you can enter any UCS code point @@ -1870,6 +1873,8 @@ button_press_event(GtkWidget *widget, int x, y; int_u vim_modifiers; + clipboard_event_time = event->time; + /* Make sure we have focus now we've been selected */ if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget)) gtk_widget_grab_focus(widget); @@ -1989,6 +1994,8 @@ button_release_event(GtkWidget *widget UNUSED, int x, y; int_u vim_modifiers; + clipboard_event_time = event->time; + /* Remove any motion "machine gun" timers used for automatic further extension of allocation areas if outside of the applications window area .*/ @@ -6883,7 +6890,7 @@ clip_mch_own_selection(VimClipboard *cbd) int success; success = gtk_selection_owner_set(gui.drawarea, cbd->gtk_sel_atom, - (guint32)GDK_CURRENT_TIME); + clipboard_event_time); gui_mch_update(); return (success) ? OK : FAIL; } -- cgit v1.2.3