r49513 - in /desktop/unstable/gnome-terminal/debian: changelog patches/series patches/window-Fix-CSD-size-calculations-with-long-titles.patch
sjoerd at users.alioth.debian.org
sjoerd at users.alioth.debian.org
Mon Aug 15 07:06:04 UTC 2016
Author: sjoerd
Date: Mon Aug 15 07:06:03 2016
New Revision: 49513
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=49513
Log:
* debian/patches/window-Fix-CSD-size-calculations-with-long-titles.patch
- Added. Fix terminal window unintentially resizing when using long titles
and CSD (bgo#769898)
Added:
desktop/unstable/gnome-terminal/debian/patches/window-Fix-CSD-size-calculations-with-long-titles.patch
Modified:
desktop/unstable/gnome-terminal/debian/changelog
desktop/unstable/gnome-terminal/debian/patches/series
Modified: desktop/unstable/gnome-terminal/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-terminal/debian/changelog?rev=49513&op=diff
==============================================================================
--- desktop/unstable/gnome-terminal/debian/changelog [utf-8] (original)
+++ desktop/unstable/gnome-terminal/debian/changelog [utf-8] Mon Aug 15 07:06:03 2016
@@ -1,3 +1,11 @@
+gnome-terminal (3.20.2-3) unstable; urgency=medium
+
+ * debian/patches/window-Fix-CSD-size-calculations-with-long-titles.patch
+ - Added. Fix terminal window unintentially resizing when using long titles
+ and CSD (bgo#769898)
+
+ -- Sjoerd Simons <sjoerd at debian.org> Mon, 15 Aug 2016 09:04:09 +0200
+
gnome-terminal (3.20.2-2) unstable; urgency=medium
* Add debian/patches/git_notebook-avoid-crash-on-tab-DND.patch
Modified: desktop/unstable/gnome-terminal/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-terminal/debian/patches/series?rev=49513&op=diff
==============================================================================
--- desktop/unstable/gnome-terminal/debian/patches/series [utf-8] (original)
+++ desktop/unstable/gnome-terminal/debian/patches/series [utf-8] Mon Aug 15 07:06:03 2016
@@ -6,3 +6,4 @@
Fix-chunked-resize-and-geometry-option.patch
Replace-no-op-gtk_window_resize_to_geometry-by-calcu.patch
git_notebook-avoid-crash-on-tab-DND.patch
+window-Fix-CSD-size-calculations-with-long-titles.patch
Added: desktop/unstable/gnome-terminal/debian/patches/window-Fix-CSD-size-calculations-with-long-titles.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-terminal/debian/patches/window-Fix-CSD-size-calculations-with-long-titles.patch?rev=49513&op=file
==============================================================================
--- desktop/unstable/gnome-terminal/debian/patches/window-Fix-CSD-size-calculations-with-long-titles.patch (added)
+++ desktop/unstable/gnome-terminal/debian/patches/window-Fix-CSD-size-calculations-with-long-titles.patch [utf-8] Mon Aug 15 07:06:03 2016
@@ -0,0 +1,75 @@
+From 2664897e513b0cd5fab29788cc31eff8666e027c Mon Sep 17 00:00:00 2001
+From: Sjoerd Simons <sjoerd at luon.net>
+Date: Sun, 14 Aug 2016 22:24:24 +0200
+Subject: [PATCH] window: Fix CSD size calculations with long titles
+
+To get the size of the window use the actual allocation rather then the
+preferred size as the latter takes into account the natural size of the
+title bar as well as the content which throws of calculation when the
+natural size of the title bar is wider then the contnet.
+
+Signed-off-by: Sjoerd Simons <sjoerd at luon.net>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=769898
+---
+ src/terminal-window.c | 34 ++++++++++++++++++++++------------
+ 1 file changed, 22 insertions(+), 12 deletions(-)
+
+--- a/src/terminal-window.c
++++ b/src/terminal-window.c
+@@ -3620,7 +3620,7 @@
+ {
+ TerminalWindowPrivate *priv = window->priv;
+ GtkWidget *widget;
+- GtkRequisition toplevel_request, vbox_request;
++ GtkRequisition vbox_request;
+ GdkGeometry hints;
+ int grid_width, grid_height;
+ int char_width, char_height;
+@@ -3647,26 +3647,36 @@
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "content area requests %dx%d px\n",
+ vbox_request.width, vbox_request.height);
+
+- gtk_widget_get_preferred_size (GTK_WIDGET (window), NULL, &toplevel_request);
+- _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "window requests %dx%d px\n",
+- toplevel_request.width, toplevel_request.height);
+
+ chrome_width = vbox_request.width - (char_width * grid_width);
+ chrome_height = vbox_request.height - (char_height * grid_height);
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "chrome: %dx%d px\n",
+ chrome_width, chrome_height);
+
+- csd_width = toplevel_request.width - vbox_request.width;
+- csd_height = toplevel_request.height - vbox_request.height;
+- _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "CSDs: %dx%d px%s\n",
+- csd_width, csd_height,
+- priv->realized ? "" : " (just a guess)");
++ if (priv->realized)
++ {
++ /* Only when having been realize the CSD can be calculated. Do this by
++ * using the actual allocation rather then the preferred size as the
++ * the preferred size takes the natural size of e.g. the title bar into
++ * account which can be far wider then the contents size when using a
++ * very long title */
++ GtkAllocation toplevel_allocation;
++
++ gtk_widget_get_allocation (GTK_WIDGET (window), &toplevel_allocation);
++ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "window allocation %dx%d px\n",
++ toplevel_allocation.width, toplevel_allocation.height);
++
++ csd_width = toplevel_allocation.width - vbox_request.width;
++ csd_height = toplevel_allocation.height - vbox_request.height;
++ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "CSDs: %dx%d px\n",
++ csd_width, csd_height);
++ }
+
+ if (!priv->realized)
+ {
+ /* Don't actually set the geometry hints until we have been realized,
+- * because we don't know precisely how large the client-side decorations
+- * are going to be. We also avoid setting priv->old_csd_width or
++ * because we don't know how large the client-side decorations are going
++ * to be. We also avoid setting priv->old_csd_width or
+ * priv->old_csd_height, so that next time through this function we'll
+ * definitely recalculate the hints. */
+ }
More information about the pkg-gnome-commits
mailing list