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.
The new API is temporary. It's needed to help us with porting plasma to
the layer shell protocol until Qt 6.6 is released, which includes
QWaylandShellSurface::attachPopup().
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.
If the Window::setDesiredOutput API was not called for the QWindow, use
QWindow::screen(). This allows assigning QWindows to specific screens using
the plain Qt API.
Passing nullptr to Window::setDesiredOutput explicitly results in nil as
desired output for the layer, which lets the compositor select a screen.
QWaylandLayerSurface pulled data from the Window on startup. The Window
pushed data into the QWaylandLayerSurface on changes. Having two
patterns is a sign of something being off.
This moves everything to a single design, pulling from the public
interface. This allows us to drop a code path that meddles with
QWaylandWindow internals.
If the property is set, the compositor will try to put the window on the
given output. If not set, the compositer will decide where to put the
window (usually the active output). The motivation for this change is the
ability for KRunner to always appear on the active output.
When a compositor has no outputs listed Qt creates a dummy placeholder
QScreen object that does not represent a wl_output.
This should still be fixed in the clients to not create a view, it's
wasteful and probably will still have plenty of other bugs, hence the
giant warning, but it's still worth guarding.
CCBUG: 439096
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
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
The warning itself:
> /home/tsdgeos/devel/kde/layer-shell-qt/src/qwaylandlayershell_p.h:23:24: note: did you mean class here?
> QWaylandLayerShell(struct QtWayland::zwlr_layer_shell_v1 *shell);