wayland: Properly apply the fake root offset to event coordinates

GdkEvent's x_root and y_root values should be in the same "fake root
window" coordinate space as gdk_window_get_root_coords.
This commit is contained in:
Jasper St. Pierre
2014-03-17 15:11:13 -04:00
parent 35a1f49db5
commit 92833a0b82

View File

@ -242,15 +242,30 @@ get_coordinates (GdkWaylandDeviceData *data,
double *x, double *y,
double *x_root, double *y_root)
{
int root_x, root_y;
if (x)
*x = data->surface_x;
if (y)
*y = data->surface_y;
/* TODO: Do something clever for relative here */
if (data->pointer_focus)
{
gdk_window_get_root_coords (data->pointer_focus,
data->surface_x,
data->surface_y,
&root_x, &root_y);
}
else
{
root_x = data->surface_x;
root_y = data->surface_y;
}
if (x_root)
*x_root = data->surface_x;
*x_root = root_x;
if (y_root)
*y_root = data->surface_y;
*y_root = root_y;
}
static void