emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ed9adafc0b: Avoid disabling device multiple times while handling


From: Po Lu
Subject: master ed9adafc0b: Avoid disabling device multiple times while handling XI attachment events
Date: Tue, 16 Aug 2022 22:21:40 -0400 (EDT)

branch: master
commit ed9adafc0bdcfc2c79534282f888df3b250db329
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 src/xterm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 7487450d64..a40440e0da 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -22653,13 +22653,16 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
                      if (info)
                        {
-                         if (device && info->enabled)
+                         if (device)
                            {
                              device->use = info->use;
                              device->attachment = info->attachment;
                            }
-                         else if (device)
-                           disabled[n_disabled++] = hev->info[i].deviceid;
+
+                         /* device could have been disabled by now.
+                            But instead of removing it immediately,
+                            wait for XIDeviceDisabled, or internal
+                            state could be left inconsistent.  */
 
                          XIFreeDeviceInfo (info);
                        }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]