Commit graph

90 commits

Author SHA1 Message Date
Thomas Lübking
ed1d32288b move doubleclick logic into press event
alignes w/ systemwide behavior and allows elegant fix of
BUG: 357450
FIXED-IN: 5.6
REVIEW: 126631
2016-01-18 22:34:37 +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
9ae2b505fa Group decoration related variables in a struct in AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
4873b2933f Move decoratedClient from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
ae28c2499d Add virtual AbstractClient::showContextHelp and ::providesContextHelp
Required in the context of decorations. Default implementation does
nothing respectively returns false.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
5de55b61e7 Move processDecorationButton(Press|Release) to AbstractClient
This also requires to move m_decorationDoubleClickTimer and reworking
a bit how the x11 events are passed to processDecorationButtonPress.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
38d3346faa Mode dontMoveResize from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
a15ccc2215 Move processDecorationMove from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
4d61835988 Move implementation of mousePosition to AbstractClient
Also method does not need to be virtual any more.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
5d36bab6b2 Move implementation for borderFoo() to AbstractClient
Also makes the methods no longer virtual, can just be provided in
AbstractClient.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
c1053ce1a5 Add a base implementation for layoutDecorationRects to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
1659c0b641 Move triggerDecorationRepaint from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
0a82746f91 Move decorationHasAlpha from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
ebe2989649 Move the KDecoration2::Decoration to AbstractClient
This includes the methods:
* decoration()
* decoration() const
* isDecorated() const

In addition new protected methods are added to destroy the Decoration
and to set it.

Usage of m_decoration in Client code is adjusted.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
a23a9d38f9 Make it possible to end move/resize through mouse button release
Properly handle the mouse press/release events in InputRedirection
while we move windows. If it's the last mouse release event we end
the move resize of the window. For that we reuse the code written
in Client.
2015-10-28 10:43:49 +01:00
Martin Gräßlin
f1215e44d4 Move implementation of (shrow|grow)(Horizontal|Vertical) to AbstractClient
Methods are no longer virtual. The only x11 specific usage in these
methods (resizeInc) is replaced by a virtual method. Default resize
increments is QSize(1,1) for AbstractClient.
2015-10-26 15:49:03 +01:00
Martin Gräßlin
b19da3cb14 Move implementation of Client::packTo to AbstractClient
Method no longer virtual and only implemented in AbstractClient.
The implementaton works in a generic way nowadyas.

Added an autotest for the basic packTo behavior for packing against
a screen border. Packing towards other clients still needs adjustments
in the Placement code.
2015-10-26 11:30:34 +01:00
Martin Gräßlin
5d4cd0b26c Move geometry related connects from Client to AbstractClient 2015-10-26 10:14:54 +01:00
Martin Gräßlin
5d2251875f Move keyPressEvent(uint) to AbstractClient
The variant with additional timestamp is still in Client.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
717a48a2a1 Move move/resize related mouse command handling to AbstractClient
Code is refactored in a sufficient way so that we can handle the
move/resize mouse commands also from AbstractClient::performMouseCommand.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
f5848d9405 Move implementation of updateMoveResize to AbstractClient
No longer virtual.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
f4b02d5a8c Move handleMoveResize to AbstractClient
Sync related code is split out into dedicated virtual methods so that
Client can provide the X11 specific implementation. General handling,
though is completely in AbstractClient.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
dcff41ab40 Move checkQuickTilingMaximizationZones to AbstractClient
Implementation is moved to abstract_client.cpp as so far events.cpp
does not have any code from AbstractClient.

This includes moving the electricMaximizingDelay from Client to
AbstractClient.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
7e23860957 Move performMoveResize to AbstractClient
As there is X11 specific code, this is moved into a virtual
doPerformMoveResize method.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
43e4071975 Provide positionGeometryTip() as virtual method in AbstractClient
The implementation of positionGeometryTip is X specific, we need to
figure out whether that one makes sense for Wayland. Given that, let's
have it virtual to ease the transition of code which calls it.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
c83f041005 Move startMoveResize() to AbstractClient
The implementation calls a virtual doStartMoveResize() which allows
Client to do it's X11 specific tasks (creating moveResizeWindow, grabbing
input).

