[mutter] window: Set custom frame extents to 0 if we don't have any



commit a615f9306020a8466e4637a66cc59d11ec96d0fa
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jun 26 11:13:09 2014 -0400

    window: Set custom frame extents to 0 if we don't have any
    
    This is just a quick code cleanup.

 src/core/window.c |   31 +++++++++++++------------------
 1 files changed, 13 insertions(+), 18 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 032e9b0..aa66665 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -4092,16 +4092,13 @@ meta_window_client_rect_to_frame_rect (MetaWindow    *window,
     }
   else
     {
-      if (window->has_custom_frame_extents)
-        {
-          const GtkBorder *extents = &window->custom_frame_extents;
-          frame_rect->x += extents->left;
-          frame_rect->y += extents->top;
-          if (frame_rect->width != G_MAXINT)
-            frame_rect->width -= extents->left + extents->right;
-          if (frame_rect->height != G_MAXINT)
-            frame_rect->height -= extents->top + extents->bottom;
-        }
+      const GtkBorder *extents = &window->custom_frame_extents;
+      frame_rect->x += extents->left;
+      frame_rect->y += extents->top;
+      if (frame_rect->width != G_MAXINT)
+        frame_rect->width -= extents->left + extents->right;
+      if (frame_rect->height != G_MAXINT)
+        frame_rect->height -= extents->top + extents->bottom;
     }
 }
 
@@ -4136,14 +4133,11 @@ meta_window_frame_rect_to_client_rect (MetaWindow    *window,
     }
   else
     {
-      if (window->has_custom_frame_extents)
-        {
-          const GtkBorder *extents = &window->custom_frame_extents;
-          client_rect->x -= extents->left;
-          client_rect->y -= extents->top;
-          client_rect->width += extents->left + extents->right;
-          client_rect->height += extents->top + extents->bottom;
-        }
+      const GtkBorder *extents = &window->custom_frame_extents;
+      client_rect->x -= extents->left;
+      client_rect->y -= extents->top;
+      client_rect->width += extents->left + extents->right;
+      client_rect->height += extents->top + extents->bottom;
     }
 }
 
@@ -7958,6 +7952,7 @@ meta_window_set_custom_frame_extents (MetaWindow *window,
   else
     {
       window->has_custom_frame_extents = FALSE;
+      memset (&window->custom_frame_extents, 0, sizeof (window->custom_frame_extents));
     }
 
   meta_window_queue (window, META_QUEUE_MOVE_RESIZE);


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