window: Add get_client_content_rect
In acbb14f34bc8fee14e77db3c100e5d116d8e3d60, we have dropped the is_client_decorated except it was still being used by gnome-shell to adjust the window coordinates in case it is using server side decoration. Instead of re-adding the same function, expose a new function that takes care of getting the whole client area while taking into account SSD for X11 clients. Helps https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7984 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4087>
This commit is contained in:
parent
d4fcef04d6
commit
eb5e6036be
@ -8177,3 +8177,24 @@ meta_window_protocol_to_stage_point (MetaWindow *window,
|
||||
stage_x, stage_y,
|
||||
rounding_strategy);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_window_get_client_content_rect:
|
||||
* @window: A #MetaWindow
|
||||
* @rect: (out): pointer to an allocated #MtkRectangle
|
||||
*
|
||||
* Gets the client rectangle that ATSPI window coordinates
|
||||
* are relative to.
|
||||
*/
|
||||
void
|
||||
meta_window_get_client_content_rect (MetaWindow *window,
|
||||
MtkRectangle *rect)
|
||||
{
|
||||
meta_window_get_frame_rect (window, rect);
|
||||
|
||||
#ifdef HAVE_X11_CLIENT
|
||||
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 &&
|
||||
meta_window_x11_is_ssd (window))
|
||||
meta_window_frame_rect_to_client_rect (window, rect, rect);
|
||||
#endif
|
||||
}
|
||||
|
@ -123,6 +123,10 @@ META_EXPORT
|
||||
void meta_window_get_frame_rect (const MetaWindow *window,
|
||||
MtkRectangle *rect);
|
||||
|
||||
META_EXPORT
|
||||
void meta_window_get_client_content_rect (MetaWindow *window,
|
||||
MtkRectangle *rect);
|
||||
|
||||
META_EXPORT
|
||||
void meta_window_client_rect_to_frame_rect (MetaWindow *window,
|
||||
MtkRectangle *client_rect,
|
||||
|
Loading…
x
Reference in New Issue
Block a user