forked from AuroraMiddleware/gtk
combobox: Fix reentrancy in gtk_combo_box_popdown()
If called when already popped down, warnings would be issued due to priv->grab_pointer being unexpectedly NULL, this would happen in regular operation when selecting items in appears-as-list mode. So both add a NULL check for priv->grab_pointer, and bail out early if the popup window is already hidden.
This commit is contained in:
parent
0e8e550187
commit
246e6cd0b9
@ -2546,9 +2546,13 @@ gtk_combo_box_popdown (GtkComboBox *combo_box)
|
||||
if (!gtk_widget_get_realized (GTK_WIDGET (combo_box)))
|
||||
return;
|
||||
|
||||
if (!gtk_widget_is_drawable (priv->popup_window))
|
||||
return;
|
||||
|
||||
if (priv->grab_keyboard)
|
||||
gdk_device_ungrab (priv->grab_keyboard, GDK_CURRENT_TIME);
|
||||
gdk_device_ungrab (priv->grab_pointer, GDK_CURRENT_TIME);
|
||||
if (priv->grab_pointer)
|
||||
gdk_device_ungrab (priv->grab_pointer, GDK_CURRENT_TIME);
|
||||
|
||||
gtk_widget_hide (priv->popup_window);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button),
|
||||
|
Loading…
Reference in New Issue
Block a user