Skip to content

oslayer: Make wmctrl optional (for Wayland).#1832

Merged
mkrnr merged 2 commits intoopensteno:mainfrom
daym:wmctrl-wayland
Apr 9, 2026
Merged

oslayer: Make wmctrl optional (for Wayland).#1832
mkrnr merged 2 commits intoopensteno:mainfrom
daym:wmctrl-wayland

Conversation

@daym
Copy link
Copy Markdown
Contributor

@daym daym commented Mar 23, 2026

Summary of changes

Make wmctrl optional (for Wayland--otherwise plover crashes on startup).

Closes

Pull Request Checklist

  • Changes have tests
  • News fragment added in news.d. See documentation for details

@mkrnr
Copy link
Copy Markdown
Contributor

mkrnr commented Mar 25, 2026

Thanks a lot for your PR!

Ruff is complaining right now. I'd suggest something like this:

from .display_server import DISPLAY_SERVER


def GetForegroundWindow():
    return None


def SetForegroundWindow(w):
    del w


if DISPLAY_SERVER == "x11":
    from .wmctrl_x11 import WmCtrl

    _wmctrl = WmCtrl()
    GetForegroundWindow = _wmctrl.get_foreground_window
    SetForegroundWindow = _wmctrl.set_foreground_window

Copy link
Copy Markdown
Contributor

@mkrnr mkrnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again! 🙂

@mkrnr mkrnr merged commit 78a18d4 into opensteno:main Apr 9, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants