[metacity/wip/gtk-theme: 33/52] theme: Don't add invisible borders for windows that can't be resized



commit 516e2e6d2ef3a3299206cab91320361373181e62
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Sep 22 14:52:10 2011 -0400

    theme: Don't add invisible borders for windows that can't be resized
    
    Invisible borders are all about resizing -- in the case that a window
    cannot be resized, it makes no sense to add them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=659854

 src/ui/theme.c |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 8b79f2c..097f777 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -412,6 +412,12 @@ meta_frame_layout_get_borders (const MetaFrameLayout *layout,
 {
   int buttons_height, title_height, draggable_borders;
 
+  meta_frame_borders_clear (borders);
+
+  /* For a full-screen window, we don't have any borders, visible or not. */
+  if (flags & META_FRAME_FULLSCREEN)
+    return;
+
   g_return_if_fail (layout != NULL);
 
   if (!layout->has_title)
@@ -428,30 +434,26 @@ meta_frame_layout_get_borders (const MetaFrameLayout *layout,
   borders->visible.right = layout->right_width;
   borders->visible.bottom = layout->bottom_height;
 
-  if (flags & META_FRAME_FULLSCREEN)
-    {
-      meta_frame_borders_clear (borders);
-      return;
-    }
-
   /* FIXME: ... */
   /* draggable_borders = meta_prefs_get_draggable_border_width (); */
   draggable_borders = 0;
 
-  borders->invisible.left = MAX (0, draggable_borders - borders->visible.left);
-  borders->invisible.right = MAX (0, draggable_borders - borders->visible.right);
-  borders->invisible.bottom = MAX (0, draggable_borders - borders->visible.bottom);
-
-  /* borders.visible is the height of the *title bar*. We can't do the same
-   * algorithm here, titlebars are expectedly much bigger. Just subtract a couple
-   * pixels to get a proper feel. */
-  borders->invisible.top = MAX (0, draggable_borders - 2);
+  if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE)
+    {
+      borders->invisible.left = MAX (0, draggable_borders - borders->visible.left);
+      borders->invisible.right = MAX (0, draggable_borders - borders->visible.right);
+    }
 
-  if (type == META_FRAME_TYPE_ATTACHED)
-    borders->invisible.top = 0;
+  if (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE)
+    {
+      borders->invisible.bottom = MAX (0, draggable_borders - borders->visible.bottom);
 
-  if (flags & META_FRAME_SHADED)
-    borders->visible.bottom = borders->invisible.bottom = 0;
+      /* borders.visible.top is the height of the *title bar*. We can't do the same
+       * algorithm here, titlebars are expectedly much bigger. Just subtract a couple
+       * pixels to get a proper feel. */
+      if (type != META_FRAME_TYPE_ATTACHED)
+        borders->invisible.top = MAX (0, draggable_borders - 2);
+    }
 
   borders->total.left = borders->invisible.left + borders->visible.left;
   borders->total.right = borders->invisible.right + borders->visible.right;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]