Page MenuHome

GHOST/Wayland Support
Confirmed, NormalPublicTO DO

Description

GHOST/Wayland support has been committed to master, this task is an overview of the remaining TODO's.

Note that these could be expanded into their own tasks, listing here for now.

Input Devices

Windowing

  • Support dialog windows (so they're always in-front GHOST_CreateDialogWindow, respecting parent windows).

Display

  • Support for DPI detection (GHOST_GetDPIHint)

Revisions and Commits

Event Timeline

Campbell Barton (campbellbarton) changed the subtype of this task from "Report" to "To Do".Tue, May 5, 3:56 AM

Regarding the modal/dialog windows: What is the semantic difference between being a child window and a dialog window?

When parentWindow is set, then this is also set as the parent window on wayland and the child window will always be on top of the parent window. This is for example used for the file "Open..." window, which will always stay on top of the main window.

If the window parent stays under the child window (file open dialog), this can be considered done.

Currently I don't have a very good setup for testing wayland, regular Blender doesn't run, only the animation player.

Currently I don't have a very good setup for testing wayland, regular Blender doesn't run, only the animation player.

What is your current setup? I am mostly testing with Ubuntu 20.04 on GNOME Shell with Wayland. This option should be available from the gdm login screen.

Alternatively, having a wayland option as an experimental built at https://builder.blender.org/download/branches/ would increase the testing variation a lot.

I tried testing this on my Intel GPU (running wayland) Fedora 32 laptop and I ran into compile errors when I turned WITH_GHOST_WAYLAND on. Otherwise this is standard make default settings.

--   Package 'wayland-client', required by 'virtual:world', not found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:467 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:647 (_pkg_check_modules_internal)
  build_files/cmake/platform/platform_unix.cmake:510 (pkg_check_modules)
  CMakeLists.txt:839 (include)

Am I missing something? Is another dependency required to build this?

Package libwayland-client-1.18.0-1.fc32.x86_64 is already installed.

I tried testing this on my Intel GPU (running wayland) Fedora 32 laptop and I ran into compile errors when I turned WITH_GHOST_WAYLAND on. Otherwise this is standard make default settings.

--   Package 'wayland-client', required by 'virtual:world', not found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:467 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:647 (_pkg_check_modules_internal)
  build_files/cmake/platform/platform_unix.cmake:510 (pkg_check_modules)
  CMakeLists.txt:839 (include)

Am I missing something? Is another dependency required to build this?

Package libwayland-client-1.18.0-1.fc32.x86_64 is already installed.

You also have to install the development files (headers, etc.). In your case that should be sudo dnf install wayland-devel libxkbcommon-devel wayland-protocols-devel additional to the regular Blender development libraries.

Alright, those dependencies worked, although I had to add #include <stdexcept> in GHOST_SystemWayland.cpp to get it to compile on my machine.

I can look into it more with a debug build later, but with WITH_GHOST_WAYLAND I think I'm getting a hang on startup:

[hans@hans-fedora build_linux]$ ./bin/blender
Read prefs: /home/hans/.config/blender/2.90/config/userpref.blend
EGL Version 1.5
[destroyed object]: error 7: failed to import supplied dmabufs: Unsupported buffer format 808669784
EGL Version 1.5
found bundled python: /home/hans/Blender-Git/build_linux/bin/2.90/python

Alright, those dependencies worked, although I had to add #include <stdexcept> in GHOST_SystemWayland.cpp to get it to compile on my machine.

I added a commit to https://developer.blender.org/D7658 that fixes this.

I can look into it more with a debug build later, but with WITH_GHOST_WAYLAND I think I'm getting a hang on startup:

[hans@hans-fedora build_linux]$ ./bin/blender
Read prefs: /home/hans/.config/blender/2.90/config/userpref.blend
EGL Version 1.5
[destroyed object]: error 7: failed to import supplied dmabufs: Unsupported buffer format 808669784
EGL Version 1.5
found bundled python: /home/hans/Blender-Git/build_linux/bin/2.90/python

This is a known issue with the Intel driver. See: https://developer.blender.org/D6567#182240. In short: You have to call blender with MESA_LOADER_DRIVER_OVERRIDE=i965 blender.

That worked, thanks. I'm quite impressed by how much smoother this is for some things like moving the separation between areas.

How much feedback are you looking for at this point? I don't want to tell you stuff you already know.

How much feedback are you looking for at this point? I don't want to tell you stuff you already know.

Basically everything that improves the backend and brings it closer to have it activated as the default choice when running upstream Blender on Wayland.

You can report any issues that you encounter, especially those things that are expected to work but don't in your compositor and distribution configuration. Even if it is a known but unreported issue, it would help to keep track of them as a dedicated issue that I can refer to.

On top of this, users can request any feature that they would like to see for the Wayland frontend. HiDPI and window decoration support is already on my TODO list.

Besides window decoration and HiDPI, the main thing I noticed was that the panel animations were very slow when running with Wayland.
For example, when dragging a panel and letting it animate back to its original position, the animation seemed to only have a couple frames total.
Maybe GHOST_kEventTimer events aren't added properly? The panels use TIMER events to update.

As far as feature requests go, I've always wondered how possible it would be to support trackpad gestures on Linux. Maybe Wayland support helps with that?

Besides window decoration and HiDPI, the main thing I noticed was that the panel animations were very slow when running with Wayland.
For example, when dragging a panel and letting it animate back to its original position, the animation seemed to only have a couple frames total.
Maybe GHOST_kEventTimer events aren't added properly? The panels use TIMER events to update.

Can you open a dedicated "Task" with a list to reproduce this? I have a hunch of what is missing for that. At the moment, the process loop blocks until a new event has been received from the compositor.

As far as feature requests go, I've always wondered how possible it would be to support trackpad gestures on Linux. Maybe Wayland support helps with that?

I don't know how this can be implemented. There is an additional "touch" input, but I think this actually refers to touch screens. I also thought that touch gestures have to be supported by the toolkit, e.g. GTK/Qt or Blender's internal toolkit.

I'm not sure if this is a Blender or Gnome problem, but here's something else @Christian Rauch (christian.rauch) In case you thought it was worth looking into.

In fullscreen mode (Window > Toggle Window Fullscreen) Blender doesn't take up the entire screen. This doesn't happen with X11.

In fullscreen mode (Window > Toggle Window Fullscreen) Blender doesn't take up the entire screen. This doesn't happen with X11.

I don't see this issue with GNOME or Weston on Ubuntu 20.04. Does directly starting in fullscreen mode (blender -W) also produce this issue?