Commit graph

93 commits

Author SHA1 Message Date
Martin Gräßlin
ecce036979 [wayland] Introduce a memeber variable for checking whether ShellClient is internal
ASAN complained about heap-use-after-freeze in copyToDeleted due to call
into isInternal().
2015-12-18 17:26:21 +01:00
Martin Gräßlin
8604e03106 [wayland] Properly implement userCanSetNoBorder in ShellClient
Only for server side decorations it's possible to set no border and
in that case it should have same checks as Client.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
5e96f65224 Add window decoration to ShellClient
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.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
5cef26d275 [wayland] Add support for ServerSideDecorationManager
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.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
3de3a959c6 Move implementation of clientPos() to AbstractClient
The Client's variant works for both Client and ShellClient.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
827486ff36 Introduce a Toplevel::clientContentPos() -> QPoint
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.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
5f90fa5cfd Introduce pure virtual, protectd AbstractClient::acceptsFocus -> bool
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.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
a4c347fc7a [wayland] Translate inputTransformation matrix by borderLeft/Top
With decorations the ShellClient needs to have another input offset
by borderTop and borderLeft.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
681113e4a6 [wayland] Reset internalWindow if the QWindow gets destroyed
Prevents use after free usages.

Reviewed-By: Bhushan Shah
2015-11-18 15:43:54 +01:00
Martin Gräßlin
3f4e733468 [wayland] Ensure we can tear down ShellClient after Workspace is destroyed
This can happen during tear down of the internal shell clients.
2015-11-10 14:27:03 +01:00
Bhushan Shah
4323102ec7 Fix build 2015-11-06 21:01:39 +05:30
Bhushan Shah
3a1371989e [wayland] Introduce ShellClient::isLockScreen method
This allows to check if specific ShellClient is from LockScreen or not,
as well as this adds method to verify if ShellClient is from input
method like maliit.

Now that KWin knows about which window is from Screenlocker it can apply
various security restrictions like no other window then greeter is on
top of it.

Reviewed-By: Martin Gräßlin
2015-11-06 19:44:13 +05:30
Marco Martin
1f9fa64a49 preliminar support for task geometries in wayland
make the minimize effect work by reading taskGeometry
from plasmawindowmanagement and returning as iconGeometry()
there is one task geometry per panel window, iconGeometry()
will return the geometry associated to the nearest panel
from the window

REVIEW:125873
2015-11-05 11:36:40 +01:00
Martin Gräßlin
c35c464b1d [wayland] Add support for move/resize triggered on ShellSurface
Welcome to a mostly usable Wayland world!
2015-10-29 10:41:25 +01:00
Marco Martin
8fe8bf59a5 make most windows minimizable
allow to minimize some kind of windows, all those that don't
have a plasmashell surface and those that have and have Normal
as role (to be sure to not minimize panel, desktop, etc)

REVIEW:125842
2015-10-29 10:32:14 +01:00
Martin Gräßlin
89a4df651d [wayland] Sync resizes
Similar to X11 world: we send a sync request on each size change and
block till we get the next damage with the proper size.

Testing seems to show a very smooth resize experience. We automatically
sync to the resize speed of the client.

Maybe we need a timeout in case the client isn't able to resize to the
requested size.
2015-10-28 11:16:48 +01:00
Martin Gräßlin
8f2b01b549 [wayland] Fix quick tiling auto test
Don't emit both geometryShapeChanged and geometryChanged: the one
is set up to call the other.

Also adjust tests because maximize changes triggers too many geometry
changed signals.
2015-10-26 13:50:08 +01:00
Martin Gräßlin
4e7521fe64 Allow moving of Wayland windows
So far only moving through useractions menu is possible and only through
cursor control (mouse events are lost).

