1
0
Fork 0

window: Fix get_input_rect in a hacky way

All of the users of get_input_rect don't actually want a synthesized
input rect based off of the current margins. What they really want is
the last-configured size of the toplevel window.

Since we don't properly track this anymore in the generic MetaWindow,
use XGetWindowAttributes to fetch a server-side rectangle. This is a
bad layer violation, but since the window geometry code will have to
be rewritten anyway for the Wayland set_window_geometry, let's just
push a hacky fix for now.
This commit is contained in:
Jasper St. Pierre 2014-06-16 18:28:18 -04:00
parent 3c0fae74f1
commit 9d5273bb15

View file

@ -4051,6 +4051,17 @@ meta_window_get_input_rect (const MetaWindow *window,
{
if (window->frame)
*rect = window->frame->rect;
else if (window->xwindow != None)
{
XWindowAttributes xwa;
XGetWindowAttributes (window->display->xdisplay, window->xwindow, &xwa);
rect->x = xwa.x;
rect->y = xwa.y;
rect->width = xwa.width;
rect->height = xwa.height;
}
else
{
*rect = window->rect;