Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news.d/bugfix/1832.linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make wmctrl optional on Wayland so it doesnt crash the program on startup.
15 changes: 9 additions & 6 deletions plover/oslayer/linux/wmctrl.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from .wmctrl_x11 import WmCtrl
from .display_server import DISPLAY_SERVER


_wmctrl = WmCtrl()

GetForegroundWindow = _wmctrl.get_foreground_window
SetForegroundWindow = _wmctrl.set_foreground_window
if DISPLAY_SERVER == "x11":
from .wmctrl_x11 import WmCtrl
_wmctrl = WmCtrl()
GetForegroundWindow = _wmctrl.get_foreground_window
SetForegroundWindow = _wmctrl.set_foreground_window
else:
GetForegroundWindow = lambda: None
SetForegroundWindow = lambda w: None
Loading