From 21d8b8310a1e526bc7c71f38a1a9a2b661d1a210 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Fri, 29 Nov 2013 13:52:18 +0100 Subject: [PATCH] window: Proper argument naming for meta_window_client_rect_to_frame_rect (cherry picked from commit 9b88059e55a0d4c8eea89518388116e88dc4c240) --- src/core/window.c | 36 ++++++++++++++++++------------------ src/meta/window.h | 4 ++-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index ba642dc73..92ffc747a 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -6061,8 +6061,8 @@ meta_window_get_input_rect (const MetaWindow *window, /** * meta_window_client_rect_to_frame_rect: * @window: a #MetaWindow - * @frame_rect: client rectangle in root coordinates - * @client_rect: (out): location to store the computed corresponding frame bounds. + * @client_rect: client rectangle in root coordinates + * @frame_rect: (out): location to store the computed corresponding frame bounds. * * Converts a desired bounds of the client window - what is passed to meta_window_move_resize() - * into the corresponding bounds of the window frame (excluding invisible borders @@ -6070,13 +6070,13 @@ meta_window_get_input_rect (const MetaWindow *window, */ void meta_window_client_rect_to_frame_rect (MetaWindow *window, - MetaRectangle *frame_rect, - MetaRectangle *client_rect) + MetaRectangle *client_rect, + MetaRectangle *frame_rect) { - if (!client_rect) + if (!frame_rect) return; - *client_rect = *frame_rect; + *frame_rect = *client_rect; /* The support for G_MAXINT here to mean infinity is a convenience for * constraints.c:get_size_limits() and not something that we provide @@ -6087,24 +6087,24 @@ meta_window_client_rect_to_frame_rect (MetaWindow *window, MetaFrameBorders borders; meta_frame_calc_borders (window->frame, &borders); - client_rect->x -= borders.visible.left; - client_rect->y -= borders.visible.top; - if (client_rect->width != G_MAXINT) - client_rect->width += borders.visible.left + borders.visible.right; - if (client_rect->height != G_MAXINT) - client_rect->height += borders.visible.top + borders.visible.bottom; + frame_rect->x -= borders.visible.left; + frame_rect->y -= borders.visible.top; + if (frame_rect->width != G_MAXINT) + frame_rect->width += borders.visible.left + borders.visible.right; + if (frame_rect->height != G_MAXINT) + frame_rect->height += borders.visible.top + borders.visible.bottom; } else { if (window->has_custom_frame_extents) { const GtkBorder *extents = &window->custom_frame_extents; - client_rect->x += extents->left; - client_rect->y += extents->top; - if (client_rect->width != G_MAXINT) - client_rect->width -= extents->left + extents->right; - if (client_rect->height != G_MAXINT) - client_rect->height -= extents->top + extents->bottom; + 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; } } } diff --git a/src/meta/window.h b/src/meta/window.h index c7ccc358b..d2fb3a740 100644 --- a/src/meta/window.h +++ b/src/meta/window.h @@ -115,8 +115,8 @@ void meta_window_get_frame_rect (const MetaWindow *window, MetaRectangle *rect); void meta_window_get_outer_rect (const MetaWindow *window, MetaRectangle *rect) G_GNUC_DEPRECATED; void meta_window_client_rect_to_frame_rect (MetaWindow *window, - MetaRectangle *frame_rect, - MetaRectangle *client_rect); + MetaRectangle *client_rect, + MetaRectangle *frame_rect); void meta_window_frame_rect_to_client_rect (MetaWindow *window, MetaRectangle *frame_rect, MetaRectangle *client_rect);