import gtk4-4.16.3-2.el10

cs10 imports/cs10/gtk4-4.16.3-2.el10
MSVSphere Packaging Team 4 months ago
parent 2e4bfac3fe
commit 965529d886
Signed by: sys_gitsync
GPG Key ID: B2B0B9F29E528FE8

2
.gitignore vendored

@ -1 +1 @@
SOURCES/gtk-4.15.3.tar.xz
SOURCES/gtk-4.16.3.tar.xz

@ -1 +1 @@
1d8ca43b0234278c7a4ab458ecb820a6c1820132 SOURCES/gtk-4.15.3.tar.xz
050091ee14f0601c898380862035825eec1558b3 SOURCES/gtk-4.16.3.tar.xz

@ -1,50 +0,0 @@
From ca05f10c2ce0312779cb39979ef06aa052d785d4 Mon Sep 17 00:00:00 2001
From: Matthijs Velsink <mvelsink@gnome.org>
Date: Tue, 2 Jul 2024 02:50:29 +0200
Subject: [PATCH 1/2] popover: Take shadow size into account in measure
Commit b9487997 introduced shadows for GtkPopover. These are correctly
subtracted while allocating the child widget, but the child is not
measured with those shadows subtracted (as is correctly done for the
arrow). This can give criticals, for example with some wrapping labels.
To fix this, we subtract the shadow size from the `for_size` before
passing it to the measure() of the child widget.
Closes #5782
Fixes #6796
---
gtk/gtkpopover.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index bdd66f2f8b..f93075d2a0 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1511,12 +1511,20 @@ gtk_popover_measure (GtkWidget *widget,
GtkCssStyle *style;
GtkBorder shadow_width;
- if (for_size >= 0 && (POS_IS_VERTICAL (priv->position) == (orientation == GTK_ORIENTATION_HORIZONTAL)))
- for_size -= tail_height;
-
style = gtk_css_node_get_style (gtk_widget_get_css_node (GTK_WIDGET (priv->contents_widget)));
gtk_css_shadow_value_get_extents (style->used->box_shadow, &shadow_width);
+ if (for_size >= 0)
+ {
+ if ((POS_IS_VERTICAL (priv->position) == (orientation == GTK_ORIENTATION_HORIZONTAL)))
+ for_size -= tail_height;
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ for_size -= shadow_width.top + shadow_width.bottom;
+ else
+ for_size -= shadow_width.left + shadow_width.right;
+ }
+
gtk_widget_measure (priv->contents_widget,
orientation, for_size,
minimum, natural,
--
2.46.0

@ -1,47 +0,0 @@
From 6b984977b86a8dce89a3d5b4f51a5154f3795200 Mon Sep 17 00:00:00 2001
From: Matthijs Velsink <mvelsink@gnome.org>
Date: Tue, 2 Jul 2024 03:47:02 +0200
Subject: [PATCH 2/2] popover: Fix invalid width/height check in layout
Commit a4cc95b2 introduced a check in layout() that closes the popover
if the width or height is smaller than the minimum width or height,
respectively. However, that was using gtk_widget_get_preferred_size(),
which finds out the minimum height for the minimum width and vice versa,
but not the minimum height for the layout width and vice versa. So,
certain popovers were not showing, even though they would not have
generated a critical to begin with.
To fix this, we copy the logic from gtk_widget_allocate() that generates
the criticals, and use that to check if we have a good width/height for
the popover native or not.
Closes #6826
---
gtk/gtkpopover.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index f93075d2a0..4d8b5d13f6 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -709,10 +709,14 @@ gtk_popover_native_layout (GtkNative *native,
GtkPopover *popover = GTK_POPOVER (native);
GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
GtkWidget *widget = GTK_WIDGET (popover);
- GtkRequisition min, nat;
+ int min_height_for_width, min_width_for_height;
- gtk_widget_get_preferred_size (widget, &min, &nat);
- if (width < min.width || height < min.height)
+ gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL, width,
+ &min_height_for_width, NULL, NULL, NULL);
+ gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, height,
+ &min_width_for_height, NULL, NULL, NULL);
+
+ if (width < min_width_for_height || height < min_height_for_width)
{
gtk_popover_popdown (popover);
return;
--
2.46.0

@ -34,7 +34,7 @@
%endif
Name: gtk4
Version: 4.15.3
Version: 4.16.3
Release: %autorelease
Summary: GTK graphical user interface library
@ -45,10 +45,6 @@ Source0: https://download.gnome.org/sources/gtk/4.15/gtk-%{version}.tar.x
# Using objcopy for resources interferes with hardening
Patch0: gtk4-no-objcopy.patch
# Upstream fixes for popovers gone missing
Patch1: 0001-popover-Take-shadow-size-into-account-in-measure.patch
Patch2: 0002-popover-Fix-invalid-width-height-check-in-layout.patch
BuildRequires: cups-devel
BuildRequires: desktop-file-utils
BuildRequires: docbook-style-xsl
@ -244,6 +240,7 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop
%{_bindir}/gtk4-node-editor
%{_bindir}/gtk4-print-editor
%{_bindir}/gtk4-rendernode-tool
%{_bindir}/gtk4-image-tool
%{_bindir}/gtk4-widget-factory
%{_datadir}/applications/org.gtk.gtk4.NodeEditor.desktop
%{_datadir}/applications/org.gtk.Demo4.desktop
@ -266,10 +263,17 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop
%{_mandir}/man1/gtk4-icon-browser.1*
%{_mandir}/man1/gtk4-node-editor.1*
%{_mandir}/man1/gtk4-rendernode-tool.1*
%{_mandir}/man1/gtk4-image-tool.1*
%{_mandir}/man1/gtk4-widget-factory.1*
%changelog
## START: Generated by rpmautospec
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 4.16.3-2
- Bump release for October 2024 mass rebuild:
* Fri Oct 04 2024 Matthias Clasen <mclasen@redhat.com> - 4.16.3-1
- Update to GTK 4.16.3
* Thu Sep 05 2024 Matthias Clasen <mclasen@redhat.com> - 4.15.3-2
- Fix missing popovers

Loading…
Cancel
Save