diff options
| author | Po Lu | 2022-08-17 10:20:25 +0800 |
|---|---|---|
| committer | Po Lu | 2022-08-17 10:20:25 +0800 |
| commit | ed9adafc0bdcfc2c79534282f888df3b250db329 (patch) | |
| tree | a46720f5e3cab61ad12f8037eb2ef1ddbae940c8 /src | |
| parent | b24f7667ad686093c2b013bc58e2f1234d7487fd (diff) | |
| download | emacs-ed9adafc0bdcfc2c79534282f888df3b250db329.tar.gz emacs-ed9adafc0bdcfc2c79534282f888df3b250db329.zip | |
Avoid disabling device multiple times while handling XI attachment events
* src/xterm.c (handle_one_xevent): Avoid disabling devices if we
notice it has been disabled while handling XISlaveDetached or
XISlaveAttached.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/xterm.c b/src/xterm.c index 7487450d649..a40440e0dad 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -22653,13 +22653,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 22653 | 22653 | ||
| 22654 | if (info) | 22654 | if (info) |
| 22655 | { | 22655 | { |
| 22656 | if (device && info->enabled) | 22656 | if (device) |
| 22657 | { | 22657 | { |
| 22658 | device->use = info->use; | 22658 | device->use = info->use; |
| 22659 | device->attachment = info->attachment; | 22659 | device->attachment = info->attachment; |
| 22660 | } | 22660 | } |
| 22661 | else if (device) | 22661 | |
| 22662 | disabled[n_disabled++] = hev->info[i].deviceid; | 22662 | /* device could have been disabled by now. |
| 22663 | But instead of removing it immediately, | ||
| 22664 | wait for XIDeviceDisabled, or internal | ||
| 22665 | state could be left inconsistent. */ | ||
| 22663 | 22666 | ||
| 22664 | XIFreeDeviceInfo (info); | 22667 | XIFreeDeviceInfo (info); |
| 22665 | } | 22668 | } |