diff -r fcea35e2a41f src/gui.c
--- a/src/gui.c	Tue Feb 01 21:55:01 2011 +0100
+++ b/src/gui.c	Thu Feb 03 13:48:51 2011 +0800
@@ -83,6 +83,10 @@
     gui.starting = TRUE;
     full_screen = FALSE;
 
+#ifdef FEAT_GUI_GTK
+    gui.event_time = GDK_CURRENT_TIME;
+#endif
+
 #ifdef MAY_FORK
     if (!gui.dofork || vim_strchr(p_go, GO_FORG) || recursive)
 	dofork = FALSE;
diff -r fcea35e2a41f src/gui.h
--- a/src/gui.h	Tue Feb 01 21:55:01 2011 +0100
+++ b/src/gui.h	Thu Feb 03 13:48:51 2011 +0800
@@ -479,6 +479,10 @@
     char	*rsrc_input_method;
     char	*rsrc_preedit_type_name;
 #endif
+
+#ifdef FEAT_GUI_GTK
+    guint32 event_time;
+#endif
 } gui_T;
 
 extern gui_T gui;			/* this is defined in gui.c */
diff -r fcea35e2a41f src/gui_gtk.c
--- a/src/gui_gtk.c	Tue Feb 01 21:55:01 2011 +0100
+++ b/src/gui_gtk.c	Thu Feb 03 13:48:51 2011 +0800
@@ -1391,7 +1391,7 @@
     gtk_menu_popup(GTK_MENU(menu->submenu_id),
 		   NULL, NULL,
 		   (GtkMenuPositionFunc)NULL, NULL,
-		   3U, (guint32)GDK_CURRENT_TIME);
+		   3U, gui.event_time);
 }
 
 /* Ugly global variable to pass "mouse_pos" flag from gui_make_popup() to
diff -r fcea35e2a41f src/gui_gtk_x11.c
--- a/src/gui_gtk_x11.c	Tue Feb 01 21:55:01 2011 +0100
+++ b/src/gui_gtk_x11.c	Thu Feb 03 13:48:51 2011 +0800
@@ -86,7 +86,6 @@
 
 #ifdef HAVE_X11_SUNKEYSYM_H
 # include <X11/Sunkeysym.h>
-static guint32 clipboard_event_time = CurrentTime;
 #endif
 
 /*
@@ -933,7 +932,7 @@
     guint	state;
     char_u	*s, *d;
 
-    clipboard_event_time = event->time;
+    gui.event_time = event->time;
     key_sym = event->keyval;
     state = event->state;
 
@@ -1128,7 +1127,7 @@
 		  GdkEventKey *event,
 		  gpointer data UNUSED)
 {
-    clipboard_event_time = event->time;
+    gui.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
@@ -1622,7 +1621,7 @@
     int x, y;
     int_u vim_modifiers;
 
-    clipboard_event_time = event->time;
+    gui.event_time = event->time;
 
     /* Make sure we have focus now we've been selected */
     if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget))
@@ -1733,7 +1732,7 @@
     int x, y;
     int_u vim_modifiers;
 
-    clipboard_event_time = event->time;
+    gui.event_time = event->time;
 
     /* Remove any motion "machine gun" timers used for automatic further
        extension of allocation areas if outside of the applications window
@@ -5654,7 +5653,7 @@
     int success;
 
     success = gtk_selection_owner_set(gui.drawarea, cbd->gtk_sel_atom,
-				      clipboard_event_time);
+				      gui.event_time);
     gui_mch_update();
     return (success) ? OK : FAIL;
 }