The base implementation is no longer virtual.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
9e323227a1 Move (start|stop)DelayedMoveResize to AbstractClient
Also requires to add startMoveResized() as a virtual method. Not
yet implemented in AbstractClient.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
95a99d337a Move s_haveResizeEffect from Client to AbstractClient 2015-10-26 09:21:36 +01:00
Martin Gräßlin
1c40e809ea Provide leaveMoveResize() as virtual method in AbstractClient
The non X11 specific code is split out into a base implementation
which is called from the Client.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
dc04cdef64 Move moveResizeStartScreen from Client to AbstractClient
Initialized in updateInitialMoveResizeGeometry().
2015-10-26 09:21:36 +01:00
Martin Gräßlin
dcb5e29316 Move updateCursor() functionality to AbstractClient
Includes moving the m_cursor and Qt::CursorShape cursor() method to
AbstractClient. In addition AbstractClient now emits a signal whenever
the shape changes allowing Client to react on it (update the low level
cursor) and also hopefully the Wayland Backends to react to it, so that
we have the cursor.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
c3f14521c1 Move moveResizeGeom to AbstractClient
Biggest impact on Client::handleMoveResize which directly manipulated
the variable in various parts. I tried to keep the impact low.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
b4fc4d7235 Move initialMoveResizeGeometry to AbstractClient 2015-10-26 09:21:36 +01: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
c578720615 Add virtual AbstractClient::updateTabGroupStates(TabGroup::States)
Method added so that we can call into TabGroup::updateStates from code
in AbstractClient. Default implementation does nothing, implementation
in Client performs the actuall call.

As a first case added to Client::move in order to be able to move the
implementation to AbstractClient.
2015-10-15 15:29:09 +02:00
Martin Gräßlin
d7b4d8fe82 Move functionality for geom_before_block to AbstractClient
Semantically it belongs together with geometry update blocking which
is already in AbstractClient.
2015-10-15 15:29:09 +02:00
Martin Gräßlin
a186e407bf Move handling around deco_rect_before_block to AbstractClient
The usage was always to trigger repaints on the old and the new
visibleRect. And store the new visibleRect as the future old one.

This is now encapsulated in a dedicated method called
addRepaintDuringGeometryUpdates().
2015-10-15 15:29:09 +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
9f2b4c7d14 Introduce a virtual AbstractClient::updateQuickTileMode(QuickTileMode)
New method is used to modify the quick tile mode state directly.
Preparation step for moving the quick tile handling to AbstractClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin
9ef42ae3c7 Move blocking geometry updates functionality to AbstractClient 2015-10-14 08:36:29 +02:00
Martin Gräßlin
646eeb8bbb Provide isDecorated() as virtual method on AbstractClient
Default implementation returns false.
2015-10-14 08:36:29 +02:00
Martin Gräßlin
7c49b1ca42 Add sizeForClientSize as virtual method to AbstractClient
Base implementation returns the passed in size.

Required for moving adjustedSize to AbstractClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin
acb3a14200 Add border(Left|Top|Right|Bottom)() const as virtual methods in AbstractClient
At some future point we will also need it in ShellClient and it allows us
to better share geometry related implementations.

Base implementation returns 0, that is no border.
2015-10-14 08:36:29 +02:00
Martin Gräßlin
ee47ce613d Provide quickTileMode() as virtual method in AbstractClient
Base implementation always returns QuickTileNone. Implementation in
Client overrides. Long term solution: provide functionality directly
in AbstractClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin
b5255de4b6 Move layer updating for setActive back to AbstractClient
AbstractClient now also supports mainClients, so we can do the
fullscreen window check on setActive in a general way. This ensures
that we do get proper stacking changes for activating fullscreen
shell clients.
2015-10-01 17:21:56 +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
9988fa9d74 Add safety check for recursive transient for
An AbstractClient cannot be transient for itself.
2015-09-17 14:10:57 +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
Martin Gräßlin
a421f546cd Move functionality of Client::updateLayer to AbstractClient
With transient support in AbstractClient we can provide the
functionality in AbstractClient.
2015-09-16 13:54:48 +02:00