Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Wayland-related crash by setting QT_QPA_PLATFORM to "xcb" #607

Merged
merged 2 commits into from
Mar 12, 2023
Merged
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Release date: UNRELEASED
### Bug fixes

* Fixed a design issue with the `read` command where disjoints groups of digit in layer names would be used to determine layer IDs. Only the first contiguous group of digit is used, so a layer named "01-layer1" would now have layer ID of 1 instead of 11 (#606)
* Fixed an issue on Wayland-based Linux distribution where using the viewer (e.g. with the `show` command) would crash (#607)

### API changes

Expand Down
17 changes: 17 additions & 0 deletions vpype_viewer/qtviewer/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
def _check_wayland():
"""Fix QT env variable on Wayland-based systems.

See https://github.com/abey79/vpype/issues/596
"""
import os
import sys

if sys.platform.startswith("linux"):
if os.environ.get("XDG_SESSION_TYPE", "") == "wayland":
if "QT_QPA_PLATFORM" not in os.environ:
os.environ["QT_QPA_PLATFORM"] = "xcb"


_check_wayland()


from .viewer import *