[orca: 1/2] Restore X keyboard layout on orca segfault



commit f93318e4a43c2f34e85fe230cba57e3d73d06167
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Fri Sep 21 13:44:49 2018 +0200

    Restore X keyboard layout on orca segfault
    
    Otherwise the user may be stuck with caps locked after orca crashed.

 src/orca/orca.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/orca/orca.py b/src/orca/orca.py
index 9d5789d24..a74b2f2e2 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -668,6 +668,11 @@ def shutdownOnSignal(signum, frame):
     if not cleanExit:
         die(EXIT_CODE_HANG)
 
+def crashOnSignal(signum, frame):
+    signal.signal(signum, signal.SIG_DFL)
+    _restoreXmodmap(_orcaModifiers)
+    os.kill(os.getpid(), signum)
+
 def main(cacheValues=True):
     """The main entry point for Orca.  The exit codes for Orca will
     loosely be based on signals, where the exit code will be the
@@ -690,6 +695,7 @@ def main(cacheValues=True):
     signal.signal(signal.SIGINT, shutdownOnSignal)
     signal.signal(signal.SIGTERM, shutdownOnSignal)
     signal.signal(signal.SIGQUIT, shutdownOnSignal)
+    signal.signal(signal.SIGSEGV, crashOnSignal)
 
     if not _settingsManager.isAccessibilityEnabled():
         _settingsManager.setAccessibility(True)


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