1
0
Fork 0

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
This commit is contained in:
Gustavo Noronha Silva 2014-06-05 09:42:05 -03:00 committed by Gustavo Noronha Silva
parent eb734e8b62
commit fcdd222c61

View file

@ -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