[mutter] Fix terminal shrinkage

Matthias Clasen mclasen at fedoraproject.org
Thu May 8 17:27:52 UTC 2014


commit ed4226070c5b00e6d74618d0ca4e5fdfbd38d89e
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Thu May 8 13:27:58 2014 -0400

    Fix terminal shrinkage

 ...-Complete-fix-for-size-hints-constrainmen.patch |   31 +++++++++++
 ...-Size-increments-need-to-be-applied-to-th.patch |   55 ++++++++++++++++++++
 mutter.spec                                        |   10 +++-
 3 files changed, 95 insertions(+), 1 deletions(-)
---
diff --git a/0001-constraints-Complete-fix-for-size-hints-constrainmen.patch b/0001-constraints-Complete-fix-for-size-hints-constrainmen.patch
new file mode 100644
index 0000000..35fa55d
--- /dev/null
+++ b/0001-constraints-Complete-fix-for-size-hints-constrainmen.patch
@@ -0,0 +1,31 @@
+From bc8799d7d7f240887086a16e8a400e049ea64df0 Mon Sep 17 00:00:00 2001
+From: "Jasper St. Pierre" <jstpierre at mecheye.net>
+Date: Mon, 5 May 2014 19:06:47 -0400
+Subject: [PATCH] constraints: Complete fix for size hints constrainment
+
+---
+ src/core/constraints.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/core/constraints.c b/src/core/constraints.c
+index df9c219..bfc7090 100644
+--- a/src/core/constraints.c
++++ b/src/core/constraints.c
+@@ -950,6 +950,14 @@ constrain_size_increments (MetaWindow         *window,
+   if (new_height < window->size_hints.min_height)
+     new_height += ((window->size_hints.min_height - new_height)/hi + 1)*hi;
+ 
++  {
++    client_rect.width = new_width;
++    client_rect.height = new_height;
++    meta_window_client_rect_to_frame_rect (window, &client_rect, &client_rect);
++    new_width = client_rect.width;
++    new_height = client_rect.height;
++  }
++
+   /* Figure out what original rect to pass to meta_rectangle_resize_with_gravity
+    * See bug 448183
+    */
+-- 
+1.9.0
+
diff --git a/0001-constraints-Size-increments-need-to-be-applied-to-th.patch b/0001-constraints-Size-increments-need-to-be-applied-to-th.patch
new file mode 100644
index 0000000..3ce318f
--- /dev/null
+++ b/0001-constraints-Size-increments-need-to-be-applied-to-th.patch
@@ -0,0 +1,55 @@
+From f4ef4b79f95db7b4e3071489a30cbc8f710ab4ce Mon Sep 17 00:00:00 2001
+From: "Jasper St. Pierre" <jstpierre at mecheye.net>
+Date: Mon, 5 May 2014 13:09:41 -0400
+Subject: [PATCH] constraints: Size increments need to be applied to the client
+ rect
+
+Not the frame rect.
+---
+ src/core/constraints.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/src/core/constraints.c b/src/core/constraints.c
+index e4e019b..df9c219 100644
+--- a/src/core/constraints.c
++++ b/src/core/constraints.c
+@@ -905,6 +905,7 @@ constrain_size_increments (MetaWindow         *window,
+   int new_width, new_height;
+   gboolean constraint_already_satisfied;
+   MetaRectangle *start_rect;
++  MetaRectangle client_rect;
+ 
+   if (priority > PRIORITY_SIZE_HINTS_INCREMENTS)
+     return TRUE;
+@@ -915,13 +916,15 @@ constrain_size_increments (MetaWindow         *window,
+       info->action_type == ACTION_MOVE)
+     return TRUE;
+ 
++  meta_window_frame_rect_to_client_rect (window, &info->current, &client_rect);
++
+   /* Determine whether constraint is already satisfied; exit if it is */
+   bh = window->size_hints.base_height;
+   hi = window->size_hints.height_inc;
+   bw = window->size_hints.base_width;
+   wi = window->size_hints.width_inc;
+-  extra_height = (info->current.height - bh) % hi;
+-  extra_width  = (info->current.width  - bw) % wi;
++  extra_height = (client_rect.height - bh) % hi;
++  extra_width  = (client_rect.width  - bw) % wi;
+   /* ignore size increments for maximized windows */
+   if (window->maximized_horizontally)
+     extra_width *= 0;
+@@ -935,8 +938,8 @@ constrain_size_increments (MetaWindow         *window,
+     return constraint_already_satisfied;
+ 
+   /*** Enforce constraint ***/
+-  new_width  = info->current.width  - extra_width;
+-  new_height = info->current.height - extra_height;
++  new_width  = client_rect.width  - extra_width;
++  new_height = client_rect.height - extra_height;
+ 
+   /* Adjusting down instead of up (as done in the above two lines) may
+    * violate minimum size constraints; fix the adjustment if this
+-- 
+1.9.0
+
diff --git a/mutter.spec b/mutter.spec
index 7f3b6bf..e722d1a 100644
--- a/mutter.spec
+++ b/mutter.spec
@@ -1,6 +1,6 @@
 Name:          mutter
 Version:       3.13.1
-Release:       4%{?dist}
+Release:       5%{?dist}
 Summary:       Window and compositing manager based on Clutter
 
 Group:         User Interface/Desktops
@@ -11,6 +11,9 @@ Source0:       http://download.gnome.org/sources/%{name}/3.13/%{name}-%{version}
 
 # Backported upstream fix for a Wayland session crash
 Patch0:        0001-keybindings-Make-sure-not-to-call-meta_change_keygra.patch
+# Fix shrinking terminals
+Patch1: 	0001-constraints-Size-increments-need-to-be-applied-to-th.patch
+Patch2:		0001-constraints-Complete-fix-for-size-hints-constrainmen.patch
 
 BuildRequires: clutter-devel >= 1.15.90
 BuildRequires: pango-devel
@@ -72,6 +75,8 @@ utilities for testing Metacity/Mutter themes.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 (if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; fi;
@@ -136,6 +141,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
 %exclude %{_datadir}/gtk-doc
 
 %changelog
+* Thu May  8 2014 Matthias Clasen <mclasen at redhat.com> - 3.13.1-5
+- Fix shrinking terminals
+
 * Wed May 07 2014 Kalev Lember <kalevlember at gmail.com> - 3.13.1-4
 - Backport an upstream fix for a Wayland session crash
 


More information about the scm-commits mailing list