Use AbstractClient for raise/lowerClient
Not a 100 % port. Transient handling is still bound to Client and does a static cast back to Client.
This commit is contained in:
parent
1b02837d0b
commit
f800477be5
5 changed files with 27 additions and 13 deletions
|
@ -38,4 +38,9 @@ bool AbstractClient::belongToSameApplication(const AbstractClient *c1, const Abs
|
|||
return c1->belongsToSameApplication(c2, active_hack);
|
||||
}
|
||||
|
||||
bool AbstractClient::isTransient() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,15 @@ public:
|
|||
virtual bool wantsTabFocus() const = 0;
|
||||
virtual bool isFullScreen() const = 0;
|
||||
virtual const QIcon &icon() const = 0;
|
||||
virtual void cancelAutoRaise() = 0;
|
||||
virtual bool isTransient() const;
|
||||
/**
|
||||
* Returns true for "special" windows and false for windows which are "normal"
|
||||
* (normal=window which has a border, can be moved by the user, can be closed, etc.)
|
||||
* true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
|
||||
* false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
|
||||
*/
|
||||
virtual bool isSpecialWindow() const = 0;
|
||||
|
||||
// TODO: remove boolean trap
|
||||
static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false);
|
||||
|
|
6
client.h
6
client.h
|
@ -295,7 +295,7 @@ public:
|
|||
|
||||
const Client* transientFor() const;
|
||||
Client* transientFor();
|
||||
bool isTransient() const;
|
||||
bool isTransient() const override;
|
||||
bool groupTransient() const;
|
||||
bool wasOriginallyGroupTransient() const;
|
||||
ClientList mainClients() const; // Call once before loop , is not indirect
|
||||
|
@ -321,7 +321,7 @@ public:
|
|||
* true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
|
||||
* false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
|
||||
*/
|
||||
bool isSpecialWindow() const;
|
||||
bool isSpecialWindow() const override;
|
||||
bool hasNETSupport() const;
|
||||
|
||||
QSize minSize() const;
|
||||
|
@ -544,7 +544,7 @@ public:
|
|||
void toggleShade();
|
||||
void showContextHelp();
|
||||
void cancelShadeHoverTimer();
|
||||
void cancelAutoRaise();
|
||||
void cancelAutoRaise() override;
|
||||
void checkActiveModal();
|
||||
StrutRect strutRect(StrutArea area) const;
|
||||
StrutRects strutRects() const;
|
||||
|
|
12
layers.cpp
12
layers.cpp
|
@ -281,10 +281,10 @@ Client* Workspace::findDesktop(bool topmost, int desktop) const
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void Workspace::raiseOrLowerClient(Client *c)
|
||||
void Workspace::raiseOrLowerClient(AbstractClient *c)
|
||||
{
|
||||
if (!c) return;
|
||||
Client* topmost = NULL;
|
||||
AbstractClient* topmost = NULL;
|
||||
// TODO Q_ASSERT( block_stacking_updates == 0 );
|
||||
if (most_recently_raised && stacking_order.contains(most_recently_raised) &&
|
||||
most_recently_raised->isShown(true) && c->isOnCurrentDesktop())
|
||||
|
@ -300,7 +300,7 @@ void Workspace::raiseOrLowerClient(Client *c)
|
|||
}
|
||||
|
||||
|
||||
void Workspace::lowerClient(Client* c, bool nogroup)
|
||||
void Workspace::lowerClient(AbstractClient* c, bool nogroup)
|
||||
{
|
||||
if (!c)
|
||||
return;
|
||||
|
@ -313,7 +313,7 @@ void Workspace::lowerClient(Client* c, bool nogroup)
|
|||
unconstrained_stacking_order.prepend(c);
|
||||
if (!nogroup && c->isTransient()) {
|
||||
// lower also all windows in the group, in their reversed stacking order
|
||||
ClientList wins = ensureStackingOrder(c->group()->members());
|
||||
ClientList wins = ensureStackingOrder(static_cast<Client*>(c)->group()->members());
|
||||
for (int i = wins.size() - 1;
|
||||
i >= 0;
|
||||
--i) {
|
||||
|
@ -356,7 +356,7 @@ void Workspace::lowerClientWithinApplication(Client* c)
|
|||
// ignore mainwindows
|
||||
}
|
||||
|
||||
void Workspace::raiseClient(Client* c, bool nogroup)
|
||||
void Workspace::raiseClient(AbstractClient* c, bool nogroup)
|
||||
{
|
||||
if (!c)
|
||||
return;
|
||||
|
@ -367,7 +367,7 @@ void Workspace::raiseClient(Client* c, bool nogroup)
|
|||
|
||||
if (!nogroup && c->isTransient()) {
|
||||
ClientList transients;
|
||||
Client *transient_parent = c;
|
||||
Client *transient_parent = static_cast<Client*>(c);
|
||||
while ((transient_parent = transient_parent->transientFor()))
|
||||
transients << transient_parent;
|
||||
foreach (transient_parent, transients)
|
||||
|
|
|
@ -174,14 +174,14 @@ public:
|
|||
|
||||
QPoint adjustClientPosition(Client* c, QPoint pos, bool unrestricted, double snapAdjust = 1.0);
|
||||
QRect adjustClientSize(Client* c, QRect moveResizeGeom, int mode);
|
||||
void raiseClient(Client* c, bool nogroup = false);
|
||||
void lowerClient(Client* c, bool nogroup = false);
|
||||
void raiseClient(AbstractClient* c, bool nogroup = false);
|
||||
void lowerClient(AbstractClient* c, bool nogroup = false);
|
||||
void raiseClientRequest(Client* c, NET::RequestSource src, xcb_timestamp_t timestamp);
|
||||
void lowerClientRequest(Client* c, NET::RequestSource src, xcb_timestamp_t timestamp);
|
||||
void restackClientUnderActive(Client*);
|
||||
void restack(AbstractClient *c, AbstractClient *under, bool force = false);
|
||||
void updateClientLayer(Client* c);
|
||||
void raiseOrLowerClient(Client*);
|
||||
void raiseOrLowerClient(AbstractClient*);
|
||||
void resetUpdateToolWindowsTimer();
|
||||
void restoreSessionStackingOrder(Client* c);
|
||||
void updateStackingOrder(bool propagate_new_clients = false);
|
||||
|
@ -515,7 +515,7 @@ private:
|
|||
|
||||
Client* active_client;
|
||||
Client* last_active_client;
|
||||
Client* most_recently_raised; // Used ONLY by raiseOrLowerClient()
|
||||
AbstractClient* most_recently_raised; // Used ONLY by raiseOrLowerClient()
|
||||
Client* movingClient;
|
||||
|
||||
// Delay(ed) window focus timer and client
|
||||
|
|
Loading…
Reference in a new issue