Remove remaining Client usage from FocusChain

remotes/origin/Plasma/5.4
Martin Gräßlin 11 years ago
parent 704b255234
commit d4f7445749
  1. 4
      activation.cpp
  2. 11
      focuschain.cpp
  3. 7
      focuschain.h

@ -455,7 +455,7 @@ bool Workspace::activateNextClient(Client* c)
if (!options->focusPolicyIsReasonable())
return false;
Client* get_focus = NULL;
AbstractClient* get_focus = NULL;
// precedence on keeping the current tabgroup active. to the user that's the same window
if (c && c->tabGroup() && c->isShown(false)) {
@ -506,7 +506,7 @@ void Workspace::setCurrentScreen(int new_screen)
return;
closeActivePopup();
const int desktop = VirtualDesktopManager::self()->current();
Client *get_focus = FocusChain::self()->getForActivation(desktop, new_screen);
AbstractClient *get_focus = FocusChain::self()->getForActivation(desktop, new_screen);
if (get_focus == NULL)
get_focus = findDesktop(true, desktop);
if (get_focus != NULL && get_focus != mostRecentlyActivatedClient())

@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "focuschain.h"
#include "abstract_client.h"
#include "client.h"
#include "screens.h"
namespace KWin
@ -60,12 +59,12 @@ void FocusChain::resize(uint previousSize, uint newSize)
}
}
Client *FocusChain::getForActivation(uint desktop) const
AbstractClient *FocusChain::getForActivation(uint desktop) const
{
return getForActivation(desktop, screens()->current());
}
Client *FocusChain::getForActivation(uint desktop, int screen) const
AbstractClient *FocusChain::getForActivation(uint desktop, int screen) const
{
DesktopChains::const_iterator it = m_desktopFocusChains.find(desktop);
if (it == m_desktopFocusChains.constEnd()) {
@ -77,7 +76,7 @@ Client *FocusChain::getForActivation(uint desktop, int screen) const
// TODO: move the check into Client
if (tmp->isShown(false) && tmp->isOnCurrentActivity()
&& ( !m_separateScreenFocus || tmp->screen() == screen)) {
return dynamic_cast<Client*>(tmp);
return tmp;
}
}
return NULL;
@ -220,7 +219,7 @@ bool FocusChain::isUsableFocusCandidate(AbstractClient *c, AbstractClient *prev)
(!m_separateScreenFocus || c->isOnScreen(prev ? prev->screen() : screens()->current()));
}
Client *FocusChain::nextForDesktop(AbstractClient *reference, uint desktop) const
AbstractClient *FocusChain::nextForDesktop(AbstractClient *reference, uint desktop) const
{
DesktopChains::const_iterator it = m_desktopFocusChains.find(desktop);
if (it == m_desktopFocusChains.end()) {
@ -230,7 +229,7 @@ Client *FocusChain::nextForDesktop(AbstractClient *reference, uint desktop) cons
for (int i = chain.size() - 1; i >= 0; --i) {
auto client = chain.at(i);
if (isUsableFocusCandidate(client, reference)) {
return dynamic_cast<Client*>(client);
return client;
}
}
return NULL;

@ -29,7 +29,6 @@ namespace KWin
{
// forward declarations
class AbstractClient;
class Client;
/**
* @brief Singleton class to handle the various focus chains.
@ -99,7 +98,7 @@ public:
* @param desktop The virtual desktop to look for a Client for activation
* @return :Client* The Client which could be activated or @c null if there is none.
**/
Client *getForActivation(uint desktop) const;
AbstractClient *getForActivation(uint desktop) const;
/**
* @brief Finds the best Client to become the new active Client in the focus chain for the given
* virtual @p desktop on the given @p screen.
@ -112,7 +111,7 @@ public:
* @param screen The screen to constrain the search on with separate screen focus
* @return :Client* The Client which could be activated or @c null if there is none.
**/
Client *getForActivation(uint desktop, int screen) const;
AbstractClient *getForActivation(uint desktop, int screen) const;
/**
* @brief Checks whether the most recently used focus chain contains the given @p client.
@ -157,7 +156,7 @@ public:
* @param desktop The virtual desktop whose focus chain should be used
* @return :Client* The next usable Client or @c null if none can be found.
**/
Client *nextForDesktop(AbstractClient *reference, uint desktop) const;
AbstractClient *nextForDesktop(AbstractClient *reference, uint desktop) const;
/**
* @brief Returns the first Client in the most recently used focus chain. First Client in this
* case means really the first Client in the chain and not the most recently used Client.

Loading…
Cancel
Save