[clutter/clutter-1.20] device-manager-xi2: use allocation for clamping
- From: Gustavo Noronha Silva <gns src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.20] device-manager-xi2: use allocation for clamping
- Date: Thu, 5 Jun 2014 18:03:25 +0000 (UTC)
commit fcdd222c61da457ed56bc58ef346e896776fe257
Author: Gustavo Noronha Silva <gustavo noronha collabora com>
Date: Thu Jun 5 09:42:05 2014 -0300
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
clutter/x11/clutter-device-manager-xi2.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c
index b00cddb..2c8ced8 100644
--- a/clutter/x11/clutter-device-manager-xi2.c
+++ b/clutter/x11/clutter-device-manager-xi2.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]