mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 12:52:14 +00:00
meta-backend: Fix the max device calculation on removal
If we add device 2, then add device 254, then remove device 254, then the max device ID will be 253. Scan through all the devices again on removal to calculate a new max device ID.
This commit is contained in:
parent
fee40353e2
commit
27d6b2645e
@ -119,8 +119,16 @@ destroy_device_monitor (MetaBackend *backend,
|
||||
int device_id)
|
||||
{
|
||||
g_clear_object (&backend->device_monitors[device_id]);
|
||||
|
||||
if (device_id == backend->device_id_max)
|
||||
backend->device_id_max--;
|
||||
{
|
||||
/* Reset the max device ID */
|
||||
int i, new_max = 0;
|
||||
for (i = 0; i < backend->device_id_max; i++)
|
||||
if (backend->device_monitors[i] != NULL)
|
||||
new_max = i;
|
||||
backend->device_id_max = new_max;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user