Finally tracked down and came up with a work around for that weird bug. Sometimes i3's input gets into a weird state, I think because some windows either don't close properly or move the focus somewhere it shouldn't be. Either way it breaks keyboard input completely even though i3 itself is fine. Added a watchdog to check for this condition and reset i3 if it happens. Sure, your desktop may pop up but it beats the hell out of a frozen GUI.

This commit is contained in:
Storm Dragon
2025-12-09 08:27:12 -05:00
parent 3fb76772ab
commit 4eebbf2bed
3 changed files with 158 additions and 3 deletions

View File

@@ -50,13 +50,20 @@ def on_new_window(self,i3):
def on_close_window(self,i3):
try:
windowName = getattr(i3.container, 'name', None)
windowClass = getattr(i3.container, 'window_class', None)
# Get container early - if this fails, bail immediately
container = getattr(i3, 'container', None)
if container is None:
return
# Fast checks with immediate bailout on any issue
windowName = getattr(container, 'name', None)
windowClass = getattr(container, 'window_class', None)
# Skip sound only for notification daemon (it has its own sound)
if windowName != 'xfce4-notifyd' and windowClass != 'xfce4-notifyd':
play_sound_async('play -nqV0 synth .25 sin 880:440 sin 920:480 remix - norm -3 pitch -500')
except Exception:
# Silently ignore errors to prevent blocking i3
# Silently ignore any errors - better no sound than blocking i3
pass
def on_mode(self,event):