Incorrect position of fenestration under Wayland.
-
Hello everyone!
I have just compiled a program under Qt 6.6.3 and I notice that all the QQuickWidget windows I create systematically appear in the middle of the screen under Wayland.
After some research, this seems to be a Wayland limitation.
Is there anything planned to support this feature properly, or is it already possible to work around this problem?
I realize that the program displays normally under Ubuntu 24.10 Wayland but incorrectly under Raspierry OS.Many thanks,
Franck
PS: Everything works normally under xcb...
-
Yes it is a Wayland limitation. The core protocol does not allow application surfaces to know where they are positioned or move / resize themselves because "security". Other extension protocols (e.g.
xdg-shell
, and there are more) open up some limited capabilities for windows to affect their position, and the Qt Wayland client implements the client-side of some of some of them, but it all depends on if the particular compositor running chooses to implement them and how. This is different to the situation under X11, where there is a single common protocol to communicate with the Window Manager about such things.So it depends on the compositor running on your device.... It might have a special Wayland extension protocol of it own that it supports for this, or maybe it implements one of the common ones but in a broken fashion, or maybe there is a side D-Bus interface or a special IPC protocol (looking at you, Sway!).
-
Hello everyone!
I have just compiled a program under Qt 6.6.3 and I notice that all the QQuickWidget windows I create systematically appear in the middle of the screen under Wayland.
After some research, this seems to be a Wayland limitation.
Is there anything planned to support this feature properly, or is it already possible to work around this problem?
I realize that the program displays normally under Ubuntu 24.10 Wayland but incorrectly under Raspierry OS.Many thanks,
Franck
PS: Everything works normally under xcb...
This post is deleted! -
Yes it is a Wayland limitation. The core protocol does not allow application surfaces to know where they are positioned or move / resize themselves because "security". Other extension protocols (e.g.
xdg-shell
, and there are more) open up some limited capabilities for windows to affect their position, and the Qt Wayland client implements the client-side of some of some of them, but it all depends on if the particular compositor running chooses to implement them and how. This is different to the situation under X11, where there is a single common protocol to communicate with the Window Manager about such things.So it depends on the compositor running on your device.... It might have a special Wayland extension protocol of it own that it supports for this, or maybe it implements one of the common ones but in a broken fashion, or maybe there is a side D-Bus interface or a special IPC protocol (looking at you, Sway!).
I was facing the same problem with Debian/Gnome/Wayland.
Because there are several threads with pretty useless information, here the solutions:Setting the variable QT_QPA_PLATFORM=xcb.
I assume, that mutter treats the application as a X11 application and uses Xwayland.Or setting the variable QT_WAYLAND_SHELL_INTEGRATION=ivi-shell, like lgKh suggested.
https://github.com/qt/qtwayland/tree/dev
https://wayland.pages.freedesktop.org/weston/toc/ivi-shell.htmlLooks good to me.
But maybe someone has an even better solution...