summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2009-02-10 18:29:24 -0500
committerKristian Høgsberg <krh@redhat.com>2009-02-10 18:29:24 -0500
commit6c9c8f8923926bf0bf270c0ecf21eae8371d4778 (patch)
tree71d0e151962992fddb37897717470f8e74f91d46
parent1a208d58cb87fdfc8991f4509c8953f36ebc4e2a (diff)
downloadwayland-6c9c8f8923926bf0bf270c0ecf21eae8371d4778.tar.gz
wayland-6c9c8f8923926bf0bf270c0ecf21eae8371d4778.tar.xz
wayland-6c9c8f8923926bf0bf270c0ecf21eae8371d4778.zip
Fix surface coordinate transformation.
-rw-r--r--wayland-system-compositor.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/wayland-system-compositor.c b/wayland-system-compositor.c
index 2aaa774..a0ab5f9 100644
--- a/wayland-system-compositor.c
+++ b/wayland-system-compositor.c
@@ -861,15 +861,17 @@ pick_surface(struct wlsc_input_device *device, int32_t *sx, int32_t *sy)
if (es->map.x <= device->x &&
device->x < es->map.x + es->map.width &&
es->map.y <= device->y &&
- device->y < es->map.y + es->map.height)
+ device->y < es->map.y + es->map.height) {
+ /* Transform to surface coordinates. */
+ *sx = (device->x - es->map.x) * es->width / es->map.width;
+ *sy = (device->y - es->map.y) * es->height / es->map.height;
+
return es;
+ }
es = container_of(es->link.prev,
struct wlsc_surface, link);
- /* Transform to surface coordinates. */
- *sx = (device->x - es->map.x) * es->width / es->map.width;
- *sy = (device->y - es->map.y) * es->height / es->map.height;
}
return NULL;