From 32292d6eff6f1d5ef1bfa9b139ec886b98b4dbcc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 5 Jul 2013 22:44:42 -0400 Subject: [PATCH] csd: Fix interaction of fullscreen with custom titlebars --- gtk/gtkwindow.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 994a934e04..020d353d71 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -3516,6 +3516,7 @@ gtk_window_set_titlebar (GtkWindow *window, if (visual) gtk_widget_set_visual (widget, visual); + update_window_buttons (window); gtk_widget_queue_resize (widget); } @@ -8247,7 +8248,11 @@ add_frame_size_to_allocation (GtkWindow *window, rect->x -= border.left; rect->y -= border.top; rect->width += border.left + border.right; - rect->height += border.top + border.bottom + info->last.title_height; + rect->height += border.top + border.bottom; + + if (priv->title_box != NULL && + gtk_widget_get_visible (priv->title_box)) + rect->height += info->last.title_height; } static void @@ -8268,7 +8273,10 @@ subtract_frame_size_from_allocation (GtkWindow *window, rect->x += border.left; rect->y += border.top; rect->width -= border.left + border.right; - rect->height -= border.top + border.bottom + info->last.title_height; + rect->height -= border.top + border.bottom; + if (priv->title_box != NULL && + gtk_widget_get_visible (priv->title_box)) + rect->height -= info->last.title_height; rect->width = MAX (1, rect->width); rect->height = MAX (1, rect->height); @@ -8468,13 +8476,17 @@ gtk_window_move_resize (GtkWindow *window) info->last.flags = new_flags; info->last.configure_request = new_request; - if (priv->title_box != NULL) + if (priv->title_box != NULL && gtk_widget_get_visible (priv->title_box)) { gtk_widget_get_preferred_height_for_width (priv->title_box, info->last.configure_request.width, NULL, &info->last.title_height); } + else + { + info->last.title_height = 0; + } /* need to set PPosition so the WM will look at our position, * but we don't want to count PPosition coming and going as a hints