Fix Wayland work-around for COSMIC, and add to the PyPI entry point - #602
Open
willstott101 wants to merge 1 commit into
Open
Fix Wayland work-around for COSMIC, and add to the PyPI entry point#602willstott101 wants to merge 1 commit into
willstott101 wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.