Skip to content

Fix Wayland work-around for COSMIC, and add to the PyPI entry point - #602

Open
willstott101 wants to merge 1 commit into
CadQuery:masterfrom
willstott101:wayland-platform-fix
Open

Fix Wayland work-around for COSMIC, and add to the PyPI entry point#602
willstott101 wants to merge 1 commit into
CadQuery:masterfrom
willstott101:wayland-platform-fix

Conversation

@willstott101

Copy link
Copy Markdown

The work-around from #575 lives only in run.py, the PyInstaller entry point (pyinstaller.spec runs Analysis(['run.py'])), which is not shipped in the wheel. Installs from PyPI enter at cq_editor.cqe_run:main and never ran it -- #266 was reported against the cq-editor console script, so the fix did not reach it.

Additionally: skipping the fix-up whenever QT_QPA_PLATFORM is already set reads the variable as user intent, but COSMIC and others export "wayland;xcb" session-wide, so on exactly those systems nothing happened and the viewer still died with BadWindow.

Move the logic to cq_editor/qt_platform.py, called from both entry points, and reorder the plugin list rather than replacing it: wayland* entries are demoted but kept, so an explicitly requested plugin is still reachable as a fallback and an offscreen or eglfs choice is untouched. Only an unset variable defaults to xcb.

The work-around from CadQuery#575 lives only in run.py, the PyInstaller entry point
(pyinstaller.spec runs Analysis(['run.py'])), which is not shipped in the wheel.
Installs from PyPI enter at cq_editor.cqe_run:main and never ran it -- CadQuery#266 was
reported against the cq-editor console script, so the fix did not reach it.

Additionally: skipping the fix-up whenever QT_QPA_PLATFORM is already set reads
the variable as user intent, but COSMIC and others export "wayland;xcb"
session-wide, so on exactly those systems nothing happened and the viewer still
died with BadWindow.

Move the logic to cq_editor/qt_platform.py, called from both entry points, and
reorder the plugin list rather than replacing it: wayland* entries are demoted
but kept, so an explicitly requested plugin is still reachable as a fallback and
an offscreen or eglfs choice is untouched.  Only an unset variable defaults to
xcb.
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.

1 participant