Attempt to fix the bug where Fenrir freezes the computer solid if it manages to start before sound is ready. It shuld at least release the keyboard now.
This commit is contained in:
@ -42,6 +42,25 @@ class inputDriver():
|
||||
if not self._initialized:
|
||||
return True
|
||||
return True
|
||||
|
||||
def forceUngrab(self):
|
||||
"""Emergency method to release grabbed devices in case of failure"""
|
||||
if not self._initialized:
|
||||
return True
|
||||
try:
|
||||
# Try standard ungrab first
|
||||
return self.ungrabAllDevices()
|
||||
except Exception as e:
|
||||
# Just log the failure and inform the user
|
||||
if hasattr(self, 'env') and 'runtime' in self.env and 'debug' in self.env['runtime']:
|
||||
self.env['runtime']['debug'].writeDebugOut(
|
||||
f"Emergency device release failed: {str(e)}",
|
||||
debug.debugLevel.ERROR
|
||||
)
|
||||
else:
|
||||
print(f"Emergency device release failed: {str(e)}")
|
||||
return False
|
||||
|
||||
def hasIDevices(self):
|
||||
if not self._initialized:
|
||||
return False
|
||||
|
Reference in New Issue
Block a user