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

Selecting live preview in windows snap left/right causes slint LSP to crash (WSL2 ubuntu 22.04 remote from Windows 11) #5275

Closed
robmwalsh opened this issue May 20, 2024 · 5 comments

Comments

@robmwalsh
Copy link

reproduction steps:

  1. in WSL cargo generate --git https://github.com/slint-ui/slint-rust-template --name memory
  2. open VS code
  3. open the memory folder using WSL remote extension
  4. open appwindow.slint
  5. use the command palette to show preview
  6. with focus on vscode, press windows key and left (snap left). vscode snaps left, option for windows to fill the right side appear on the right
  7. select the live preview
  8. LSP crashes

Slint LSP output (from vscode)

Failed to initialize Skia GPU renderer: Error creating glutin display for native display Wayland(
    WaylandDisplayHandle {
        display: 0x0000561b1a857320,
    },
): not found . Falling back to software rendering

>>>>>>>>>>>>>Crash happens here <<<<<<<<<<
Io error: Broken pipe (os error 32)
Io error: Broken pipe (os error 32)
Io error: Broken pipe (os error 32)
thread 'main' panicked at tools/lsp/preview/native.rs:83:40:
called `Result::unwrap()` on an `Err` value: Other("Error running winit event loop: Exit Failure: 1")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Info  - 8:55:53 PM] Connection to server got closed. Server will restart.
true
The Slint Language Server crashed. This is a bug.
Please open an issue on https://github.com/slint-ui/slint/issues
The Slint Language Server crashed. This is a bug.
Please open an issue on https://github.com/slint-ui/slint/issues
The Slint Language Server crashed. This is a bug.
Please open an issue on https://github.com/slint-ui/slint/issues
@tronical
Copy link
Member

Duplicate of #4089

@tronical tronical marked this as a duplicate of #4089 May 20, 2024
@tronical
Copy link
Member

This sucks :( this crash is caused by WSL’s Weston system compositor crashing:(

@tronical
Copy link
Member

Best workaround within WSL is to unset WAYLAND_DISPLAY

@robmwalsh
Copy link
Author

robmwalsh commented May 20, 2024

Thanks for your quick reply!

Best workaround within WSL is to unset WAYLAND_DISPLAY

I added unset WAYLAND_DISPLAY to my .bashrc file and restarted WSL, and I'm still getting the same behaviour (including the skia error talking about wayland, which I wouldn't expect to see if wayland was disabled) - is there anything else I need to do to disable wayland and use X11?

rob@lappy:~$ echo $WAYLAND_DISPLAY

rob@lappy:~$ echo $DISPLAY
:0

This sucks :( this crash is caused by WSL’s Weston system compositor crashing:(

did you end up creating an issue in Weston's repo? I saw on another issue you were going to but I can't see any links to it or find it in Weston issues to see if there's any progress on a solution.

@robmwalsh
Copy link
Author

installing all the deps listed under https://releases.slint.dev/1.6.0/docs/slint/src/advanced/backend_linuxkms seems to have resolved the issue for me (it now displays weird after snapping, but doesn't crash), I didn't get around to actually setting the backend to linuxkvms.
afterwards I installed qt6-base-dev, so I think I'm probably now using that? there's no output at all from the slint lsp in vscode now (it doesn't even show up in the output dropdown), it might be nice to output here and there like what backend/renderer it's using etc.

image

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

No branches or pull requests

2 participants