A basic first autotest is added to validate the moving of Windows.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
3fa9013691 [wayland] Don't call into Workspace from ShellClient during teardown
During tearing down the WaylandServer it's possible that ShellClients
are getting unmapped. For them make sure that they don't call into
the no longer existing Workspace.
2015-10-22 11:42:52 +02:00
Martin Gräßlin
8cdfb0e88f Merge back implementation of Client::move and ShellClient::move
Implementation goes to AbstractClient, method is no longer virtual.
The X11 specific code is moved to a new virtual protected doMove
method implemented in Client.
2015-10-15 15:29:09 +02:00
Martin Gräßlin
a2b83bffc5 [wayland] Update geometry in ShellClient::setGeometry directly if size didn't change
If the size is the same it's basically just a window movement. That's
nothing we need to roundtrip to the client, but can adjust the geometry
change directly.

The quick tiling test is adjusted to test this together with
sendToScreen. Each window is also sent to the next screen to verify the
state doesn't change and geometry is updated.

Note: the flag for quick maximization seems to get lost in this setup.
2015-10-14 16:38:17 +02:00
Martin Gräßlin
6049b9ff3c Move implementation of sendToScreen from Client to AbstractClient
Method is no longer virtual, stub in ShellClient removed.
2015-10-14 16:38:17 +02:00
Martin Gräßlin
86448c66dd [wayland] Use first valid geometry of ShellClient as restore geometry
This is needed to properly restore to a valid geometry after quick
maximizing. Note: this is not yet perfect, actually it should be done
after initial placing, which means we do need a manage method like
Client.

The autotest for quick tiling is extended to cover maximize changes
and cover this case.
2015-10-14 12:11:56 +02:00
Martin Gräßlin
41af9c400c [wayland] Allow resizing on ShellClients
Needed to be able to put clients into quick tile mode.
2015-10-14 08:36:29 +02:00
Martin Gräßlin
9f91431e8c Move quick tiling from Client to AbstractClient
In order to make it possible to quick tile also ShellClients.
2015-10-14 08:36:29 +02:00
Martin Gräßlin
ec6c778df7 Move implementation of checkWorkspacePosition to AbstractClient
No longer a virtual method, the implementation of Client is turned into
AbstractClient. The stub removed from ShellClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin
696cdb9e39 Add setGeometry to AbstractClient as pure virtual method
In Client existing method is marked as override, in ShellClient a new
override is added which delegates to requestGeometry. Existing method
is renamed to doSetGeometry and all internal calls delegat to it.
Needs better merging with the implementation of Client.
2015-10-14 08:36:29 +02:00
Martin Gräßlin
eacaf25acf Improve sharing of maximize between Client and ShellClient
The changeMaximize method is added as a pure virtual protected method
to AbstractClient. This replaces the previous pure virtual maximize
method. Which is now directly implemented in AbstractClient (reusing
the implementation previously in Client).
2015-10-14 08:36:29 +02:00
Martin Gräßlin
29b2082daa [wayland] Honor ShellSurfaceInterface::acceptsKeyboardFocus in ::wantsInput
If the surface indicates that it doesn't want keyboard focus we shouldn't
give it keyboard focus.

This was a problem with Kate's autocompletion tool tip windows.

REVIEW: 125553
2015-10-08 12:51:49 +02:00
Martin Gräßlin
3cb8438399 [wayland] Keep transient state directly in ShellClient
So far we delegated to ShellSurfaceInterface, but it's possible that
we call into isTransient when the ShellSurfaceInterface is already
destroyed.
2015-10-08 11:04:06 +02:00
Martin Gräßlin
b35c3e8501 [wayland] Keep fullscreen state directly in ShellClient
So far we delegated to ShellSurfaceInterface, but it's possible that
we call into isFullscreen when the ShellSurfaceInterface is already
destroyed.

Note: the functionality needs to be slightly reworked. The fullscreen
state should change once we get a buffer for fullscreen, not when the
client requests it. This is a general pattern which is wrong also for
maximized, etc.
2015-10-08 10:05:40 +02:00
Marco Martin
0bf64446cd remove unwanted debug and change in 9912d84 2015-10-01 16:03:02 +02:00
Martin Gräßlin
242e2806ca [wayland] Properly support add/remove transient on ShellClient
Whenever we set a transient we must register it with the parent and
remove it again. Also if a parent gets destroyed we must inform the
transients.

This fixes a crash in Deleted::copyToDeleted when connecting the main
clients. The crash condition was hit if the parent got destroyed
before the transient.

