From a615f9306020a8466e4637a66cc59d11ec96d0fa Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 26 Jun 2014 11:13:09 -0400 Subject: [PATCH] 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 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index 032e9b09d..aa666656b 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);