[gtk/wip/baedert/single-node-window: 5/23] window: Don't care about shadow in size_allocate()
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/single-node-window: 5/23] window: Don't care about shadow in size_allocate()
- Date: Wed, 20 May 2020 08:59:20 +0000 (UTC)
commit 6c6c13209a5e88febcfb09ba6c85dc14f2c329ea
Author: Timm Bäder <mail baedert org>
Date: Sat May 2 08:41:20 2020 +0200
window: Don't care about shadow in size_allocate()
gtk/gtkwindow.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 747cbed4ad..e773ab41be 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4688,7 +4688,6 @@ _gtk_window_set_allocation (GtkWindow *window,
GtkWidget *widget = (GtkWidget *)window;
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GtkAllocation child_allocation;
- GtkBorder window_border = { 0 };
g_assert (allocation_out != NULL);
@@ -4697,10 +4696,13 @@ _gtk_window_set_allocation (GtkWindow *window,
child_allocation.width = width;
child_allocation.height = height;
- get_shadow_width (window, &window_border);
-
if (_gtk_widget_get_realized (widget))
- update_realized_window_properties (window, &child_allocation, &window_border);
+ {
+ GtkBorder shadow;
+
+ get_shadow_width (window, &shadow);
+ update_realized_window_properties (window, &child_allocation, &shadow);
+ }
priv->title_height = 0;
@@ -4712,9 +4714,9 @@ _gtk_window_set_allocation (GtkWindow *window,
{
GtkAllocation title_allocation;
- title_allocation.x = window_border.left;
- title_allocation.y = window_border.top;
- title_allocation.width = MAX (1, width - window_border.left - window_border.right);
+ title_allocation.x = 0;
+ title_allocation.y = 0;
+ title_allocation.width = width;
gtk_widget_measure (priv->title_box, GTK_ORIENTATION_VERTICAL,
title_allocation.width,
@@ -4729,11 +4731,8 @@ _gtk_window_set_allocation (GtkWindow *window,
if (priv->decorated &&
!priv->fullscreen)
{
- child_allocation.x += window_border.left;
- child_allocation.y += window_border.top + priv->title_height;
- child_allocation.width -= window_border.left + window_border.right;
- child_allocation.height -= window_border.top + window_border.bottom +
- priv->title_height;
+ child_allocation.y += priv->title_height;
+ child_allocation.height -= priv->title_height;
}
*allocation_out = child_allocation;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]