[mutter/wip/carlosg/clutter-seat: 69/71] backends: Use latest pointer position if no pointer constrain exists
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/clutter-seat: 69/71] backends: Use latest pointer position if no pointer constrain exists
- Date: Fri, 22 Nov 2019 10:10:16 +0000 (UTC)
commit 23697b7529a7addbcfb94b8240e1f9b051f93c28
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Nov 11 19:16:57 2019 +0100
backends: Use latest pointer position if no pointer constrain exists
The meta_seat_native_constrain_pointer() function receives the current
pointer position, and the new pointer position as in/out parameters.
We were however calculating the new coordinates based on the last pointer
position if there was no pointer constrain in place.
Fortunately to us, this didn't use to happen often/ever, as a pointer
constrain function is set on MetaBackend initialization. This behavior
did also exist previously in MetaDeviceManagerNative.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
src/backends/native/meta-seat-native.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c
index 4a9167438..7758b7a9e 100644
--- a/src/backends/native/meta-seat-native.c
+++ b/src/backends/native/meta-seat-native.c
@@ -914,8 +914,8 @@ meta_seat_native_constrain_pointer (MetaSeatNative *seat,
float stage_width = clutter_actor_get_width (stage);
float stage_height = clutter_actor_get_height (stage);
- *new_x = CLAMP (x, 0.f, stage_width - 1);
- *new_y = CLAMP (y, 0.f, stage_height - 1);
+ *new_x = CLAMP (*new_x, 0.f, stage_width - 1);
+ *new_y = CLAMP (*new_y, 0.f, stage_height - 1);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]