Otherwise we get the following error message:
Property "margins" with type "QMargins", which is not a value type
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
This code was designed to make sure we didn't commit new buffers whilst
we were waiting for a configure. The way this worked failed in 6 after
kwin does not reply to desired_size changes immediately.
It is uneeded after kwin commit "wayland: Avoid rearranging layer
surfaces when wl_surface size changes" which means if we do submit
frames between size change requests, they'll be ignored. Meaning the
client will eventually get a configure event at the right size.
Depending on code path taken, geometry.size() == m_pendingSize can
produce incorrect results.
If a configure event is applied, it's fine.
If the window is resized by user, m_pendingSize will have outdated value,
and setWindowGeometry() can ignore future size updates that are valid.
In hindsight, we need special hooks in the QWaylandWindow to request and
apply new geometry. Rather than have one function that deals with all cases.
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.
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.
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
This reverts commit be63783888.
It broke keyboard input in sddm greeter. While defaulting to a non-spec
value is not great, it's also not that critical. It might be worth
considering synchronizing Qt::WindowDoesNotAcceptFocus with the keyboard
interactivity flag, but the tricky part is that the keyboard interactivty
is not just a boolean.
BUG: 477251
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.
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>
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.