diff options
Diffstat (limited to 'gtk/gtkentry.c')
-rw-r--r-- | gtk/gtkentry.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 963cf33f53..3c7aa25f94 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -139,6 +139,8 @@ struct _GtkEntryPrivate gint start_y; gchar *im_module; + + GdkDevice *completion_device; }; typedef struct _GtkEntryPasswordHint GtkEntryPasswordHint; @@ -9157,6 +9159,7 @@ static gint gtk_entry_completion_timeout (gpointer data) { GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data); + GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (completion->priv->entry); completion->priv->completion_timeout = 0; @@ -9186,7 +9189,7 @@ gtk_entry_completion_timeout (gpointer data) if (gtk_widget_get_visible (completion->priv->popup_window)) _gtk_entry_completion_resize_popup (completion); else - _gtk_entry_completion_popup (completion); + _gtk_entry_completion_popup (completion, priv->completion_device); } else _gtk_entry_completion_popdown (completion); @@ -9491,7 +9494,9 @@ static void gtk_entry_completion_changed (GtkWidget *entry, gpointer user_data) { + GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (entry); GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (user_data); + GdkDevice *device; /* (re)install completion timeout */ if (completion->priv->completion_timeout) @@ -9509,6 +9514,14 @@ gtk_entry_completion_changed (GtkWidget *entry, return; } + device = gtk_get_current_event_device (); + + if (device && device->source == GDK_SOURCE_KEYBOARD) + device = gdk_device_get_associated_device (device); + + if (device) + priv->completion_device = device; + completion->priv->completion_timeout = gdk_threads_add_timeout (COMPLETION_TIMEOUT, gtk_entry_completion_timeout, |