Open chris-morgan opened 3 years ago
@chris-morgan Can you grab the 0.2 release for Linux, extract it, then add the following line to the CQ-editor.sh script (before it launches the CQ-editor binary)?
export QT_QPA_PLATFORM=xcb
Then try to launch CQ-editor by executing the CQ-editor.sh script. If that works, we can consider adding it to the script for new releases until the core issue is fixed.
Huh, although what I built from source supports Wayland, that 0.2 release actually doesn’t support wayland at all, and thus just detects that it should use wayland, emits a warning because it can’t, and successfully falls back to xcb:
$ ./CQ-editor.sh
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Namespace(filename=None)
TKOpenGl | Type: Other | ID: 0 | Severity: Medium | Message:
OpenGl_Window::CreateWindow: window Visual is incomplete: no depth buffer, no stencil buffer
$ QT_QPA_PLATFORM=xcb ./CQ-editor.sh
Namespace(filename=None)
TKOpenGl | Type: Other | ID: 0 | Severity: Medium | Message:
OpenGl_Window::CreateWindow: window Visual is incomplete: no depth buffer, no stencil buffer
That is because of occ can't support waylan. https://github.com/tpaviot/pythonocc-core/issues/1230
So to summarize, please submit patches to OCCT if you want Weyland support.
I cannot reproduce a cq-editor crash with Wayland on Fedora Linux.
Just want to chime in here. I did a complete new install of the Fedora 40 KDE Spin on my laptop. Wayland is now the base X-server and X11 is dropped.
I installed both cadquery
and cq-editor
with pip
directly from the github repo in a virtual environment with Python 3.11.
When I want to start cq-editor, I got the same error as @chris-morgan but by using cq-editor --platform xcb
it will start and work as expected.
I’m filing this here because I’m not certain where it should go and CQ-editor is where I observe it, but it could belong on OCP or OpenCascade or something.
Environment: Arch Linux, Sway window manager, and OCP, CadQuery and CQ-editor master, via these AUR packages:
Result of running CQ-editor:
With XWayland enabled, the CQ-editor window opens very briefly in a regular Wayland window, and then the process dies:
Looks like something is calling an X function with a Wayland id.
With XWayland pseudo-disabled (it’s still running, but I unset
DISPLAY
), it doesn’t start:Diagnosis: Qt supports Wayland, and so CQ-editor defaults to rendering to Wayland, but it looks like OCP or something like it is using X APIs where it should be using Qt APIs which abstract over the platform.
Workaround: force CQ-editor to use X instead of Wayland by setting the environment variable
QT_QPA_PLATFORM=xcb
, or by passing the command line arguments--platform xcb
.Other remarks: I strongly desire proper Wayland support, because I’m using fractional scaling (1.5×), which Sway handles fine, but XWayland renders at 2× and scales down, which mangles it terribly.
I’m not sure where the error message comes from; I haven’t delved in a debugger to find out (because I’m not sure quite how to).
If this is out of CadQuery’s control for whatever reason, then until it can be fixed, CQ-editor should be adjusted to default to xcb instead of wayland. No idea how you do that, but Krita does it (because it’s mostly broken under Wayland).