Workspace::activeClient returns an AbstractClient
Still a few casts in some areas as setting activeClient still takes a Client.icc-effect-5.14.5
parent
4b41c33268
commit
3ad117ac28
|
@ -381,7 +381,7 @@ void Edge::checkBlocking()
|
|||
return;
|
||||
}
|
||||
bool newValue = false;
|
||||
if (Client *client = Workspace::self()->activeClient()) {
|
||||
if (AbstractClient *client = Workspace::self()->activeClient()) {
|
||||
newValue = client->isFullScreen() && client->geometry().contains(m_geometry.center());
|
||||
}
|
||||
if (newValue == m_blocked) {
|
||||
|
|
|
@ -155,7 +155,7 @@ int Screens::current() const
|
|||
if (m_currentFollowsMouse) {
|
||||
return number(Cursor::pos());
|
||||
}
|
||||
Client *client = Workspace::self()->activeClient();
|
||||
AbstractClient *client = Workspace::self()->activeClient();
|
||||
if (client && !client->isOnScreen(m_current)) {
|
||||
return client->screen();
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ void WorkspaceWrapper::setNumberOfDesktops(int count)
|
|||
rettype WorkspaceWrapper::getterName( ) const { \
|
||||
return Workspace::self()->getterName(); \
|
||||
}
|
||||
GETTER(KWin::Client*, activeClient)
|
||||
GETTER(KWin::AbstractClient*, activeClient)
|
||||
GETTER(QList< KWin::Client* >, clientList)
|
||||
|
||||
#undef GETTER
|
||||
|
@ -192,9 +192,9 @@ SLOTWRAPPER(slotSwitchDesktopDown,DesktopBelow)
|
|||
|
||||
#undef SLOTWRAPPER
|
||||
|
||||
void WorkspaceWrapper::setActiveClient(KWin::Client* client)
|
||||
void WorkspaceWrapper::setActiveClient(KWin::AbstractClient* client)
|
||||
{
|
||||
KWin::Workspace::self()->activateClient(client);
|
||||
KWin::Workspace::self()->activateClient(dynamic_cast<Client*>(client));
|
||||
}
|
||||
|
||||
QSize WorkspaceWrapper::workspaceSize() const
|
||||
|
|
|
@ -40,7 +40,7 @@ class WorkspaceWrapper : public QObject
|
|||
Q_ENUMS(ClientAreaOption)
|
||||
Q_ENUMS(ElectricBorder)
|
||||
Q_PROPERTY(int currentDesktop READ currentDesktop WRITE setCurrentDesktop NOTIFY currentDesktopChanged)
|
||||
Q_PROPERTY(KWin::Client *activeClient READ activeClient WRITE setActiveClient NOTIFY clientActivated)
|
||||
Q_PROPERTY(KWin::AbstractClient *activeClient READ activeClient WRITE setActiveClient NOTIFY clientActivated)
|
||||
// TODO: write and notify?
|
||||
Q_PROPERTY(QSize desktopGridSize READ desktopGridSize NOTIFY desktopLayoutChanged)
|
||||
Q_PROPERTY(int desktopGridWidth READ desktopGridWidth NOTIFY desktopLayoutChanged)
|
||||
|
@ -204,7 +204,7 @@ rettype getter() const; \
|
|||
void setter( rettype val );
|
||||
GETTERSETTERDEF(int, numberOfDesktops, setNumberOfDesktops)
|
||||
GETTERSETTERDEF(int, currentDesktop, setCurrentDesktop)
|
||||
GETTERSETTERDEF(KWin::Client*, activeClient, setActiveClient)
|
||||
GETTERSETTERDEF(KWin::AbstractClient*, activeClient, setActiveClient)
|
||||
#undef GETTERSETTERDEF
|
||||
QSize desktopGridSize() const;
|
||||
int desktopGridWidth() const;
|
||||
|
|
|
@ -1593,8 +1593,8 @@ bool TabBox::establishTabBoxGrab()
|
|||
// the active client, which may not have it.
|
||||
assert(!m_forcedGlobalMouseGrab);
|
||||
m_forcedGlobalMouseGrab = true;
|
||||
if (Workspace::self()->activeClient() != nullptr)
|
||||
Workspace::self()->activeClient()->updateMouseGrab();
|
||||
if (Client *c = dynamic_cast<Client*>(Workspace::self()->activeClient()))
|
||||
c->updateMouseGrab();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1604,8 +1604,8 @@ void TabBox::removeTabBoxGrab()
|
|||
ungrabXKeyboard();
|
||||
assert(m_forcedGlobalMouseGrab);
|
||||
m_forcedGlobalMouseGrab = false;
|
||||
if (Workspace::self()->activeClient() != nullptr)
|
||||
Workspace::self()->activeClient()->updateMouseGrab();
|
||||
if (Client *c = dynamic_cast<Client*>(Workspace::self()->activeClient()))
|
||||
c->updateMouseGrab();
|
||||
}
|
||||
} // namespace TabBox
|
||||
} // namespace
|
||||
|
|
|
@ -222,7 +222,7 @@ void TabGroup::move(Client *c, Client *other, bool after)
|
|||
|
||||
bool TabGroup::isActive() const
|
||||
{
|
||||
return contains(Workspace::self()->activeClient());
|
||||
return contains(dynamic_cast<Client*>(Workspace::self()->activeClient()));
|
||||
}
|
||||
|
||||
void TabGroup::setCurrent(Client* c, bool force)
|
||||
|
|
|
@ -87,7 +87,7 @@ ColorMapper::~ColorMapper()
|
|||
void ColorMapper::update()
|
||||
{
|
||||
xcb_colormap_t cmap = m_default;
|
||||
if (Client *c = Workspace::self()->activeClient()) {
|
||||
if (Client *c = dynamic_cast<Client*>(Workspace::self()->activeClient())) {
|
||||
if (c->colormap() != XCB_COLORMAP_NONE) {
|
||||
cmap = c->colormap();
|
||||
}
|
||||
|
@ -1663,6 +1663,11 @@ bool Workspace::hasClient(const AbstractClient *c)
|
|||
return false;
|
||||
}
|
||||
|
||||
AbstractClient *Workspace::activeClient() const
|
||||
{
|
||||
return active_client;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#include "workspace.moc"
|
||||
|
|
|
@ -138,7 +138,7 @@ public:
|
|||
* Returns the active client, i.e. the client that has the focus (or None
|
||||
* if no client has the focus)
|
||||
*/
|
||||
Client* activeClient() const;
|
||||
AbstractClient* activeClient() const;
|
||||
/**
|
||||
* Client that was activated, but it's not yet really activeClient(), because
|
||||
* we didn't process yet the matching FocusIn event. Used mostly in focus
|
||||
|
@ -634,11 +634,6 @@ inline bool Workspace::initializing() const
|
|||
return workspaceInit;
|
||||
}
|
||||
|
||||
inline Client* Workspace::activeClient() const
|
||||
{
|
||||
return active_client;
|
||||
}
|
||||
|
||||
inline Client* Workspace::mostRecentlyActivatedClient() const
|
||||
{
|
||||
return should_get_focus.count() > 0 ? should_get_focus.last() : active_client;
|
||||
|
|
Loading…
Reference in New Issue