gtkwindow: Update shadow size on state change

https://bugzilla.redhat.com/show_bug.cgi?id=1377313
This commit is contained in:
Kalev Lember 2016-09-19 17:05:35 +02:00
parent 454a161f45
commit 52fe7a302a
2 changed files with 58 additions and 1 deletions

View File

@ -0,0 +1,50 @@
From f3920d571e5bdb2568e9169c5a732e24db9419ef Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Mon, 19 Sep 2016 16:11:54 +0200
Subject: [PATCH] gtkwindow: Update shadow size on state change
Otherwise, with CSD, we could have a discrepancy where gtk uses the
right values for the shadows whereas the gdk backend still uses the old
values, leading in some cases to invalid or negative min size being
computed (which, in Wayland, leads a protocol error).
https://bugzilla.gnome.org/show_bug.cgi?id=771561
---
gtk/gtkwindow.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index fc1e050..9808475 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7529,6 +7529,19 @@ update_window_style_classes (GtkWindow *window)
}
static void
+update_window_borders (GtkWindow *window)
+{
+ GtkWindowPrivate *priv = window->priv;
+ GtkBorder window_border = { 0 };
+
+ if (priv->client_decorated && priv->use_client_shadow)
+ {
+ get_shadow_width (window, &window_border);
+ update_shadow_width (window, &window_border);
+ }
+}
+
+static void
popover_size_allocate (GtkWidget *widget,
GtkWindowPopover *popover,
GtkWindow *window)
@@ -7798,6 +7811,7 @@ gtk_window_state_event (GtkWidget *widget,
{
update_window_style_classes (window);
update_window_buttons (window);
+ update_window_borders (window);
gtk_widget_queue_resize (widget);
}
--
2.9.3

View File

@ -18,13 +18,16 @@
Name: gtk3
Version: 3.21.6
Release: 1%{?dist}
Release: 2%{?dist}
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
License: LGPLv2+
URL: http://www.gtk.org
Source0: http://download.gnome.org/sources/gtk+/3.21/gtk+-%{version}.tar.xz
# https://bugzilla.gnome.org/show_bug.cgi?id=771561
Patch0: 0001-gtkwindow-Update-shadow-size-on-state-change.patch
BuildRequires: gnome-common autoconf automake intltool gettext
BuildRequires: pkgconfig(atk) >= %{atk_version}
BuildRequires: pkgconfig(atk-bridge-2.0)
@ -158,6 +161,7 @@ the functionality of the installed %{name} package.
%prep
%setup -q -n gtk+-%{version}
%patch0 -p1
%build
@ -331,6 +335,9 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache
%{_datadir}/installed-tests
%changelog
* Mon Sep 19 2016 Kalev Lember <klember@redhat.com> - 3.21.6-2
- gtkwindow: Update shadow size on state change (#1377313)
* Tue Sep 13 2016 Florian Müllner <fmuellner@redhat.com> - 3.21.6-1
- Update to 3.21.6