mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 01:50:42 -05:00
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:
parent
eb734e8b62
commit
fcdd222c61
@ -666,8 +666,15 @@ translate_coords (ClutterStageX11 *stage_x11,
|
|||||||
gfloat *x_out,
|
gfloat *x_out,
|
||||||
gfloat *y_out)
|
gfloat *y_out)
|
||||||
{
|
{
|
||||||
*x_out = CLAMP (event_x, 0, stage_x11->xwin_width) / stage_x11->scale_factor;
|
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
|
||||||
*y_out = CLAMP (event_y, 0, stage_x11->xwin_height) / stage_x11->scale_factor;
|
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
|
static gdouble
|
||||||
|
Loading…
Reference in New Issue
Block a user