Commit 246e6cd0 authored by Carlos Garnacho's avatar Carlos Garnacho

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.
parent 0e8e5501
......@@ -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),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment