mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05:00
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>
This commit is contained in:
parent
8ca087fee9
commit
841ee0a227
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user