Backport two fixes for window allocations from git master

This commit is contained in:
Cosimo Cecchi 2013-01-24 10:07:49 -05:00
parent 40f65601c4
commit 4efddbffe2
3 changed files with 86 additions and 1 deletions

View File

@ -0,0 +1,48 @@
From 154204e89136f338a3b0cbd91ddaebc09e4bd8e3 Mon Sep 17 00:00:00 2001
From: Benjamin Otte <otte@redhat.com>
Date: Thu, 24 Jan 2013 14:25:27 +0100
Subject: [PATCH] widget: Allow invisible toplevels to do sizing operations
This is a quickfix to keep things working.
It turns out GtkWindow assumes it can do sizing operations while not
being visible, or while in the process of show()ing/hide()ing itself.
And commit b495ce54 broke these operations.
Figuring this properly requires some more thinking and restructuring on
my part, so for now we relax the requirement of visiblility enough for
these things to start working again.
---
gtk/gtksizerequest.c | 2 +-
gtk/gtkwidget.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 4d54821..0ce86bd 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -268,7 +268,7 @@ _gtk_widget_compute_size_for_orientation (GtkWidget *widget,
gpointer key;
gint min_result = 0, nat_result = 0;
- if (!gtk_widget_get_visible (widget))
+ if (!gtk_widget_get_visible (widget) && !gtk_widget_is_toplevel (widget))
{
if (minimum)
*minimum = 0;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index ed584ea..585b4f8 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4817,7 +4817,7 @@ gtk_widget_size_allocate (GtkWidget *widget,
g_return_if_fail (GTK_IS_WIDGET (widget));
- if (!priv->visible)
+ if (!priv->visible && !gtk_widget_is_toplevel (widget))
return;
gtk_widget_push_verify_invariants (widget);
--
1.8.1

View File

@ -0,0 +1,27 @@
From e84ed710a229edda498e5bdcac675b5885073057 Mon Sep 17 00:00:00 2001
From: Benjamin Otte <otte@redhat.com>
Date: Thu, 17 Jan 2013 20:52:50 +0100
Subject: [PATCH] window: allocation x/y is 0,0
This was incorrect in 97ba4b1b8eb82563f13762a4bd8cfe9beb8a121c.
---
gtk/gtkwindow.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index e0c21a9..0984886 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7171,7 +7171,8 @@ gtk_window_move_resize (GtkWindow *window)
&new_geometry,
new_flags);
- gdk_window_get_position (gdk_window, &allocation.x, &allocation.y);
+ allocation.x = 0;
+ allocation.y = 0;
allocation.width = gdk_window_get_width (gdk_window);
allocation.height = gdk_window_get_height (gdk_window);
--
1.8.1

View File

@ -10,7 +10,7 @@
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
Name: gtk3
Version: 3.7.6
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.gtk.org
@ -18,6 +18,10 @@ URL: http://www.gtk.org
Source: http://download.gnome.org/sources/gtk+/3.7/gtk+-%{version}.tar.xz
Source1: im-cedilla.conf
# fixes for 3.7.6 bugs
Patch0: 0001-window-allocation-x-y-is-0-0.patch
Patch1: 0001-widget-Allow-invisible-toplevels-to-do-sizing-operat.patch
BuildRequires: gnome-common autoconf automake intltool gettext
BuildRequires: atk-devel >= %{atk_version}
BuildRequires: at-spi2-atk-devel
@ -110,6 +114,9 @@ widget toolkit.
%prep
%setup -q -n gtk+-%{version}
%patch0 -p1 -b .window-allocation-1
%patch1 -p1 -b .window-allocation-2
%build
(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi;
@ -244,6 +251,9 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache
%{_datadir}/gtk-doc
%changelog
* Thu Jan 24 2013 Cosimo Cecchi <cosimoc@redhat.com> - 3.7.6-2
- Backport two patches from git master to fix window allocations
* Tue Jan 15 2013 Matthias Clasen <mclasen@redhat.com> - 3.7.6-1
- Update to 3.7.6