Commit d0aaf89f authored by Gustavo Noronha Silva's avatar Gustavo Noronha Silva Committed by Gustavo Noronha Silva

device-manager-xi2: use allocation for clamping

The coordinates translated by the XI2 device manager were being clamped using
the X window size kept by StageX11. However, when the stage is fullscreen,
that size is not updated to the screen size, but kept the same in order to
allow going back to it when the stage goes out of fullscreen.

https://bugzilla.gnome.org/show_bug.cgi?id=731268
parent e3e18d92
......@@ -666,8 +666,15 @@ translate_coords (ClutterStageX11 *stage_x11,
gfloat *x_out,
gfloat *y_out)
{
*x_out = CLAMP (event_x, 0, stage_x11->xwin_width) / stage_x11->scale_factor;
*y_out = CLAMP (event_y, 0, stage_x11->xwin_height) / stage_x11->scale_factor;
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
ClutterActor *stage = CLUTTER_ACTOR (stage_cogl->wrapper);
gfloat stage_width;
gfloat stage_height;
clutter_actor_get_size (stage, &stage_width, &stage_height);
*x_out = CLAMP (event_x, 0, stage_width) / stage_x11->scale_factor;
*y_out = CLAMP (event_y, 0, stage_height) / stage_x11->scale_factor;
}
static gdouble
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment