Native wayland support with newest electron
Problem
Native wayland support would be great to run vs code without XWayland as described in https://github.com/microsoft/vscode/issues/77752. Recently electron merged the chrome version with the ozone backend needed: https://github.com/electron/electron/pull/26022 This would allow for: - Kinetic scrolling (maybe this is more elegantly implemented on the elctron side) - Better touch support (touch scrolling) - better dpi scaling
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Enable Native Wayland Support in Electron for VS Code
The current implementation of VS Code on Linux relies on XWayland for rendering, which limits performance and features such as kinetic scrolling and better DPI scaling. The recent Electron merge with the Ozone backend allows for native Wayland support, which can enhance the user experience significantly by utilizing the native capabilities of Wayland.
Awaiting Verification
Be the first to verify this fix
- 1
Update Electron to the Latest Version
Ensure that you are using the latest version of Electron that includes the Ozone backend for Wayland support. This is crucial for enabling native Wayland features.
bashnpm install electron@latest - 2
Modify VS Code Launch Configuration
Update the launch configuration of VS Code to enable Wayland support by setting the appropriate environment variable. This will direct Electron to use Wayland instead of XWayland.
bashexport ELECTRON_ENABLE_OZONE=true && code - 3
Test Kinetic Scrolling and Touch Support
Launch VS Code and test the kinetic scrolling and touch support features to ensure they are functioning correctly under Wayland. This can be done by scrolling through documents or using touch gestures.
- 4
Check DPI Scaling
Verify that the DPI scaling is working correctly by adjusting your display settings and observing if VS Code scales appropriately without artifacts or blurriness.
- 5
Report Issues
If any issues are encountered during testing, report them to the VS Code GitHub repository to help improve the Wayland support further.
Validation
Confirm that VS Code runs without XWayland by checking the output of 'echo $WAYLAND_DISPLAY'. Additionally, verify that kinetic scrolling and touch support are operational by testing them in the editor.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep