From 2359d1bcbc435d85758713da79e9afa75a967e9788ec9b8d1da267c7d225e64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Thu, 9 Mar 2023 09:29:30 +0000 Subject: [PATCH] Accepting request 1070350 from home:xiaoguang_wang:branches:GNOME:Factory - Add 0001-combobox-Avoid-extra-queue_resize.patch: Fix combobox not showing (bsc#1209043 glgo#GNOME/gtk!5608). OBS-URL: https://build.opensuse.org/request/show/1070350 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gtk4?expand=0&rev=117 --- 0001-combobox-Avoid-extra-queue_resize.patch | 58 ++++++++++++++++++++ gtk4.changes | 6 ++ gtk4.spec | 2 + 3 files changed, 66 insertions(+) create mode 100644 0001-combobox-Avoid-extra-queue_resize.patch diff --git a/0001-combobox-Avoid-extra-queue_resize.patch b/0001-combobox-Avoid-extra-queue_resize.patch new file mode 100644 index 0000000..d9bbca8 --- /dev/null +++ b/0001-combobox-Avoid-extra-queue_resize.patch @@ -0,0 +1,58 @@ +From 55faea104694599298a6ca1b9f2e7a1b46bad45a Mon Sep 17 00:00:00 2001 +From: Ivan Molodetskikh +Date: Tue, 7 Mar 2023 09:51:32 -0800 +Subject: [PATCH] combobox: Avoid extra queue_resize() + +width-request already ensures it's above the minimum width, so avoid an +extra queue_resize() when setting size request to (-1, -1). + +This is the same way as GtkDropDown works. This also unbreaks +GtkComboBox after the recent allocation fix in +75a417e33708dab2bdb2f784a8952e085a12bf03. + +Incidentally, this also makes GtkComboBox actually resize its popup as +intended (that was broken before). + +I don't think this is ultimately the final fix, sometimes I still get +allocation warnings. But the proper fix will probably involve changing +some more allocation machinery around popovers. This is good enough for +now. +--- + gtk/deprecated/gtkcombobox.c | 14 ++------------ + 1 file changed, 2 insertions(+), 12 deletions(-) + +diff --git a/gtk/deprecated/gtkcombobox.c b/gtk/deprecated/gtkcombobox.c +index 618f0780b7..1e76b38f41 100644 +--- a/gtk/deprecated/gtkcombobox.c ++++ b/gtk/deprecated/gtkcombobox.c +@@ -366,7 +366,6 @@ gtk_combo_box_size_allocate (GtkWidget *widget, + { + GtkComboBox *combo_box = GTK_COMBO_BOX (widget); + GtkComboBoxPrivate *priv = gtk_combo_box_get_instance_private (combo_box); +- int menu_width; + + gtk_widget_size_allocate (priv->box, + &(GtkAllocation) { +@@ -374,17 +373,8 @@ gtk_combo_box_size_allocate (GtkWidget *widget, + width, height + }, baseline); + +- gtk_widget_set_size_request (priv->popup_widget, -1, -1); +- +- if (priv->popup_fixed_width) +- gtk_widget_measure (priv->popup_widget, GTK_ORIENTATION_HORIZONTAL, -1, +- &menu_width, NULL, NULL, NULL); +- else +- gtk_widget_measure (priv->popup_widget, GTK_ORIENTATION_HORIZONTAL, -1, +- NULL, &menu_width, NULL, NULL); +- +- gtk_widget_set_size_request (priv->popup_widget, +- MAX (width, menu_width), -1); ++ gtk_widget_set_size_request (priv->popup_widget, width, -1); ++ gtk_widget_queue_resize (priv->popup_widget); + + gtk_popover_present (GTK_POPOVER (priv->popup_widget)); + } +-- +2.39.2 + diff --git a/gtk4.changes b/gtk4.changes index 3642b51..af87610 100644 --- a/gtk4.changes +++ b/gtk4.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 9 07:36:45 UTC 2023 - Xiaoguang Wang + +- Add 0001-combobox-Avoid-extra-queue_resize.patch: Fix combobox + not showing (bsc#1209043 glgo#GNOME/gtk!5608). + ------------------------------------------------------------------- Sun Mar 5 13:27:43 UTC 2023 - Bjørn Lie diff --git a/gtk4.spec b/gtk4.spec index 5c1833d..a1c48a5 100644 --- a/gtk4.spec +++ b/gtk4.spec @@ -39,6 +39,8 @@ Source99: gtk4-rpmlintrc # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4756 # PATCH-FIX-OPENSUSE 0001-Revert-Meson-Simplify-pkgconfig-file-generator.patch -- Revert "Meson: Simplify pkgconfig file generator" Patch0: 0001-Revert-Meson-Simplify-pkgconfig-file-generator.patch +# PATCH-FIX-OPENSUSE 0001-combobox-Avoid-extra-queue_resize.patch bsc#1209043 glgo#GNOME/gtk!5608 xwang@suse.com -- combobox: Avoid extra queue_resize() +Patch1: 0001-combobox-Avoid-extra-queue_resize.patch BuildRequires: cups-devel >= 2.0 # We do not support building against cups 2.3 betas