mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-16 21:50:34 +00:00
entry completion: Only grab the device if we have one
When the entry completion is popped up from a timeout, we may not have a device. In that case, don't call gdk_device_grab, do avoid criticals.
This commit is contained in:
parent
dd3f4f2904
commit
0731c50262
@ -1654,15 +1654,18 @@ gtk_entry_completion_popup (GtkEntryCompletion *completion)
|
||||
|
||||
gtk_widget_show (completion->priv->popup_window);
|
||||
|
||||
gtk_device_grab_add (completion->priv->popup_window, completion->priv->device, TRUE);
|
||||
gdk_device_grab (completion->priv->device, gtk_widget_get_window (completion->priv->popup_window),
|
||||
GDK_OWNERSHIP_WINDOW, TRUE,
|
||||
GDK_BUTTON_PRESS_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK |
|
||||
GDK_POINTER_MOTION_MASK,
|
||||
NULL, GDK_CURRENT_TIME);
|
||||
if (completion->priv->device)
|
||||
{
|
||||
gtk_device_grab_add (completion->priv->popup_window, completion->priv->device, TRUE);
|
||||
gdk_device_grab (completion->priv->device, gtk_widget_get_window (completion->priv->popup_window),
|
||||
GDK_OWNERSHIP_WINDOW, TRUE,
|
||||
GDK_BUTTON_PRESS_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK |
|
||||
GDK_POINTER_MOTION_MASK,
|
||||
NULL, GDK_CURRENT_TIME);
|
||||
|
||||
completion->priv->has_grab = TRUE;
|
||||
completion->priv->has_grab = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user