Commit Graph

12 Commits

Author SHA1 Message Date
Wang Zichong 1573a89aac Skip empty parts for stringToEnum template
metaEnum.keyToValue("") will results all flags get set, thus creating a
enum with empty (0) flags become impossible. This patch fixes that.
2023-09-26 17:25:20 +08:00
Aleix Pol Gonzalez 143fd1755a Expose the Window interface to QML
If we are designing our UI's windows from QML, it makes sense that we
might want to configure how they're placed from the same place.

Everything was already in place but for a few technical bits which this
change adds.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2023-07-13 11:23:01 +02:00
shooting Star 87753746b9 chore: add missing override in example 2023-04-24 23:23:09 +03:00
Vlad Zahorodnii 2985398375 Port to QWaylandWindow::setShellIntegration()
With QWaylandWindow::setShellIntegration(), it's possible to use
xdg-shell and layer-shell protocols in the same process. It's important
for plasmashell, where we want to use the layer shell protocol for
special surfaces such as the desktop background, and the xdg shell
protocol for dialogs.

In order to make a QWindow use the layer shell protocol, you need to
call LayerShellQt::Window::get() before the window is mapped.
2023-04-22 12:11:01 +03:00
David Edmundson cd409ed50e Add width and height to test
This is needed if we are not anchoring to the full screen
2021-04-15 09:59:18 +01:00
David Edmundson 2b1219cfdd Ensure we can set per-window properties before the intial commit
In the current implementation we cannot use a LayerShellQt before the
shell surface is created.

At the moment a shell surface is created, the constructor is run and
then QtWayland commits the current state. This means the compositor
configures the window before a client has any chance to set anchors or
margins.

This works whilst we're just being a simple fullscreen window, but won't
scale for plasmashell in the future.

This patch makes LayerShellQt::Window always creatable, and we can set
and cache properties before the platform window is created, just like
one can on QWindow and XDGShell properties.

This also makes it less potentially crashy as ::get always returns a
valid result, and
sets up the public API to be QML-able as an attached property in future.

Co-authored on Aleix's patch for the unit test
2021-04-15 09:58:57 +01:00
David Edmundson 29d0078909 Ensure we can set per-window properties before the intial commit
In the current implementation we cannot use a LayerShellQt before the
shell surface is created.

At the moment a shell surface is created, the constructor is run and
then QtWayland commits the current state. This means the compositor
configures the window before a client has any chance to set anchors or
margins.

This works whilst we're just being a simple fullscreen window, but won't
scale for plasmashell in the future.

This patch makes LayerShellQt::Window always creatable, and we can set
and cache properties before the platform window is created, just like
one can on QWindow and XDGShell properties.

This also makes it less potentially crashy as ::get always returns a
valid result, and
sets up the public API to be QML-able as an attached property in future.

Co-authored on Aleix's patch for the unit test
2021-04-14 23:49:30 +01:00
Aleix Pol efa32dfbe3 Use unversioned Qt targets 2021-04-06 13:54:43 +02:00
Aleix Pol 86efa88e22 More SPDX 2021-04-06 13:47:24 +02:00
Aleix Pol cd9b1a6fd3 Address code formatting 2021-04-06 13:39:27 +02:00
Aleix Pol 41704f8d15 Fixes 2021-04-01 02:45:31 +02:00
Aleix Pol ea3e4b3139 Initial commit 2021-04-01 02:28:01 +02:00