Commit graph

140 commits

Author SHA1 Message Date
Martin Gräßlin
a35ffa93d7 Use hiddenInternal() for a ShellClient which got unmapped
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
2016-07-13 10:45:10 +02:00
Martin Gräßlin
14d12c0585 Do not limit mouse actions to titleBarArea but allow on complete titleBarPosition
Summary:
Mouse actions like wheel and double click were restricted to the titleBar
area. This made the top most pixel non-interactive as it's not part of the
titleBarArea.

This change makes the complete titlebarPosition interactive. That is it
includes for a "normal" (top) setup also the TopLeft/Top/Right section.
Thus the top most pixel can be double clicked, mouse wheeled, etc.

For the Wayland case the test case is adjusted.

BUG: 362860
FIXED-IN: 5.7.0

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1596
2016-05-12 16:58:15 +02:00
Martin Gräßlin
0b9e6a4aa2 Fix start move through drag distance on window decoration
We need to call handleMoveResize on the mouse move with button down.

Auto tests adjusted to include all possible directions.
2016-03-11 12:48:01 +01:00
Martin Gräßlin
c6e6d9a872 Move leaveNotify event handling to AbstractClient
Only most basic to cancel auto raise and delayed focus.
2016-02-18 13:00:50 +01:00
Martin Gräßlin
8ee550292f Move enterNotify handling to AbstractClient
General handling for mouse driven focus and auto raise should and can
be shared between Client and ShellClient. Thus the code is moved to
AbstractClient and invoked from Client::enterNotifyEvent.
2016-02-18 11:30:52 +01:00
Martin Gräßlin
4e32dcfbfe Cleanup includes of input.(h|cpp) a little bit 2016-02-15 13:51:36 +01:00
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
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
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
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
ce84ae4b65 Move some decoration related signals 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
ad6ead1928 Move property noBorder from Client to AbstractClient 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
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
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
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
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
ba53407b52 Move finishMoveResize(bool) 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
88e097ec16 Move signals clientFooUserMovedResized to AbstractClient
This also changes the argument to carry the sending AbstractClient
instead of 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
b8e68307bb Move buttonDown from Client to AbstractClient
Bundled together with other moveResize functionality. We might need
to investigate whether this variable is needed at all.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
605acaf60e Move checkUnrestrictedMoveResize() from Client to AbstractClient 2015-10-26 09:21:36 +01:00
Martin Gräßlin
c9dbd94812 Move properties move and resize from Client to AbstractClient
Includes the public methods isMove() and isResize() and the signal
moveResizedChanged().
2015-10-26 09:21:36 +01:00
Martin Gräßlin
8a3be2bacd Move the Position mode from Client to AbstractClient 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
84c7575cbf Move (inverted)MoveOffset to AbstractClient 2015-10-26 09:21:36 +01:00
Martin Gräßlin
3514b4d691 Track whehter moveResize is unrestricted in AbstractClient 2015-10-26 09:21:36 +01:00