Commit Graph

15 Commits

Author SHA1 Message Date
David Edmundson
17be1332cf Port to asynchronous roundtrip
When a resize is driven client side we wait for the compositor to have a
chance to reconfigure us before submitting the next frame.

Using a blocking round trip caused an issue. Instead block isExposed and
trigger an expose event whilst a sync is in progress.
2024-02-16 11:31:49 +00:00
David Edmundson
697c747c58 Synchronise client driven resizing
Qt's resizing is inherently synchronous. When an application calls
QWindow::setGeometry with a new size, we expect it to make that resize.
An expose event of the requested size will be generated.

Wayland is by default async, a client requests a size, and then will be
configured to that size, or potentially another size.

The simplest way to map the two APIs is to roundtrip when the client
wants to resize. This way we can guarantee that a call to
`setGeometry();  update()` will have the server configured size before
the paint.

In practice it's still not perfect due to other issues, but at least
will sort itself out within a frame.
2024-02-14 12:08:23 +00:00
Aleix Pol Gonzalez
5cf8ad46b1 Align layershell-qt with the rest of KDE frameworks at a licence level
Makes it possible to use in certain places that otherwise it couldn't
be.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-02-12 14:15:06 +00:00
Marco Martin
ad5246f0d0 Add a new setExclusiveEdge call in the protocol
This can be used to disambiguate the exclusive edge when the anchors are
on a corner (so there  would be 2 candidates)

it's quite quick and dirty mostly to understand if we do want to push
for something along the lines
2024-01-26 11:38:44 +00:00
Laurent Montel
8ae3b0aef8 Qt6 check code as apps is qt6 only. 2023-12-15 21:44:24 +01:00
David Edmundson
de9fdb3fb7 Support XDG activation
QWaylandLayerShellIntegration has virtual hooks for Xdg Activation.

This is important to hook up in layer shell because activation using
requestActivate in Qt will go through this path. It also means we have
support for us to drop the implementation in KWindowSystem in favour of
calling into Qt.
2023-11-06 12:41:20 +00:00
Vlad Zahorodnii
5e88f449b0 Introduce Window::closeOnDismissed() flag
This can be used to control the sending of QEvent::Close event.
2023-05-16 17:58:48 +03:00
David Edmundson
1358743441 Call LayerShell::set_size when the window geometry changes
Without this when krunner expands, the frame after kwin will resize it
back to the last size the layer shell requested to be resized to.

To detect when we should not send an explicit size on window resize
events we check the anchors; if we're constrained on opposing edges we
want the compositor alone to set the size.
2023-05-01 14:38:36 +00:00
Vlad Zahorodnii
511b92f4ab Port to QWaylandShellSurface::attachPopup() 2023-04-22 12:11:04 +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
Laurent Montel
80f6a629bb GIT_SILENT: add missing override 2021-10-27 13:43:28 +02:00
Vlad Zahorodnii
11a811061f Introduce KeyboardInteractivity enum 2021-04-20 15:27:43 +03:00
Vlad Zahorodnii
b4c62f7926 Expose set_layer
The set_layer request allows to move a surface to another layer after
creating it.
2021-04-09 12:49:49 +00:00
Aleix Pol
cd9b1a6fd3 Address code formatting 2021-04-06 13:39:27 +02:00
Aleix Pol
ea3e4b3139 Initial commit 2021-04-01 02:28:01 +02:00