Commit Graph

85 Commits (96124c1643f565f2c67421f4cffa7c4c728a4d7f)

Author SHA1 Message Date
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
Martin Gräßlin 8d407157c4 Provide a base implementation for performMouseCommand in AbstractClient
Most commands can be operated directly in AbstractClient already which
means less code duplication to make the commands work for wayland
clients.
2015-07-09 16:34:19 +02:00
Martin Gräßlin 72635101f0 [wayland] Improve creation of KWayland::Server::PlasmaWindowInterface
The creation of PlasmaWindowInterface is moved from WaylandServer into
AbstractClient. This allows the sub classes to better control when to
create/destroy the Client.

For creation it's bound to becoming visible - that is Windows which are
only created but never shown are not announced at all.

For Client it's destroyed with the normal tear-down of a Client, for
ShellClient it's destroyed on unmapped (which also means a new one
will be created again in case of another mapping of the surface).

As a side effect, this works around the problem that ShellClients do not
yet get destroyed for QtWayland's menus (needs further investigation).
2015-07-09 09:10:33 +02:00
Martin Gräßlin da4305c2fa [wayland] Focus to null X11 window when activating a Wayland client
Improves interaction with Xwayland clients.
2015-07-07 16:15:58 +02:00
Martin Gräßlin 48bf38e830 [wayland] Trigger update of client area when the panel behavior changes 2015-06-25 09:04:51 +02:00
Martin Gräßlin 7e1e044948 [wayland] Break showing desktop from ShellClient::takeFocus
Logic similar to Client::takeFocus: if window is keep above or on
screen display do not break. Also if window belongs to the same
ClientConnection as a desktop window don't break.
2015-06-23 11:08:28 +02:00
Martin Gräßlin 31e599a63d [wayland] Provide icon from ShellSurface's windowClass
We can use the window class to locate a desktop file and from this
we can load a themed icon.
2015-06-20 01:11:42 +02:00
Martin Gräßlin 2192bd69e0 [wayland] Add support for PanelBehavior in ShellClient
The PanelBehavior determines the stacking of panel surfaces and whether
they "have a strut".
2015-06-20 00:14:49 +02:00
Thomas Lübking 39c35f8f48 fix sendToScreen/checkWorkspaceGeometry
Prime target is to preserve the in-screen
condition of client AND window.i[1]
Atm. when the client is fully in sight
(but the window is not) - regardless of snapping
or screen change - a workspace update (screen change,
resolution change, adding/removing a strutting panel)
would allow the client to partiall escape screen bounds.

This is changed so that if the client is fully in sight,
it's kept fully in sight (but not the decoration)
If the entire window was fully in sight, it's also kept
(as is right now)
The code handles inner screen edges (if the client was in sight,
the entire window will be if we'd bleed to the other screen)

[1] I'd say that handling the client is more relevant,
but foresee more complaints if the window wasn't handled anymore ;-)

During that, i stumbled across some other issues.
- when a window centered on one screen is moved to a screen smaller
  than the window, the window is shrinked to the dimensions of that
  screen and now randomly touches eg. left AND right edge. When
  moved back, the right and bottom edge were preferred
  (to the window was "moved" into the lower right corner).
  It's now kept centered.
- geom_restore was saved before keeping the window in the new
  screen area (causing accidental drops on screen changes)

BUG: 330968
REVIEW: 122517
FIXED-IN: 5.4

Prime target is to preserve the in-screen condition
of client AND window.[1]
Atm. when the client is fully in sight (but the window is not) -
regardless of snapping or screen change - a workspace update
(screen change, resolution change, adding/removing a strutting
panel) would allow the client to partiall escape screen bounds.

This is changed so that if the client is fully in sight,
it's kept fully in sight (but not the decoration)
If the entire window was fully in sight, it's also kept
(as is right now)
The code handles inner screen edges (if the client was in sight,
the entire window will be if we'd bleed to the other screen)

[1] I'd say that handling the client is more relevant,
but foresee more complaints if the window wasn't handled anymore ;-)

During that, i stumbled across some other issues.
- when a window centered on one screen is moved to a screen
smaller than the window, the window is shrinked to the dimensions
of that screen and now randomly touches eg. left AND right edge.
When moved back, the right and bottom edge were preferred
(to the window was "moved" into the lower right corner).
It's now kept centered.
- geom_restore was saved before keeping the window in the new
screen area (causing accidental drops on screen changes)

BUG: 330968
REVIEW: 116029
FIXED-IN: 5.3
2015-06-19 19:48:39 +02:00