71 Commits (66e27b69bb5a66e4dceddaf605b33c62183051b2)

Author SHA1 Message Date
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.
9 years ago
Martin Gräßlin 41af9c400c [wayland] Allow resizing on ShellClients
Needed to be able to put clients into quick tile mode.
9 years ago
Martin Gräßlin 9f91431e8c Move quick tiling from Client to AbstractClient
In order to make it possible to quick tile also ShellClients.
9 years ago
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.
9 years ago
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.
9 years ago
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).
9 years ago
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
9 years ago
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.
9 years ago
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.
9 years ago
Marco Martin 0bf64446cd remove unwanted debug and change in 9912d84 9 years ago
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
9 years ago
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
9 years ago
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.
9 years ago
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.
9 years ago
Marco Martin 49e5e81970 support raise and lower windows on wayland
connect raise/lowerRequested to workspace()->raiseClientRequest
/workspace()->lowerClientRequest
REVIEWED-BY:Martin Graesslin
9 years ago
Martin Gräßlin fda5a5feea [wayland] A popup shell surface doesn't want input 9 years ago
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.
9 years ago
Martin Gräßlin 0935a60b38 Implement transientFor in ShellClient 9 years ago
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.
9 years ago
Marco Martin 658a28a257 support OnScreenDisplay from wayland 9 years ago
Martin Gräßlin 28b48e69fb [wayland] Add repaints on geometry changes 9 years ago
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.
9 years ago
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.
9 years ago
Martin Gräßlin a5185f924d Fix naming 9 years ago
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
9 years ago
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.
9 years ago
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.
9 years ago
Martin Gräßlin f304a49a58 [wayland] Only activate ShellClient in takeFocus if it wantsInput
This ensures that e.g. virtual keyboards don't get activated.
9 years ago
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.
9 years ago
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).
9 years ago
Martin Gräßlin da4305c2fa [wayland] Focus to null X11 window when activating a Wayland client
Improves interaction with Xwayland clients.
9 years ago
Martin Gräßlin 48bf38e830 [wayland] Trigger update of client area when the panel behavior changes 9 years ago
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.
9 years ago
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.
9 years ago
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".
9 years ago
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
9 years ago
Boudewijn Rempt 98bcdbe70a [wayland] Add a command-line option to start an input method server
Input-method servers, like maliit, need to be known to KWin since KWin
needs to know about virtual keyboards. Virtual keyboards should be shown
as OSD layers, and they are one of the types of windows that actually
should be showable when the lock screen is active.

kwin_wayland --inputmethod /path/to/your/input-server

tries to start the input server. The input-server's window never gets
keyboard focus and is shown on top of all windows except for KWin's
internal clients.
9 years ago
Boudewijn Rempt 1d78430acc A shell client's layer is OSD if it's OSD 9 years ago
Boudewijn Rempt 955b0bb8e8 warnings--: unused parameter 9 years ago
Marco Martin 9744625253 don't close desktop windows and docks
reviewed-by:Martin Gräßlin <mgraesslin@kde.org
9 years ago
Martin Gräßlin ad80e31e6a [wayland] Reset ShellClient::m_unmapped before calling setReadyForPainting
m_unmapped determines whether the ShellClient wantsInput. This is used by
the ScriptingModel to check whether a ShellClient should be included. It
gets triggered by windowShonw signal called from setReadyFromPainting. If
m_unmapped is still true at that point the ScriptingModel doesn't include
it.
9 years ago
Martin Gräßlin 93c88aa446 [wayland] While a ShellClient is not shown, it won't take input 9 years ago
Martin Gräßlin 11e0e75fb3 Add a signal Toplevel::windowHidden
Signal is connected in ScriptingModel together with windowShown.
9 years ago
Thomas Lübking 41be18e317 Robust modal activation; ensure showing activated
...window

REVIEW: 123875
BUG: 348083
9 years ago
Martin Gräßlin f696b578cc [wayland] Add support for QtSurfaceExtension for closing ShellClients
If the ShellClient has a QtExtendedSurface it's closeable.
9 years ago
Martin Gräßlin 124bd8aaed [wayland] Add support for the PlasmaShell interface
The PlasmaShell interface allows to create a PlasmaShellSurface for a
given Surface. Through this interface the Surface can request:
* a specific position
* a window type

So far only the window types Normal, Panel and Desktop are supported
which is a sufficient subset for getting plasmashell to work.

In future there should be security checks so that only the dedicated
desktop shell can bind these interfaces.
9 years ago
Martin Gräßlin 280075b7cd [wayland] Support windowType for internal windows
Our internal windows (e.g. a declarative script) can specify their own
window type which then can get honored by KWin.
9 years ago
Martin Gräßlin e46ad2091b [wayland] Internal ShellClient is on all desktops 9 years ago
Martin Gräßlin 7cded49145 [wayland] Implement maximizing of ShellClient 9 years ago
Martin Gräßlin 239104b4f4 [wayland] Trigger layerRepaint on old geometry when changing geometry
Applies for the case that we have a positionAfterResize.
9 years ago