mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 22:20:24 +00:00
x11: Ignore old XFixesSelectionNotify events
GtkEntryCompletion can rapidly release and claim ownership of the primary selection. This generates multiple XFixesSelectionNotify events, first stating that no one owns the selection, then another stating that we own the selection. The notification that no one owns the selection causes GtkEntryCompletion to deselect the text, breaking inline autocompletion. This fixes it by ignoring any XFixesSelectionNotify with a timestamp earlier than our clipboard timestamp. Fixes #14
This commit is contained in:
parent
7dabc2a42c
commit
77c3ef48cf
@ -491,6 +491,14 @@ gdk_x11_clipboard_xevent (GdkDisplay *display,
|
||||
if (sn->selection != cb->xselection)
|
||||
return FALSE;
|
||||
|
||||
if (sn->selection_timestamp < cb->timestamp)
|
||||
{
|
||||
GDK_DISPLAY_NOTE (display, CLIPBOARD,
|
||||
g_printerr ("%s: Ignoring XFixesSelectionNotify with too old timestamp (%lu vs %lu)\n",
|
||||
cb->selection, sn->selection_timestamp, cb->timestamp));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (sn->owner == GDK_X11_DISPLAY (display)->leader_window)
|
||||
{
|
||||
GDK_DISPLAY_NOTE (display, CLIPBOARD,
|
||||
|
Loading…
Reference in New Issue
Block a user