Add visibleInClientGroup property

This commit is contained in:
Martin Gräßlin 2012-01-15 11:26:38 +01:00
parent 20add1c656
commit a38faa4329
6 changed files with 16 additions and 13 deletions

View file

@ -1903,6 +1903,14 @@ void Client::setClientGroup(ClientGroup* group)
emit clientGroupChanged(); emit clientGroupChanged();
} }
bool Client::isVisibleInClientGroup() const
{
if (!client_group) {
return true;
}
return (client_group->visible() == this);
}
void Client::dontMoveResize() void Client::dontMoveResize()
{ {
buttonDown = false; buttonDown = false;

View file

@ -222,6 +222,11 @@ class Client
* The "Window Tabs" Group this Client belongs to. * The "Window Tabs" Group this Client belongs to.
**/ **/
Q_PROPERTY(KWin::ClientGroup* clientGroup READ clientGroup NOTIFY clientGroupChanged) Q_PROPERTY(KWin::ClientGroup* clientGroup READ clientGroup NOTIFY clientGroupChanged)
/**
* Whether this Client is the currently visible Client in its Client Group (Window Tabs).
* For change connect to the visibleChanged signal on the Client's Group.
**/
Q_PROPERTY(bool visibleInClientGroup READ isVisibleInClientGroup)
/** /**
* Minimum size as specified in WM_NORMAL_HINTS * Minimum size as specified in WM_NORMAL_HINTS
**/ **/
@ -510,6 +515,7 @@ public:
* client, this function stops it. * client, this function stops it.
*/ */
void dontMoveResize(); void dontMoveResize();
bool isVisibleInClientGroup() const;
/** /**
* Whether or not the window has a strut that expands through the invisible area of * Whether or not the window has a strut that expands through the invisible area of

View file

@ -1450,16 +1450,6 @@ WindowQuadList EffectWindowImpl::buildQuads(bool force) const
return sceneWindow()->buildQuads(force); return sceneWindow()->buildQuads(force);
} }
bool EffectWindowImpl::visibleInClientGroup() const
{
if (Client* c = dynamic_cast< Client* >(toplevel)) {
if (!c->clientGroup())
return true;
return c == c->clientGroup()->visible();
}
return false;
}
void EffectWindowImpl::setData(int role, const QVariant &data) void EffectWindowImpl::setData(int role, const QVariant &data)
{ {
if (!data.isNull()) if (!data.isNull())

View file

@ -253,8 +253,6 @@ public:
virtual WindowQuadList buildQuads(bool force = false) const; virtual WindowQuadList buildQuads(bool force = false) const;
virtual bool visibleInClientGroup() const;
const Toplevel* window() const; const Toplevel* window() const;
Toplevel* window(); Toplevel* window();

View file

@ -380,6 +380,7 @@ WINDOW_HELPER_DEFAULT(bool, isSpecialWindow, "specialWindow", true)
WINDOW_HELPER_DEFAULT(bool, acceptsFocus, "wantsInput", true) // We don't actually know... WINDOW_HELPER_DEFAULT(bool, acceptsFocus, "wantsInput", true) // We don't actually know...
WINDOW_HELPER_DEFAULT(QPixmap, icon, "icon", QPixmap()) WINDOW_HELPER_DEFAULT(QPixmap, icon, "icon", QPixmap())
WINDOW_HELPER_DEFAULT(bool, isSkipSwitcher, "skipSwitcher", false) WINDOW_HELPER_DEFAULT(bool, isSkipSwitcher, "skipSwitcher", false)
WINDOW_HELPER_DEFAULT(bool, visibleInClientGroup, "visibleInClientGroup", false)
#undef WINDOW_HELPER_DEFAULT #undef WINDOW_HELPER_DEFAULT

View file

@ -1273,7 +1273,7 @@ public:
void unminimize(); void unminimize();
void closeWindow() const; void closeWindow() const;
virtual bool visibleInClientGroup() const = 0; bool visibleInClientGroup() const;
/** /**
* Can be used to by effects to store arbitrary data in the EffectWindow. * Can be used to by effects to store arbitrary data in the EffectWindow.