GHOST/Wayland Support #76428
Open
opened 2020-05-05 03:20:53 +02:00 by Campbell Barton
·
39 comments
No Branch/Tag Specified
main
blender-v3.6-release
temp-sculpt-dyntopo
temp-sculpt-dyntopo-hive-alloc
asset-shelf
brush-assets-project
blender-v3.3-release
tmp-usd-python-mtl
asset-browser-frontend-split
node-group-operators
blender-v2.93-release
universal-scene-description
temp-sculpt-attr-api
blender-v3.5-release
realtime-clock
sculpt-dev
gpencil-next
bevelv2
microfacet_hair
blender-projects-basics
xr-dev
principled-v2
v3.3.7
v2.93.18
v3.5.1
v3.3.6
v2.93.17
v3.5.0
v2.93.16
v3.3.5
v3.3.4
v2.93.15
v2.93.14
v3.3.3
v2.93.13
v2.93.12
v3.4.1
v3.3.2
v3.4.0
v3.3.1
v2.93.11
v3.3.0
v3.2.2
v2.93.10
v3.2.1
v3.2.0
v2.83.20
v2.93.9
v3.1.2
v3.1.1
v3.1.0
v2.83.19
v2.93.8
v3.0.1
v2.93.7
v3.0.0
v2.93.6
v2.93.5
v2.83.18
v2.93.4
v2.93.3
v2.83.17
v2.93.2
v2.93.1
v2.83.16
v2.93.0
v2.83.15
v2.83.14
v2.83.13
v2.92.0
v2.83.12
v2.91.2
v2.83.10
v2.91.0
v2.83.9
v2.83.8
v2.83.7
v2.90.1
v2.83.6.1
v2.83.6
v2.90.0
v2.83.5
v2.83.4
v2.83.3
v2.83.2
v2.83.1
v2.83
v2.82a
v2.82
v2.81a
v2.81
v2.80
v2.80-rc3
v2.80-rc2
v2.80-rc1
v2.79b
v2.79a
v2.79
v2.79-rc2
v2.79-rc1
v2.78c
v2.78b
v2.78a
v2.78
v2.78-rc2
v2.78-rc1
v2.77a
v2.77
v2.77-rc2
v2.77-rc1
v2.76b
v2.76a
v2.76
v2.76-rc3
v2.76-rc2
v2.76-rc1
v2.75a
v2.75
v2.75-rc2
v2.75-rc1
v2.74
v2.74-rc4
v2.74-rc3
v2.74-rc2
v2.74-rc1
v2.73a
v2.73
v2.73-rc1
v2.72b
2.72b
v2.72a
v2.72
v2.72-rc1
v2.71
v2.71-rc2
v2.71-rc1
v2.70a
v2.70
v2.70-rc2
v2.70-rc
v2.69
v2.68a
v2.68
v2.67b
v2.67a
v2.67
v2.66a
v2.66
v2.65a
v2.65
v2.64a
v2.64
v2.63a
v2.63
v2.61
v2.60a
v2.60
v2.59
v2.58a
v2.58
v2.57b
v2.57a
v2.57
v2.56a
v2.56
v2.55
v2.54
v2.53
v2.52
v2.51
v2.50
v2.49b
v2.49a
v2.49
v2.48a
v2.48
v2.47
v2.46
v2.45
v2.44
v2.43
v2.42a
v2.42
v2.41
v2.40
v2.37a
v2.37
v2.36
v2.35a
v2.35
v2.34
v2.33a
v2.33
v2.32
v2.31a
v2.31
v2.30
v2.28c
v2.28a
v2.28
v2.27
v2.26
v2.25
Labels
Clear labels
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
Apply labels
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
Eevee & Viewport
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
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
Virtual Reality
Interest
Vulkan
Interest: Wayland
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
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Eevee & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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 Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
Eevee & Viewport
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
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
Virtual Reality
Interest
Vulkan
Interest: Wayland
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
Eevee & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Set Project
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
13 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#76428
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
GHOST/Wayland support has been committed to master 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
b0eff51fb7
Input Devices
98272e5bb2
(depends on Wayland v1.22 release).97f894881c
8841bd9660
GHOST_TEventKeyData.is_repeat
).30d9a6245f
8bb211a771
Display
GHOST_GetDPIHint
)2770010224
fractional-scale-v1
)cde99075e8
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
Other Bugs
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
.