window: Add a meta_window_get_titlebar_rect
This commit is contained in:
@ -4310,6 +4310,28 @@ meta_window_get_client_area_rect (const MetaWindow *window,
|
||||
rect->height = window->rect.height;
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_get_titlebar_rect (MetaWindow *window,
|
||||
MetaRectangle *rect)
|
||||
{
|
||||
meta_window_get_frame_rect (window, rect);
|
||||
|
||||
/* The returned rectangle is relative to the frame rect. */
|
||||
rect->x = 0;
|
||||
rect->y = 0;
|
||||
|
||||
if (window->frame)
|
||||
{
|
||||
rect->height = window->frame->child_y;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Pick an arbitrary height for a titlebar. We might want to
|
||||
* eventually have CSD windows expose their borders to us. */
|
||||
rect->height = 15;
|
||||
}
|
||||
}
|
||||
|
||||
const char*
|
||||
meta_window_get_startup_id (MetaWindow *window)
|
||||
{
|
||||
@ -5381,8 +5403,7 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
|
||||
return TRUE;
|
||||
|
||||
/* Get the rectangle corresponding to the titlebar */
|
||||
meta_window_get_frame_rect (window, &titlebar_rect);
|
||||
titlebar_rect.height = window->frame->child_y;
|
||||
meta_window_get_titlebar_rect (window, &titlebar_rect);
|
||||
|
||||
/* Run through the spanning rectangles for the screen and see if one of
|
||||
* them overlaps with the titlebar sufficiently to consider it onscreen.
|
||||
|
Reference in New Issue
Block a user