window: Proper argument naming for meta_window_client_rect_to_frame_rect
(cherry picked from commit 9b88059e55a0d4c8eea89518388116e88dc4c240)
This commit is contained in:
parent
c46af91d54
commit
21d8b8310a
@ -6061,8 +6061,8 @@ meta_window_get_input_rect (const MetaWindow *window,
|
|||||||
/**
|
/**
|
||||||
* meta_window_client_rect_to_frame_rect:
|
* meta_window_client_rect_to_frame_rect:
|
||||||
* @window: a #MetaWindow
|
* @window: a #MetaWindow
|
||||||
* @frame_rect: client rectangle in root coordinates
|
* @client_rect: client rectangle in root coordinates
|
||||||
* @client_rect: (out): location to store the computed corresponding frame bounds.
|
* @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() -
|
* 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
|
* into the corresponding bounds of the window frame (excluding invisible borders
|
||||||
@ -6070,13 +6070,13 @@ meta_window_get_input_rect (const MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_window_client_rect_to_frame_rect (MetaWindow *window,
|
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;
|
return;
|
||||||
|
|
||||||
*client_rect = *frame_rect;
|
*frame_rect = *client_rect;
|
||||||
|
|
||||||
/* The support for G_MAXINT here to mean infinity is a convenience for
|
/* The support for G_MAXINT here to mean infinity is a convenience for
|
||||||
* constraints.c:get_size_limits() and not something that we provide
|
* 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;
|
MetaFrameBorders borders;
|
||||||
meta_frame_calc_borders (window->frame, &borders);
|
meta_frame_calc_borders (window->frame, &borders);
|
||||||
|
|
||||||
client_rect->x -= borders.visible.left;
|
frame_rect->x -= borders.visible.left;
|
||||||
client_rect->y -= borders.visible.top;
|
frame_rect->y -= borders.visible.top;
|
||||||
if (client_rect->width != G_MAXINT)
|
if (frame_rect->width != G_MAXINT)
|
||||||
client_rect->width += borders.visible.left + borders.visible.right;
|
frame_rect->width += borders.visible.left + borders.visible.right;
|
||||||
if (client_rect->height != G_MAXINT)
|
if (frame_rect->height != G_MAXINT)
|
||||||
client_rect->height += borders.visible.top + borders.visible.bottom;
|
frame_rect->height += borders.visible.top + borders.visible.bottom;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (window->has_custom_frame_extents)
|
if (window->has_custom_frame_extents)
|
||||||
{
|
{
|
||||||
const GtkBorder *extents = &window->custom_frame_extents;
|
const GtkBorder *extents = &window->custom_frame_extents;
|
||||||
client_rect->x += extents->left;
|
frame_rect->x += extents->left;
|
||||||
client_rect->y += extents->top;
|
frame_rect->y += extents->top;
|
||||||
if (client_rect->width != G_MAXINT)
|
if (frame_rect->width != G_MAXINT)
|
||||||
client_rect->width -= extents->left + extents->right;
|
frame_rect->width -= extents->left + extents->right;
|
||||||
if (client_rect->height != G_MAXINT)
|
if (frame_rect->height != G_MAXINT)
|
||||||
client_rect->height -= extents->top + extents->bottom;
|
frame_rect->height -= extents->top + extents->bottom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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_get_outer_rect (const MetaWindow *window, MetaRectangle *rect) G_GNUC_DEPRECATED;
|
||||||
|
|
||||||
void meta_window_client_rect_to_frame_rect (MetaWindow *window,
|
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,
|
void meta_window_frame_rect_to_client_rect (MetaWindow *window,
|
||||||
MetaRectangle *frame_rect,
|
MetaRectangle *frame_rect,
|
||||||
MetaRectangle *client_rect);
|
MetaRectangle *client_rect);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user