GHOST/Wayland Support #76428
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
14 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#76428
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GHOST/Wayland support has been committed to
main
and is enabled for daily builds, this task is an overview of the remaining TODO's.Note that these could be expanded into their own tasks, listing here for now.
Library Linking
e58e023e1a
)Integration
GHOST_System::showMessageBox
).a38a49b073
).57a5c6c4be
).b0eff51fb7
).692de6d380
).Input Devices
wl_touch
).Note that seems only to be used by touch-screens (to my knowledge track-pads & Wacom tablets without a screen don't use this interface).
98272e5bb2
(depends on Wayland v1.22 release).97f894881c
8841bd9660
GHOST_TEventKeyData.is_repeat
).30d9a6245f
8bb211a771
Display
GHOST_GetDPIHint
)2770010224
fractional-scale-v1
)cde99075e8
Display (Cursor)
3a7c618b87
.Windowing
3071ec486b
GHOST_CreateDialogWindow
, respecting parent windows).29755e1df8
OpenGL
libOpenGL.so
orlibGL.so
, patch: D15291 (see D12034#312834).USE_EGL
ifdefs inGHOST_SystemX11.cpp
andGHOST_WindowX11.cpp
)libOpenGL.so
and EGL in OpenSubdiv and USDglLoader
Limitations
Wayland has constraints that might not be practical to work around.
Bugs
Bugs with LibDecor
Bugs with GPU Drivers
NVidia
Bugs with Other Components
Here are issues that are noticeable with Blender.
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @ideasman42
Added subscriber: @Alaska
Added subscriber: @christian.rauch
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.
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.
Added subscriber: @HooglyBoogly
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 standardmake
default settings.Am I missing something? Is another dependency required to build this?
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>
inGHOST_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:I added a commit to https://developer.blender.org/D7658 that fixes this.
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.
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 useTIMER
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?
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.
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 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.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?Added subscriber: @1ace
The HiDPI issue (last point) has been solved by D11368.
Added subscriber: @alvaroperez
Added subscriber: @vilim
Added subscriber: @SreckoMicic
Hello, when I compile with wayland the title bar does not appear. I've googled but can't find anything about it. Sorry if the problem is mine, since it also happens to me with other applications. I use gnome in arch. Regards and thanks for everything!
This is because Blender does not have client-side decorations yet. See #98612 for a discussion on this.
@ideasman42 Can you add this issue (#98612) to the list (probably under "Windowing")?
Thank you for the quick reply @christian.rauch I was looking for title bar and omitted window decoration
@ideasman42 The issue with cursor scaling in GNOME is only relevant when the cursor scale is not provided manually. GNOME does upscale window surfaces automatically (without interpolation) when no scale is provided to match the display scale. Since there is no interpolation, those surfaces would look pixelated. While this does not look nice, it would at least allow interaction with the window. Otherwise, you would need to interact with a window of 25% scale on a 400% scale display. This is not happening with cursor surfaces (they stay small), and this is what the GNOME issue that you reference is about. If the GNOME issue is fixed, the cursor would still look blurry.
Blender does set the cursor buffer scale via
update_cursor_scale
when thecursor_surface_enter
andcursor_surface_leave
events are triggered. I gave this a try on a 2x scale display and this works in principle. I noticed, however, that the scale does not get applied immediately. I have to leave and enter the window surface again to have the scale properly applied. You can also see that the scale does not get properly applied to the window surfaces when runningblender --window-maximized
on an e.g. 2x scale display. The window will be shown at 1/2 the expected size.In summary, this is an issue on the client-side. We have to make sure that Blender gathers and sets the surface scales before rendering the window or surface for the first time.
@christian.rauch Cursors using the theme seem to work OK, but I couldn't - under any conditions get the cursor to be up-scaled for Blender's custom cursors such as the knife tool in edit-mode.
The scale value is just ignored in this case.
The same is true for Xwayland.
Added.
Added subscriber: @Benni-Merz
First of all thanks for the window decoration and for everything in general, I just compiled in wayland again for that very reason. What I just discovered is that the AccentGrave (`) key doesn't work and I can't access the view navigation pie menu. It only happens to me in wayland. When inserting it manually in the keymap settings it says unsupported key. I don't know what connection it has with wayland. Putting another key if it works.
Hi @alvaroperez thanks for the feedback, could you report a bug please? The AccentGrave key is working on my system, however for X11 there are some keyboard layout spesific workarounds we'll probably need to support for wayland too.
Edit this has been resolved
b8cc181808
.Added subscriber: @smeikx
This issue was referenced by
a296b8f694
Added subscriber: @Memento
Should support for the
fractional_scale_v1
protocol be added to the TODO list?https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/143
@eszlari added, although this is mainly needed for GNOME (KDE/WLROOTS based compositors are working already without
fractional_scale_v1
). It seems GNOME merged support 2 weeks ago:https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2394 so I'll wait until this makes it into a stable release of GNOME.
@ideasman42 Yesterday, March 22 2023, GNOME 44 was released, now it is waiting for the many distros to adapt it too.
"Working" in the sense that they will render only in integer scale and then downscale and thus wasting resources.
You're right, this looking into this it wasn't working as well as I'd assumed from basic usage. Committed support for
fractional_scale_v1
cde99075e8
.This might be nice to have: https://invent.kde.org/plasma/kwin/-/wikis/Restarting
@eszlari added an entry to this task, it seems nice but as it's not yet supported by main-line MESA, I think we'd hold off with it until that's landed.
Blender 4.1 and 4.0 Crash on wlroots/Wayfire compositors on Wayland due to stricter checking of the Wayland protocol.
There's no ack_configure in the wayland log.
Command was: WAYLAND_DEBUG=1 ./blender
OS: Debian 13 Trixie
Blender release: 4.0 from Debian Distribution and 4.1 from Blender.org website.
[ 168525.793] zwp_linux_dmabuf_feedback_v1@47.done()
[ 168541.365] -> wl_surface@35.frame(new id wl_callback@48)
[ 168541.445] -> zwp_linux_dmabuf_v1@46.create_params(new id zwp_linux_buffer_params_v1@45)
[ 168541.490] -> zwp_linux_buffer_params_v1@45.add(fd 14, 0, 0, 10240, 16777216, 8)
[ 168541.504] -> zwp_linux_buffer_params_v1@45.add(fd 15, 1, 16384000, 1280, 16777216, 8)
[ 168541.513] -> zwp_linux_buffer_params_v1@45.add(fd 16, 2, 16449536, 64, 16777216, 8)
[ 168541.520] -> zwp_linux_buffer_params_v1@45.create_immed(new id wl_buffer@49, 2560, 1600, 808669784, 0)
[ 168541.526] -> zwp_linux_buffer_params_v1@45.destroy()
[ 168541.531] -> wl_surface@35.attach(wl_buffer@49, 0, 0)
[ 168541.536] -> wl_surface@35.damage(0, 0, 2147483647, 2147483647)
[ 168541.541] -> wl_surface@35.commit()
[ 168541.637] -> wl_surface@35.commit()
[ 168541.648] -> wl_display@1.sync(new id wl_callback@50)
[ 168541.655] xdg_toplevel@42.configure(0, 0, array[0])
[ 168541.670] zxdg_toplevel_decoration_v1@43.configure(2)
[ 168541.674] xdg_surface@41.configure(20342)
[ 168542.375] wl_display@1.delete_id(45)
[ 168542.410] wl_display@1.error(xdg_surface@41, 3, "xdg_surface has never been configured")
GHOST/Wayland: xdg_surface@41: error 3: xdg_surface has never been configured
./blender() [0xf00e20]
@James-Carthew in the future, best open a bug report for these issues.
While I didn't get a crash, wayland was hanging on startup for me, committed fix
3a5389d5ab
.Since Blender 4.3 will provide a Vulkan backend: I wonder if Vulkan too requires an extension for this like GL or if this could be implemented without it?!