Summary:
The PanelBehavior was incorrectly mapped to hasStrut resulting in too
many modes creating a strut for the panel.
CCBUG: 368499
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2788
Summary:
A fullscreen ShellClient still had a decoration which was caused by
a combination of several bugs:
* when going to/from fullscreen the decoration was not update
* noBorder did not return true for a fullscreen window
* wl_shell emits fullscreen changed and maximized changed
Comparing to X11 Client both is done. So ShellClient needs to do the
same. This ensures that the correct geometry is requested when going
to fullscreen.
BUG: 366764
Reviewers: #kwin, #plasma_on_wayland, bshah
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2751
Summary:
The call to update the layer was performed before adjusting to
fullscreen. Thus the layer didn't get updated at all as it still
evaluated to "not fullscreen".
Reviewers: #kwin, #plasma_on_wayland, bshah
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2758
Summary:
A not shown window may accept focus (e.g. when minimized). Given that
the condition was wrong and broke when making minimized windows not
shown.
This change takes the idea of not passing focus to a closing or unmapped
window directly into acceptsFocus. Which also means that this condition
now works for xdg_shell windows.
BUG: 368673
Reviewers: #kwin, #plasma_on_wayland, bshah
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2745
Summary:
The restore geometry gets initially set to 0/0xsize before the placement
is done. When going into updateClientArea and then afterwards into
AbstractClient::checkWorkspacePosition the geometry restory is used for
calculating the new position. This results in windows getting moved to
0/0 when e.g. plugging in a new screen or a panel changes, etc.
This change ensures that the restore geometry is set correctly after the
first placement.
BUG: 366696
Reviewers: #kwin, #plasma_on_wayland, bshah
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2627
Summary:
So far this connect was only in ShellClient, but it's needed for all
Toplevels. Also when a XWayland window has it's surface size changed,
the pixmap needs to be discarded. Otherwise KWin might hit an assert
in AbstractEGLTexture due to the buffer having a different size than
the texture had previously.
Test Plan:
Firefox, click download on bugreports.qt.io used to trigger
this for me. With this change no longer able to reproduce.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2583
Summary:
This allows Client to use the Wayland-specific implementation if there
is no icon geometry set through the X11 way. That way Xwayland windows
have an icon geometry even if Plasma is using Wayland and setting the
icon geometry in the Wayland way. Which is expected as Plasma is
ignorant about the windowing system a PlasmaWindow uses.
In order to move the code from ShellClient to AbstractClient
WaylandServer gained a new findAbstractClient(Surface*) method which
is just like findClient(Surface*) with the difference that it returns
an AbstractClient instead of a ShellClient*.
Test Plan:
minimized/unminimized an X client on Wayland, verified
animation is correct (though broken in general for minimize)
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2530
This fixes a regression found in TestSceneQPainter for restarting the
Compositor. The internal clients were never added to the Scene.
We cannot just call setupCompositing because there is a phase during
startup where setupCompositing already passes but the Compositor is not
yet fully initialized. Thus it could happen that it's called twice which
makes the Scene assert.
To solve that setupCompositing and finishCompositing are now overriden
in ShellClient and track whether they successfully called
setupCompositing.
Summary:
We need to call Workspace::clientHidden when minimizing. Otherwise
Workspace doesn't update the active client and the now minimized
window is still active.
BUG: 366634
Test Plan:
Test case works now and also tested in nested setup that
active window changes.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2410
Summary:
Plasmashell's desktop windows are RGBA which forces the compositor to
perform blending and render the background. That is absolutely pointless
as there is no window behind the desktop window it could blend to. All it
does is destroying KWin's more optimized code path and forcing additional
rendering which will never be visible (including shader push/pop).
With this change KWin forces desktop windows (both X11 and Wayland) to
be considered as opaque by setting the depth to 24. Thus blending is
disabled and the background is not rendered.
Test Plan:
Verified with apitrace that KWin goes in the opaque rendering
path for desktop windows.
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2382
ShellClient::doSetActive calls into focusToNull to deactivate active
windows on X11. But this should only be done when activating a
ShellClient. When deactivating a ShellClient the focusToNull can
result in an activated X-client to lose activation.
Thus this change ensures that focusToNull is only performed for a
now active ShellClient.
Reviewed-By: bshah
Summary:
With this change KWin can create window decorations for internal windows.
Thus it's also possible to move internal windows and resize them which is
especially important for the debug console.
Reviewers: #kwin, #plasma_on_wayland, sebas
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2371
Summary:
Rational: unredirect fullscreen windows is a weird beast. It's intended
to make fullscreen windows "faster" by not compositing that screen. But
that doesn't really work as KWin jumps out of that condition pretty
quickly. E.g. whenever a tooltip window is shown. KWin itself has a
better functionality by supporting to block compositing completely.
The complete code was full of hacks around it to try to ensure that
things don't break.
Overall unredirect fullscreen has always been the odd one. We had it
because a compositor needs to have it, but it never got truly integrated.
E.g. effects don't interact with it properly so that some things randomly
work, others don't. Will it trigger the screenedge, probably yes, but
will it show the highlight: properly no.
By removing the functionality we finally acknowledge that this mode is
not maintained and has not been maintained for years and that we do not
intend to support it better in future. Over the years we tried to make
it more and more hidden: it's disabled for Intel GPUs, because it used
to crash KWin. It's marked as an "expert" option, etc.
It's clearly something we tried to hide from the user that it exists.
For Wayland the whole unredirect infrastructure doesn't make sense
either. There is no such thing as "unredirecting". We might make use
of passing buffers directly to the underlying stack, but that will be
done automatically when we know it can be done, not by some magic is
this a window of specific size.
Test Plan:
Compiles, cannot really test as I am an Intel user who never
had that working.
Reviewers: #kwin, #plasma, #vdg
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2180
Summary:
The WaylandServer creates the XdgShellV5 interface and hooks it up
to create a ShellSurface whenever an xdg surface or xdg popup is created.
ShellClient gains some new ctors for the different variants and is
adjusted to delegate to xdg surface respectively.
With this change KWin mostly supports xdg-shell protocol. Still missing
is support for the "geometry" request which is rather difficult to
implement in KWin.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2108
Summary:
So far when a ShellClient got unmapped ready_for_painting was set to
false. That is the ShellClient was treated in the same way as a not
yet shown window. It was completely excluded from painting, a close
animation impossible.
This change makes use of the functionality available in
Client::hiddenInternal(). The window is considered as hidden, thus
still excluded from e.g. getting input events, but could be rendered
any time as we still have a previous window pixmap (if referenced).
This allows to have it considered in the rendering pass, but effects
still cannot make use of it as that state is not yet exposed to the
effects.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2083
Summary:
It's mapped to be on all desktops in order to properly have tooltips
show for the panel (which is on all desktops) instead of just on the
desktop it's created.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2032
Summary:
Sets notifications on all desktop and doesn't activate them.
Unfortunately doesn't work on Plasma yet. Seems the windows don't get
tagged properly.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D1930
Summary:
With the NoBorder option set the DecorationBridge won't create
decorations. Thus we get a nullptr and obviously should not call
into it. There was already a check for whether decoration is null,
so that is a rather embarrassing bug.
Test Plan: Test case added which exposes the crash
Reviewers: #plasma_on_wayland, #kwin
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D1980
Summary:
Plasma's OSD windows were stealing focus on Wayland. We can be sure
that they should not get keyboard focus, so a check to acceptsFocus
is added.
Reviewers: #plasma_on_wayland, #kwin
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D1927
Summary:
If the ShellSurface gets destroyed while a decoration repaint is pending,
it is possible that on tear down the decoration calls into
ShellClient::caption. This used to call into ShellSurfaceInterface::title
which accesses a d-ptr which is already destroyed at that point.
This change caches the caption instead of delegating to ShellSurface,
just like almost everything else caches. Thus the tear down cannot access
invalid memory.
Once we can depend on Frameworks 5.24, we should also make sure to
connect to the new Resource::unbound signal to be able to handle tear
down prior to the object being completely deleted.
Test Plan:
Unfortunately no test case as this depends on phase-of-moon
aligning of destruction of the interfaces
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D1913
Summary:
When managing a new decorated ShellClient we observed that the window
gets placed with a wrong geometry and on next damage event expands into
a strutted area.
The main reason for this behavior is that the window geometry did not
get updated when creating the decoration. With this change the geometry
gets updated, so that the placement is performed on the correct geometry.
The change itself does not yet cover all conditions. E.g. a maximized
windows which will get decorations will be incorrectly sized. This
requires further changes.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D1812
Summary:
The idea is to not send multiple resize requests to a client when we
know that we might have multiple geometry changes. E.g. when going
from maximized to restored the borders change and trigger a resize in
addition to the resize from switching to restored.
The implementation is inspired by the GeometryUpdateBlocker.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D1808
Summary:
This ensures that we don't send a size request with the borders still
added.
Test Plan:
Verified that a maximized window is properly sized and
doesn't have empty borders
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D1807
Summary:
This ensures that resizing a panel updates the client area. On X11 there
is an event when the struts change, but on Wayland the struts are implied
from window type (panel) and the panel behavior, so we need to trigger it
manually.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D1811
This is an update to c95ddb7102 and
implements the emit of maximized changed in deocration like on Client.
Overall the code looks like it should be merge better together with
Client.
Reviewed-By: kbroulik
Summary:
So far destroyWindowManagementInterface was only called when the
ShellClient got unmapped. But it's possible (although not recommended)
to just destroy the Surface without prior unmapping. In that case the
PlasmaWindow got leaked.
This change addresses this problem by always calling
destroyWindowManagementInterface from ShellClient::destroyClient.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D1762
Summary:
If a PlasmaShellSurface is a Desktop, a Panel or an OSD it implies
that the window is on all desktop. So let's set it like that.
Test Plan: Auto test added and also confirmed by manual testing
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D1747
Summary:
We don't want external processes to know anything about the lock screen
windows. Especially we don't want them to be able to request close on
them.
Thus better never show thus windows to them.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D1760
Summary:
For some windows we don't want to create a PlasmaWindow. Not all
ShellClients are something the outside world should see. This change
introduces the first restrictions:
* KWin internal windows are hidden
* transients not accepting focus are hidden
The latter case doesn't work though if the Surface is mapped prior
to creating the shell surface. In such a situation it's racy as KWin
handles the create surface request before we get the setTransient
request. This is difficult to handle as we do want to react quickly.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D1759
Summary:
The idea is to have KWin provide a virtual keyboard. To support this
KWin uses the QT_IM_MODULE qtvirtualkeyboard and makes sure that the
QPA plugin loads it.
KWin has a new class VirtualKeyboard which acts as the focus object and
the "proxy" for input methods. The QPA plugin ensures that this is the
focusObject, so that all input method related events are sent to this
class. From there it will be possible to delegate to other applications
through the Wayland interfaces.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D1638
KWayland was changed: the ShellSurfaceInterface does no longer get
destroyed when the parent SurfaceInterface gets destroyed. For the
wl_shell_surface there is no dtor request in the interface so the
resource sticks around and also the ShellClient is kept.
This change ensures that the ShellClient also gets destroyed when
the Surface is destroyed. This should fix some broken tests.
Summary:
Most likely the window is in the process of getting destroyed. In that
case the following destroy of the Surface is also going to destroy the
decoration.
This was causing an interesting effect with the QQuickRenderControl used
by Aurorae. When getting destroyed it ensures that all posted events get
processed. This includes the destroy of the Surface which entered
ShellClient::destroyClient which again destroyed the decoration. In other
words a recursive destroy which ended with wonderful crashers due to
double deletions.
If the window is not unmapped this might still cause problems: more
testing needed.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D1641
Summary:
Toplevel::window() is the actual X11 window. This makes it difficult
to use as the generic identifier for both X11 and Wayland. The Wayland
ShellClient already had a windowId() which is now added to Toplevel as
a virtual method. On X11 (Toplevel default) it returns the window().
The method window() now returns XCB_WINDOW_NONE for classes without
the Toplevel::m_client, such as ShellClient. Thus it allows to properly
check whether we are on Wayland or X11.
The code is adjusted to use windowId where a generic id is needed and
to properly check whether the window is valid before using it where
a window() is used.
This also fixes at least one additional unknown issue in
Workspace::setActiveClient
where the windowId of a Wayland client was passed to X11.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1527
Summary:
In preparation to support xdg-shell we need to make sure that ShellClient
does not assume m_shellSurface to not be null.
Everything that can be done through the surface() is resolved through
surface(). All accesses to m_shellSurface are nullptr checked.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1441
Summary:
Preparation for also supporting XdgShell. There will be different
ctors for ShellSurface and XdgShell, but most code needs to be shared.
Thus a dedicated init method is needed.
There is some restructuring in the init. All code depending on
ShellSurface being set is grouped and in an if block.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1440
Summary:
A user shouldn't be able to manually move/resize a desktop window or
a panel. So far this wasn't ensured.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1155
The damage event of the Surface does not consider the offset through
the server side decoration. Due to that we need to have a different
repaint and damage area. As Toplevel::addDamage(QRegion) is only used
in the Wayland case the repaint adjustment is removed from the generic
implementation and moved into the specific implementations. While it
wouldn't hurt to have the repaint adjustment in Toplevel, it would
trigger a repaint of an unchanged area.
For Client I'm not sure whether it's correct without considering the
clientPos. My testing shows it's working, but that might also just be
do to Xwayland using OpenGL buffers. Needs further testing.
This is a complementary commit to 4c7450a1f6:
After Workspace gets destroyed it's possible that ShellClient's are still
around. Their tear down should not crash due to calling into Workspace.
If a ShellClient supports the ServerSideDecoration interface we can
create a server decoration for it. For that updateDecoration is added
as a pure virtual method in AbstractClient and a more-or-less code copy
from Client is added to ShellClient.
Geometry handling is adjusted to consider the window decoration offsets.
We announce support for it and depending on whether we have a plugin
or not set the default mode to Server or None.
When a decoration interface is created it gets installed on the
ShellClient. But there it isn't properly used yet as we don't have
support for decorations in ShellClient yet.
This describes an additional offset for the client content. On X11
our client content position matches with the window - the window
decoration is part of the overall content coordinate system.
On Wayland the content is an own texture starting at 0/0. Thus a
mapping to texture coordinates will be required when server side
decorations are provided. The new information is used in the scene's
to adjust the rendering and generating of quads.
Replacement for calls to info->input() which is only valid for the Client
sub class, but not for ShellClient.
In ShellClient the implementation is swapped with wantsInput() and
wantsInput() has a new implementation which properly delegates to rules()
just like Client does.