comparison src/gui_gtk_x11.c @ 2270:917fff7bc09d vim73

Fixes for time in clipboard request. Also fix ownership. (David Fries)
author Bram Moolenaar <bram@vim.org>
date Tue, 22 Jun 2010 06:07:12 +0200
parents 4620acaf4814
children e4d849f4df03
comparison
equal deleted inserted replaced
2269:fb627e94e6c6 2270:917fff7bc09d
86 # include "gui_gtk_f.h" 86 # include "gui_gtk_f.h"
87 #endif 87 #endif
88 88
89 #ifdef HAVE_X11_SUNKEYSYM_H 89 #ifdef HAVE_X11_SUNKEYSYM_H
90 # include <X11/Sunkeysym.h> 90 # include <X11/Sunkeysym.h>
91 static guint32 clipboard_event_time = CurrentTime;
91 #endif 92 #endif
92 93
93 /* 94 /*
94 * Easy-to-use macro for multihead support. 95 * Easy-to-use macro for multihead support.
95 */ 96 */
994 int modifiers; 995 int modifiers;
995 int key; 996 int key;
996 guint state; 997 guint state;
997 char_u *s, *d; 998 char_u *s, *d;
998 999
1000 clipboard_event_time = event->time;
999 key_sym = event->keyval; 1001 key_sym = event->keyval;
1000 state = event->state; 1002 state = event->state;
1001 #ifndef HAVE_GTK2 /* deprecated */ 1003 #ifndef HAVE_GTK2 /* deprecated */
1002 len = event->length; 1004 len = event->length;
1003 g_assert(len <= sizeof(string)); 1005 g_assert(len <= sizeof(string));
1256 static gboolean 1258 static gboolean
1257 key_release_event(GtkWidget *widget UNUSED, 1259 key_release_event(GtkWidget *widget UNUSED,
1258 GdkEventKey *event, 1260 GdkEventKey *event,
1259 gpointer data UNUSED) 1261 gpointer data UNUSED)
1260 { 1262 {
1263 clipboard_event_time = event->time;
1261 /* 1264 /*
1262 * GTK+ 2 input methods may do fancy stuff on key release events too. 1265 * GTK+ 2 input methods may do fancy stuff on key release events too.
1263 * With the default IM for instance, you can enter any UCS code point 1266 * With the default IM for instance, you can enter any UCS code point
1264 * by holding down CTRL-SHIFT and typing hexadecimal digits. 1267 * by holding down CTRL-SHIFT and typing hexadecimal digits.
1265 */ 1268 */
1867 { 1870 {
1868 int button; 1871 int button;
1869 int repeated_click = FALSE; 1872 int repeated_click = FALSE;
1870 int x, y; 1873 int x, y;
1871 int_u vim_modifiers; 1874 int_u vim_modifiers;
1875
1876 clipboard_event_time = event->time;
1872 1877
1873 /* Make sure we have focus now we've been selected */ 1878 /* Make sure we have focus now we've been selected */
1874 if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget)) 1879 if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget))
1875 gtk_widget_grab_focus(widget); 1880 gtk_widget_grab_focus(widget);
1876 1881
1986 GdkEventButton *event, 1991 GdkEventButton *event,
1987 gpointer data UNUSED) 1992 gpointer data UNUSED)
1988 { 1993 {
1989 int x, y; 1994 int x, y;
1990 int_u vim_modifiers; 1995 int_u vim_modifiers;
1996
1997 clipboard_event_time = event->time;
1991 1998
1992 /* Remove any motion "machine gun" timers used for automatic further 1999 /* Remove any motion "machine gun" timers used for automatic further
1993 extension of allocation areas if outside of the applications window 2000 extension of allocation areas if outside of the applications window
1994 area .*/ 2001 area .*/
1995 if (motion_repeat_timer) 2002 if (motion_repeat_timer)
6881 clip_mch_own_selection(VimClipboard *cbd) 6888 clip_mch_own_selection(VimClipboard *cbd)
6882 { 6889 {
6883 int success; 6890 int success;
6884 6891
6885 success = gtk_selection_owner_set(gui.drawarea, cbd->gtk_sel_atom, 6892 success = gtk_selection_owner_set(gui.drawarea, cbd->gtk_sel_atom,
6886 (guint32)GDK_CURRENT_TIME); 6893 clipboard_event_time);
6887 gui_mch_update(); 6894 gui_mch_update();
6888 return (success) ? OK : FAIL; 6895 return (success) ? OK : FAIL;
6889 } 6896 }
6890 6897
6891 /* 6898 /*