Issue #12491: Fix GimpUnitComboBox immediately closing on certain platforms
I noticed that the issue of the combo box popup getting immeidately closed on Linux X11 (and probably macOS as well) only happens when using GimpUnitComboBox as used in gimppropwidgets.c and gimpsizeentry.c while there is no issue when used in gimpstatusbar.c The only noticable difference I saw was that in status bar was that the wrap width of combo box was set to 1 via gtk_combo_box_set_wrap_width. Which was added as a hack for another issue. I did the same for the other two uses of GimpUnitComboBox and the issue disappeared so I moved this hack to GimpUnitComboBox itself as it seems to be generally useful. The change doesn't make much sense to me and is a workaround for something that should probably be changed in GTK but well. As explored in !2654 I think we shouldn't use GtkComboBox but reimplement using a Popover. This would get rid of these workarounds as we wouldn't rely on internal behaviour of GtkComboBox. Couldn't test macOS or Windows but Linux X11 and Wayland work just fine. Tested by: GDK_BACKEND=x11 gimp and GDK_BACKEND=wayland gimp Fixes #12491 Superseedes !2654
This commit is contained in:
parent
a8b30b17d7
commit
b0ee5ddfce
2 changed files with 3 additions and 3 deletions
|
|
@ -308,9 +308,6 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
|
|||
statusbar->unit_combo = gimp_unit_combo_box_new_with_model (store);
|
||||
g_object_unref (store);
|
||||
|
||||
/* see issue #2642 */
|
||||
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (statusbar->unit_combo), 1);
|
||||
|
||||
gtk_widget_set_can_focus (statusbar->unit_combo, FALSE);
|
||||
g_object_set (statusbar->unit_combo, "focus-on-click", FALSE, NULL);
|
||||
gimp_statusbar_add_size_widget (statusbar, statusbar->unit_combo);
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ gimp_unit_combo_box_constructed (GObject *object)
|
|||
G_OBJECT_CLASS (parent_class)->constructed (object);
|
||||
|
||||
gimp_unit_combo_box_popup_shown (combo);
|
||||
|
||||
/* Hack to fix issue #2642 and #12491 */
|
||||
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo), 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Reference in a new issue