Mercurial > vim
comparison src/gui_gtk_x11.c @ 2923:7653420fdc45 v7.3.234
updated for version 7.3.234
Problem: With GTK menu may be popping down.
Solution: Use event time instead of GDK_CURRENT_TIME. (Hong Xu)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 26 Jun 2011 04:49:00 +0200 |
parents | fd4224d9ee09 |
children | 342b17608967 |
comparison
equal
deleted
inserted
replaced
2922:c3a638284c25 | 2923:7653420fdc45 |
---|---|
85 #endif | 85 #endif |
86 | 86 |
87 #ifdef HAVE_X11_SUNKEYSYM_H | 87 #ifdef HAVE_X11_SUNKEYSYM_H |
88 # include <X11/Sunkeysym.h> | 88 # include <X11/Sunkeysym.h> |
89 #endif | 89 #endif |
90 | |
91 static guint32 clipboard_event_time = CurrentTime; | |
92 | 90 |
93 /* | 91 /* |
94 * Easy-to-use macro for multihead support. | 92 * Easy-to-use macro for multihead support. |
95 */ | 93 */ |
96 #ifdef HAVE_GTK_MULTIHEAD | 94 #ifdef HAVE_GTK_MULTIHEAD |
932 int modifiers; | 930 int modifiers; |
933 int key; | 931 int key; |
934 guint state; | 932 guint state; |
935 char_u *s, *d; | 933 char_u *s, *d; |
936 | 934 |
937 clipboard_event_time = event->time; | 935 gui.event_time = event->time; |
938 key_sym = event->keyval; | 936 key_sym = event->keyval; |
939 state = event->state; | 937 state = event->state; |
940 | 938 |
941 #ifdef FEAT_XIM | 939 #ifdef FEAT_XIM |
942 if (xim_queue_key_press_event(event, TRUE)) | 940 if (xim_queue_key_press_event(event, TRUE)) |
1127 static gboolean | 1125 static gboolean |
1128 key_release_event(GtkWidget *widget UNUSED, | 1126 key_release_event(GtkWidget *widget UNUSED, |
1129 GdkEventKey *event, | 1127 GdkEventKey *event, |
1130 gpointer data UNUSED) | 1128 gpointer data UNUSED) |
1131 { | 1129 { |
1132 clipboard_event_time = event->time; | 1130 gui.event_time = event->time; |
1133 /* | 1131 /* |
1134 * GTK+ 2 input methods may do fancy stuff on key release events too. | 1132 * GTK+ 2 input methods may do fancy stuff on key release events too. |
1135 * With the default IM for instance, you can enter any UCS code point | 1133 * With the default IM for instance, you can enter any UCS code point |
1136 * by holding down CTRL-SHIFT and typing hexadecimal digits. | 1134 * by holding down CTRL-SHIFT and typing hexadecimal digits. |
1137 */ | 1135 */ |
1620 int button; | 1618 int button; |
1621 int repeated_click = FALSE; | 1619 int repeated_click = FALSE; |
1622 int x, y; | 1620 int x, y; |
1623 int_u vim_modifiers; | 1621 int_u vim_modifiers; |
1624 | 1622 |
1625 clipboard_event_time = event->time; | 1623 gui.event_time = event->time; |
1626 | 1624 |
1627 /* Make sure we have focus now we've been selected */ | 1625 /* Make sure we have focus now we've been selected */ |
1628 if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget)) | 1626 if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget)) |
1629 gtk_widget_grab_focus(widget); | 1627 gtk_widget_grab_focus(widget); |
1630 | 1628 |
1731 gpointer data UNUSED) | 1729 gpointer data UNUSED) |
1732 { | 1730 { |
1733 int x, y; | 1731 int x, y; |
1734 int_u vim_modifiers; | 1732 int_u vim_modifiers; |
1735 | 1733 |
1736 clipboard_event_time = event->time; | 1734 gui.event_time = event->time; |
1737 | 1735 |
1738 /* Remove any motion "machine gun" timers used for automatic further | 1736 /* Remove any motion "machine gun" timers used for automatic further |
1739 extension of allocation areas if outside of the applications window | 1737 extension of allocation areas if outside of the applications window |
1740 area .*/ | 1738 area .*/ |
1741 if (motion_repeat_timer) | 1739 if (motion_repeat_timer) |
5652 clip_mch_own_selection(VimClipboard *cbd) | 5650 clip_mch_own_selection(VimClipboard *cbd) |
5653 { | 5651 { |
5654 int success; | 5652 int success; |
5655 | 5653 |
5656 success = gtk_selection_owner_set(gui.drawarea, cbd->gtk_sel_atom, | 5654 success = gtk_selection_owner_set(gui.drawarea, cbd->gtk_sel_atom, |
5657 clipboard_event_time); | 5655 gui.event_time); |
5658 gui_mch_update(); | 5656 gui_mch_update(); |
5659 return (success) ? OK : FAIL; | 5657 return (success) ? OK : FAIL; |
5660 } | 5658 } |
5661 | 5659 |
5662 /* | 5660 /* |