Commit graph

622 commits

Author SHA1 Message Date
Martin Gräßlin
445335ba5f Merge signal connections for AbstractClient in Workspace
Summary:
Have one dedicated method which performs the connection for both
Client and ShellClient. This fixes the desktopPresenceChanged signal
not being passed to the effects.

Note that not all signals are merged. Most signals setup for Client
don't make sense for ShellClient as ShellClient cannot block composite
or unredirect.

Test Plan:
Test case added for ShellClient to ensure that the signal
is correctly invoked on the ShellClient, Workspace and EffectsHandler.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2059
2016-07-13 10:44:34 +02:00
Martin Gräßlin
59e3b96812 Add a Toplevel *Workspace::findInternal(QWindow *w) const
This method is able to match a QWindow created by KWin to a Toplevel.
On X11 by matching winId against Unmanaged, on Wayland by matching
to internal window of ShellClient.

Finding the internal window is a commonly needed feature to e.g.
elevate the TabBox window.
2016-03-04 09:42:33 +01:00
Martin Gräßlin
6b06779a64 Port Workspace::requestDelayFocus to AbstractClient
And also call cancelDelayFocus when removing a ShellClient.
2016-02-18 11:18:50 +01:00
Martin Gräßlin
df4bb8296a Port Workspace::clientUnderMouse to AbstractClient 2016-02-18 10:28:00 +01:00
Martin Gräßlin
89be6cf4ed Add a Workspace::forEachAbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
0bf2b1de0f Add a Workspace::findAbstractClient
Like Workspace::findClient just that it operates on AbstractClient
and the m_allClients instead of clients.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
6dc211dfaf Workspace::adjustClientSize operates on AbstractClient
And now also during resizing clients snap to ShellClients.
2015-09-18 14:05:19 +02:00
Martin Gräßlin
47d2b4cb49 Workspace::adjustClientPosition operates on AbstractClient
With that moving clients snap also against ShellClients and not just
Clients.
2015-09-18 13:46:42 +02:00
Martin Gräßlin
51888e8abd Introduce an allClientList in Workspace
Holds AbstractClients that is both X11 and Wayland clients. Allows
to easily change code which needs to operate on all clients to get
to them without needing special handling for Wayland clients. At the
same time we are still able to get to the windowing system specific
clients through the old clientList() and waylandServer()->clients().
2015-09-18 13:44:54 +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
fc5b303c5f Workspace::raiseClientWithinApplication opertes on AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin
e46bf87311 Workspace::lowerClientWithinApplication operates on AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin
5f429625f0 Workspace::topClientOnDesktop returns AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin
a9d8926d3c Workspace::findDesktop returns AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin
4a3d0fdac6 Workspace::updateOnAllDesktopsOfTransients operates on AbstractClient 2015-09-16 13:54:47 +02:00
Martin Gräßlin
2f7597e522 Move transients from Client to AbstractClient
Unfortunately introduces a few casts to Client again.
2015-09-16 13:54:47 +02:00
Martin Gräßlin
4ad749e560 Workspace::ensureStackingOrder can operate on QList<Client*> or QList<AbstractClient*>
Preparation for getting Client::transients() to be AbstractClient as
ensureStackingOrder is called on the transients.
2015-09-16 13:54:47 +02:00
Martin Gräßlin
1e00e1597a Workspace::keepTransientAbove operates on AbstractClient 2015-09-16 13:52:25 +02:00
Martin Gräßlin
9a8f94f8fc Workspace::gotFocusIn and ::shouldGetFocusIn changed to operate on AbstractClient 2015-07-09 16:34:19 +02:00
Thomas Lübking
3442664609 port session management to KF5
REVIEW: 123580
BUG: 341930
2015-06-18 00:18:53 +02:00
Martin Gräßlin
597a9da77f Workspace::activateNextClient and clientHidden operate on AbstractClient
This is required to change the active_client after the active_client
closes.
2015-05-08 12:43:47 +02:00
Martin Gräßlin
f55c086007 Change Workspace::clientRemoved to carry an AbstractClient
At the same time emit it when a ShellClient get's removed. This ensures
it gets removed from e.g. the FocusChain.
2015-05-08 12:43:47 +02:00
Martin Gräßlin
1bfba1765c Signal desktopPresenceChanged carries AbstractClient as argument 2015-05-08 12:43:47 +02:00
Martin Gräßlin
16568804be Demands Attention handling in Workspace operates on AbstractClient
Affects:
* list attention_chain
* clientAttentionChanged
* clientDemandsAttentionChanged
2015-05-08 12:43:47 +02:00
Martin Gräßlin
b84118a51b Workspace::updateClientLayer operates on AbstractClient
Requires a virtual updateLayer in AbstractClient. Default implementation
does nothing.
2015-05-08 12:43:46 +02:00
Martin Gräßlin
41cd927bce Move Workspace::activeClient and ::mostRecentlyActivatedClient back to header
Now all is moved they can be inlined again.
2015-05-08 12:43:46 +02:00
Martin Gräßlin
fdcaf2b86f Make Workspace::active_client an AbstractClient 2015-05-08 12:43:46 +02:00
Martin Gräßlin
af48d38d22 Workspace::should_get_focus becomes QList<AbstractClient*> 2015-05-08 12:43:46 +02:00
Martin Gräßlin
94ce47ef7b Workspace::mostRecentlyActivatedClient returns an AbstractClient
Implementation temporarily moved to cpp. Needs to be moved back once
should_get_focus and active_client are AbstractClient.
2015-05-08 12:43:46 +02:00
Martin Gräßlin
b1026aa162 Workspace::allowFullClientRaising operates on AbstractCliet 2015-05-08 12:43:46 +02:00
Martin Gräßlin
1d7d1787a8 Workspace::last_active_client becomes an AbstractClient 2015-05-08 12:43:46 +02:00
Martin Gräßlin
f28d759352 Workspace::allowClientActivation operates on AbstractClient
Still requires a dynamic_cast for check on should_get_focus. To be
removed once Workspace::should_get_focus is a list of AbstractClients.
2015-05-08 12:43:46 +02:00
Martin Gräßlin
683fc0613f Workspace::packPosition* operates on AbstractClient 2015-05-08 12:43:46 +02:00
Martin Gräßlin
138c1b2ff0 Workspace::sendClientToDesktop operates on AbstractClient
Unfortunately transient handling is still on Client, thus it's
still in a cast-if block.
2015-05-08 12:43:45 +02:00
Martin Gräßlin
4f1c98773e Workspace::showWindowMenu operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin
c357ac01fe Workspace::restackClientUnderActive operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin
ddcd4dab59 Workspace::slotWindowTo(Previous|Next)Desktop operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin
1d4701d67e Workspace::takeActivity operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin
484f9b6e65 Workspace::activateClient and ::requestFocus changed to AbstractClient
requestFocus delegates to takeActivity which is not yet adjusted but
performs a nullptr check, thus we pass a casted Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin
8cfe0a9316 Workspace::clientActivated signal changed to AbstractClient
connections changed to new connect syntax to ensure they are correct.
2015-05-08 12:43:45 +02:00
Martin Gräßlin
3ad117ac28 Workspace::activeClient returns an AbstractClient
Still a few casts in some areas as setting activeClient still takes
a Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin
4b41c33268 Workspace::movingClient changed to AbstractClient
In events.cpp it's casted to Client as it's X11 specific.
In InputRedirections it's kind of broken, but window movement is
anyway broken.
2015-05-08 12:43:45 +02:00
Martin Gräßlin
519006ffa4 Workspace::performWindowOperation operates on AbstractClient
Only exception is the call to ::takeActivity which still expects a
Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin
bfa4e1cec1 Workspace::cascadeOffset operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin
942b49e2c4 Workspace::setupWindowShortcut operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin
aa1e9161d5 Workspace::clientArea takes AbstractClient instead of Client 2015-05-08 12:43:44 +02:00
Martin Gräßlin
7c187359a7 Workspace::sendClientToScreen operates on AbstractClient 2015-05-08 12:43:44 +02:00
Martin Gräßlin
f800477be5 Use AbstractClient for raise/lowerClient
Not a 100 % port. Transient handling is still bound to Client and
does a static cast back to Client.
2015-05-08 12:43:44 +02:00
Martin Gräßlin
1b02837d0b Add overload Workspace::hasClient(const AbstractClient*)
Delegates to hasClient(const Client*) if the AbstractClient is a
Client. Needs to be extended for other AbstractClient subclasses.
2015-05-08 12:43:44 +02:00
Martin Gräßlin
792745c963 Change Workspace::restack to operate on AbstractClient 2015-05-08 12:43:44 +02:00