79
79
* @param change Where to move the Client
82
void update(Client *client, Change change);
82
void update(AbstractClient *client, Change change);
84
84
* @brief Moves @p client behind the @p reference Client in all focus chains.
87
87
* @param reference The Client behind which the @p client should be moved
90
void moveAfterClient(Client *client, Client *reference);
90
void moveAfterClient(AbstractClient *client, AbstractClient *reference);
92
92
* @brief Finds the best Client to become the new active Client in the focus chain for the given
93
93
* virtual @p desktop.
98
98
* @param desktop The virtual desktop to look for a Client for activation
99
99
* @return :Client* The Client which could be activated or @c null if there is none.
101
Client *getForActivation(uint desktop) const;
101
AbstractClient *getForActivation(uint desktop) const;
103
103
* @brief Finds the best Client to become the new active Client in the focus chain for the given
104
104
* virtual @p desktop on the given @p screen.
111
111
* @param screen The screen to constrain the search on with separate screen focus
112
112
* @return :Client* The Client which could be activated or @c null if there is none.
114
Client *getForActivation(uint desktop, int screen) const;
114
AbstractClient *getForActivation(uint desktop, int screen) const;
117
117
* @brief Checks whether the most recently used focus chain contains the given @p client.
120
120
* @param client The Client to look for.
121
121
* @return bool @c true if the most recently used focus chain contains @p client, @c false otherwise.
123
bool contains(Client *client) const;
123
bool contains(AbstractClient *client) const;
125
125
* @brief Checks whether the focus chain for the given @p desktop contains the given @p client.
130
130
* @param desktop The virtual desktop whose focus chain should be used
131
131
* @return bool @c true if the focus chain for @p desktop contains @p client, @c false otherwise.
133
bool contains(Client *client, uint desktop) const;
133
bool contains(AbstractClient *client, uint desktop) const;
135
135
* @brief Queries the most recently used focus chain for the next Client after the given
136
136
* @p reference Client.
144
144
* @param reference The start point in the focus chain to search
145
145
* @return :Client* The relatively next Client in the most recently used chain.
147
Client *nextMostRecentlyUsed(Client *reference) const;
147
AbstractClient *nextMostRecentlyUsed(AbstractClient *reference) const;
149
149
* @brief Queries the focus chain for @p desktop for the next Client in relation to the given
150
150
* @p reference Client.
156
156
* @param desktop The virtual desktop whose focus chain should be used
157
157
* @return :Client* The next usable Client or @c null if none can be found.
159
Client *nextForDesktop(Client *reference, uint desktop) const;
159
AbstractClient *nextForDesktop(AbstractClient *reference, uint desktop) const;
161
161
* @brief Returns the first Client in the most recently used focus chain. First Client in this
162
162
* case means really the first Client in the chain and not the most recently used Client.
164
164
* @return :Client* The first Client in the most recently used chain.
166
Client *firstMostRecentlyUsed() const;
166
AbstractClient *firstMostRecentlyUsed() const;
182
182
* @param client The Client to remove from all focus chains.
185
void remove(KWin::Client *client);
185
void remove(KWin::AbstractClient *client);
186
186
void setSeparateScreenFocus(bool enabled);
187
void setActiveClient(KWin::Client *client);
187
void setActiveClient(KWin::AbstractClient *client);
188
188
void setCurrentDesktop(uint previous, uint newDesktop);
189
bool isUsableFocusCandidate(Client *c, Client *prev) const;
189
bool isUsableFocusCandidate(AbstractClient *c, AbstractClient *prev) const;
199
199
* @param chain The focus chain to operate on
202
void makeFirstInChain(Client *client, QList<Client*> &chain);
202
void makeFirstInChain(AbstractClient *client, QList<AbstractClient*> &chain);
204
204
* @brief Makes @p client the last Client in the given focus @p chain.
210
210
* @param chain The focus chain to operate on
213
void makeLastInChain(Client *client, QList<Client*> &chain);
214
void moveAfterClientInChain(Client *client, Client *reference, QList<Client*> &chain);
215
void updateClientInChain(Client *client, Change change, QList<Client*> &chain);
216
void insertClientIntoChain(Client *client, QList<Client*> &chain);
217
typedef QHash<uint, QList<Client*> > DesktopChains;
218
QList<Client*> m_mostRecentlyUsed;
213
void makeLastInChain(AbstractClient *client, QList<AbstractClient*> &chain);
214
void moveAfterClientInChain(AbstractClient *client, AbstractClient *reference, QList<AbstractClient*> &chain);
215
void updateClientInChain(AbstractClient *client, Change change, QList<AbstractClient*> &chain);
216
void insertClientIntoChain(AbstractClient *client, QList<AbstractClient*> &chain);
217
typedef QHash<uint, QList<AbstractClient*> > DesktopChains;
218
QList<AbstractClient*> m_mostRecentlyUsed;
219
219
DesktopChains m_desktopFocusChains;
220
220
bool m_separateScreenFocus;
221
Client *m_activeClient;
221
AbstractClient *m_activeClient;
222
222
uint m_currentDesktop;
224
224
KWIN_SINGLETON_VARIABLE(FocusChain, s_manager)
228
bool FocusChain::contains(Client *client) const
228
bool FocusChain::contains(AbstractClient *client) const
230
230
return m_mostRecentlyUsed.contains(client);