Reviewed-By: Marco Martin
2015-10-01 14:12:46 +02:00
Marco Martin
9912d84f74 supports kwayland skipsTaskbar
read the skipTaskbar property from plasmashellsurface
and set it accordingly in the corresponding PlasmaWindow
for the model
REVIEW:125454
2015-09-30 16:55:32 +02:00
Martin Gräßlin
9f054bd8ad Fix connects with QPointer
We need to call data() on the QPointer in a connect, otherwise
compilation fails on some compilers.
2015-09-28 14:09:10 +02:00
Martin Gräßlin
d25c465211 Move layer functionality to AbstractClient
Merges together the code from ShellClient and Client and removes the
starting differences. Long term it's better to have only one
implementation to prevent diversions in the implementation.

As it doesn't match exactly protected virtual methods are called
which allow more specific implementations for a certain aspect of the
layer resolving.
2015-09-17 11:06:59 +02:00
Marco Martin
49e5e81970 support raise and lower windows on wayland
connect raise/lowerRequested to workspace()->raiseClientRequest
/workspace()->lowerClientRequest
REVIEWED-BY:Martin Graesslin
2015-09-16 16:36:26 +02:00
Martin Gräßlin
fda5a5feea [wayland] A popup shell surface doesn't want input 2015-09-16 13:52:25 +02:00
Martin Gräßlin
a86a7e7b3c Add a placement strategy for transient ShellClients
A transient ShellClient has an offset position to the parent surface.
Use this to position the ShellClient properly.

This fixes the random placement of menus.
2015-09-16 13:52:25 +02:00
Martin Gräßlin
0935a60b38 Implement transientFor in ShellClient 2015-09-16 13:52:25 +02:00
Martin Gräßlin
16e9c8375c [wayland] Don't delete Surface we got fromWindow
KWayland changed to cache created Surfaces and not create a new one
each time. If we delete it, we run in double deleted situations.
2015-09-15 12:18:36 +02:00
Marco Martin
658a28a257 support OnScreenDisplay from wayland 2015-09-03 18:19:38 +02:00
Martin Gräßlin
28b48e69fb [wayland] Add repaints on geometry changes 2015-08-25 14:33:51 +02:00
Martin Gräßlin
e0103b15b7 [wayland] Remove the specific socket pair for QtWayland
Our own QPA plugin shares the internal connection, so we don't need the
dedicated connection for the QPA any more.
2015-08-25 14:33:50 +02:00
Martin Gräßlin
c56bbc0ddf Composite windows from a QOpenGLFramebufferObject
This change introduces a mechanism for internal windows to be rendered
to a QOpenGLFramebufferObject to be composited using the texture bound
to the FBO. This is useful for in-process rendering (e.g. QtQuick) and
at the same time bypassing the windowing system.

The OpenGL context of the QOpenGLFramebufferObject needs to be sharing
with the compositing OpenGL context.
2015-08-25 14:33:50 +02:00
Martin Gräßlin
a5185f924d Fix naming 2015-07-22 08:38:00 +02:00
Martin Gräßlin
01d805f193 [wayland] Pass appId to PlasmaWindow interface
For the appId we use:
* wl_shell windowClass for Wayland clients
* resourceName from window class for X11 clients

This is implemented by sharing the window class implementation in
Toplevel.

CCMAIL: hein@kde.org
2015-07-20 09:37:36 +02:00
Martin Gräßlin
a3db04f66e [wayland] Improve mapping of windowClass to desktop file
QtWayland might also pass a name like "app.desktop". In that case
we should not append .desktop to it.
2015-07-15 17:18:39 +02:00
Martin Gräßlin
df1146bfa6 [wayland] Shadow gains support for a Wayland protocol
For Wayland clients we now are able to get shadows.

Internally this reuses large parts of the X11 implementation. This
could be improved to make the Scene's better aware of the Wayland
shadow, so that less memory is needed.
2015-07-15 11:25:16 +02:00
Martin Gräßlin
f304a49a58 [wayland] Only activate ShellClient in takeFocus if it wantsInput
This ensures that e.g. virtual keyboards don't get activated.
2015-07-09 20:43:41 +02:00