Repository navigation
Description
Currently, RStudio electron works without workarounds on Wayland; however, it doesn't support HiDPI monitors and renders them blurry. From my understanding, electron apps may support "--enable-features=UseOzonePlatform—-ozone-platform=wayland" flags to render them natively on Wayland and support HiDPI monitors. I believe it is not currently implemented, but it would be fantastic going forward.
I tried this on Ubuntu 22.04 + swaywm, using the electron build of rstudio (rstudio-2022.07.2+576).
> ./rstudio --enable-features=UseOzonePlatform --ozone-platform=wayland
And got an error message.
[1197763:0916/102513.715337:ERROR:gl_factory.cc(128)] Requested GL implementation (gl=desktop-gl,angle=none) not found in allowed implementations: [(gl=egl-gles2,angle=none),(gl=egl-angle,angle=swiftshader)].
[1197763:0916/102513.719958:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
Edit: June 14, 2024
Update with RStudio version: 2024.04.2+764
In my previous solutions, I disabled the GPU to run RStudio without errors. I found a workaround for the gles error, and enabled hardware acceleration. If you want to use hardware acceleration on Wayland, you need to set --gl=angle; the other implementations of gl fall back to software rendering. Currently, there is no need to enable the Ozone Platform feature anymore, I believe it is enabled by default. And instead of setting the platform directly to Wayland, you can add --ozone-platform-hint=auto. If you have vaapi installed correctly, you can also enable that with --enable-features=VaapiVideoEncoder. Currently, I have the following line as a workaround, and it works without errors.
rstudio --ozone-platform=wayland --use-gl=angle --enable-features=VaapiVideoEncoder
Checking the GPU diagnostics, I get:
Graphics Feature Status
=======================
* Canvas: Hardware accelerated
* Canvas out-of-process rasterization: Disabled
* Direct Rendering Display Compositor: Disabled
* Compositing: Hardware accelerated
* Multiple Raster Threads: Enabled
* OpenGL: Enabled
* Rasterization: Hardware accelerated
* Raw Draw: Disabled
* Skia Graphite: Disabled
* Video Decode: Hardware accelerated
* Video Encode: Hardware accelerated
* Vulkan: Disabled
* WebGL: Hardware accelerated
* WebGL2: Hardware accelerated
* WebGPU: Disabled
Addition 5 mins later: Just realized in Chrome 123 the flag --use-gl is replaced with --gl. Once RStudio starts using corresponding Chrome version, the flag will need to be updated.
Activity
ronblum commentedon Sep 16, 2022
@evolozzy Thank you for raising this and the info!
ozankiratli commentedon Sep 16, 2022
@ronblum
export QT_QPA_PLATFORM=xcb && rstudio. For electron version I don't need to use this workaround.As a note, this has been a common problem when switching from X11 to wayland for many apps. From the previous discussions here, I believe the development for wayland compositors was planned under electron version, that's why I wanted to raise this issue.
ronblum commentedon Sep 16, 2022
@evolozzy Thank you for the reminder regarding the Qt version and Wayland—especially considering that I filed the "support Wayland" issue #5333! 😄
ozankiratli commentedon Dec 24, 2022
Update
rstudio-2022.12.0+353:If I run
Sys.getenv()during this session I can see thatGDK_BACKENDis set towayland.I believe this can be implemented natively, even though I don't know how.
rstudiowithout disabling gpu and without ozone platform flags, I get several errors on the console, however, it opens and functions without any problems. If I runSys.getenv()during this session I can see thatGDK_BACKENDis set tox11.LIBVA_DRIVER_NAMEmanually and, the first line of error disappears. For the rest of the errors I need to disable gpu. The code below successfully opens rstudio without any errors. If I runSys.getenv()during this session I can see thatGDK_BACKENDis set tox11.I need to set
LIBVA_DRIVER_NAMEto successfully run rstudio withx11backend (See 4.), but I don't need to set it to run withwaylandbackend. (See 1.)I hope this helps.
arcruz0 commentedon Jan 29, 2023
Thanks, @evolozzy! Results are night and day for me (Ozone on the left):
After running
rstudio --disable-gpu --enable-features=UseOzonePlatform --ozone-platform=wayland, two things do not work for me on Ubuntu 22.04 (LTS):The cursor is white, while my system cursor is black. I found a fix in a Reddit comment:
mkdir ~/.icons && cp -r /usr/share/icons/Yaru ~/.icons/defaultRStudio loses its titlebar. I tried adding the

WaylandWindowDecorationsfeature:rstudio --disable-gpu --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=waylandWhile this adds a titlebar, the titlebar does not follow the system's. See below compared to gedit and Libreoffice:
I also do not know how to set RStudio to always open with these changes. I can modify its desktop entry and make a Bash alias, but new windows called from within RStudio will not open with the Ozone layer (e.g., opening projects from the top-right menu opens a new window without Wayland support).
Hopefully this testing is useful to someone! Thanks everyone.
github-actions commentedon Sep 1, 2023
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.
ozankiratli commentedon Sep 1, 2023
I believe this is still an issue on RStudio 2023.06.2 Build 561.
Without the workaround, RStudio opens as an xwayland application.
GerryT11 commentedon Mar 7, 2024
As it seems the current RStudio 2023.12.1 Build 402 on Ubuntu/.deb still does not support/enable Wayland out of the box. I noticed that RStudio is not running on Wayland, but rather XWayland. Are there any blocker issues to enable Wayland by default?
System: Ubuntu 23.04 running with Wayland.
RStudio 2023.12.1+402 "Ocean Storm" Release (4da5832, 2024-01-29) for Ubuntu Jammy
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2023.12.1+402 Chrome/116.0.5845.190 Electron/26.2.4 Safari/537.36
kevinushey commentedon Mar 7, 2024
Presumedly this will happen in RStudio once Wayland is supported by default out-of-the-box in Electron? Until then, my guess is the various tricks in https://wiki.archlinux.org/title/wayland#Electron need to be tried?
github-actions commentedon Apr 9, 2025
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.
github-actions commentedon Apr 23, 2025
This issue has been automatically closed due to inactivity.