[gtk+/gtk-3-10] GtkApplicationWindow: avoid mis-allocation
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-10] GtkApplicationWindow: avoid mis-allocation
- Date: Wed, 13 Nov 2013 02:03:49 +0000 (UTC)
commit 2118643429aa703dc8f654f99a6aac3305408df8
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Nov 12 21:01:29 2013 -0500
GtkApplicationWindow: avoid mis-allocation
In the fallback case, we were adding the border width of the
window twice, causing the content to be mis-positioned and
cut off in some cases.
https://bugzilla.gnome.org/show_bug.cgi?id=710909
gtk/gtkapplicationwindow.c | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c
index c0bf5b6..4684bb0 100644
--- a/gtk/gtkapplicationwindow.c
+++ b/gtk/gtkapplicationwindow.c
@@ -723,19 +723,11 @@ gtk_application_window_real_size_allocate (GtkWidget *widget,
menubar_allocation.height = menubar_height;
gtk_widget_size_allocate (window->priv->menubar, &menubar_allocation);
+ child_allocation.y += menubar_height;
+ child_allocation.height -= menubar_height;
child = gtk_bin_get_child (GTK_BIN (window));
if (child != NULL && gtk_widget_get_visible (child))
- {
- gint border_width;
-
- border_width = gtk_container_get_border_width (GTK_CONTAINER (window));
- child_allocation.x += border_width;
- child_allocation.y += border_width + menubar_height;
- child_allocation.width = MAX (1, child_allocation.width - border_width * 2);
- child_allocation.height = MAX (1, child_allocation.height - border_width * 2 - menubar_height);
-
- gtk_widget_size_allocate (child, &child_allocation);
- }
+ gtk_widget_size_allocate (child, &child_allocation);
}
else
GTK_WIDGET_CLASS (gtk_application_window_parent_class)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]