[mutter/wip/carlosg/mode-switch-fix: 1/2] backends/native: Fix logic error
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/mode-switch-fix: 1/2] backends/native: Fix logic error
- Date: Wed, 7 Jul 2021 16:45:39 +0000 (UTC)
commit 841ee0a2273b680b3b44e18ee9106ee3980bfb36
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jul 7 18:31:10 2021 +0200
backends/native: Fix logic error
ClutterInputDevice's get_group_n_modes() vfunc is meant to return
-1 for groups that are out of the known range, not within. Fix the
early return condition, and let the native backend return correctly
the number of modes for the given group.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1920>
src/backends/native/meta-input-device-native.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/backends/native/meta-input-device-native.c b/src/backends/native/meta-input-device-native.c
index fb77a07790..468aef5576 100644
--- a/src/backends/native/meta-input-device-native.c
+++ b/src/backends/native/meta-input-device-native.c
@@ -161,7 +161,7 @@ meta_input_device_native_get_group_n_modes (ClutterInputDevice *device,
{
MetaInputDeviceNative *device_native = META_INPUT_DEVICE_NATIVE (device);
- if (!device_native->modes || group < device_native->modes->len)
+ if (!device_native->modes || group >= device_native->modes->len)
return -1;
return g_array_index (device_native->modes, int, group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]