mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
Fixes for time in clipboard request. Also fix ownership. (David Fries)
This commit is contained in:
@@ -88,6 +88,7 @@ extern void bonobo_dock_item_set_behavior(BonoboDockItem *dock_item, BonoboDockI
|
||||
|
||||
#ifdef HAVE_X11_SUNKEYSYM_H
|
||||
# include <X11/Sunkeysym.h>
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user