introduce SkipTaskbar

support the skipTaskbar property in the window model
that property is set client side by
PlasmaShell::setSkipTaskbar
REVIEW:125453
This commit is contained in:
Marco Martin 2015-09-29 20:23:18 +02:00
parent ac4ef26990
commit 27667222a4
4 changed files with 41 additions and 3 deletions

View file

@ -50,7 +50,7 @@ private:
static const quint32 s_version;
};
const quint32 PlasmaShellInterface::Private::s_version = 1;
const quint32 PlasmaShellInterface::Private::s_version = 2;
PlasmaShellInterface::Private::Private(PlasmaShellInterface *q, Display *d)
: Global::Private(d, &org_kde_plasma_shell_interface, s_version)
@ -75,6 +75,7 @@ public:
Role m_role;
bool m_positionSet = false;
PanelBehavior m_panelBehavior = PanelBehavior::AlwaysVisible;
bool m_skipTaskbar = false;
private:
// interface callbacks
@ -83,6 +84,7 @@ private:
static void setPositionCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y);
static void setRoleCallback(wl_client *client, wl_resource *resource, uint32_t role);
static void setPanelBehaviorCallback(wl_client *client, wl_resource *resource, uint32_t flag);
static void setSkipTaskbarCallback(wl_client *client, wl_resource *resource, uint32_t skip);
void setPosition(const QPoint &globalPos);
void setRole(uint32_t role);
@ -156,7 +158,8 @@ const struct org_kde_plasma_surface_interface PlasmaShellSurfaceInterface::Priva
setOutputCallback,
setPositionCallback,
setRoleCallback,
setPanelBehaviorCallback
setPanelBehaviorCallback,
setSkipTaskbarCallback
};
#endif
@ -254,6 +257,14 @@ void PlasmaShellSurfaceInterface::Private::setPanelBehaviorCallback(wl_client *c
s->setPanelBehavior(org_kde_plasma_surface_panel_behavior(flag));
}
void PlasmaShellSurfaceInterface::Private::setSkipTaskbarCallback(wl_client *client, wl_resource *resource, uint32_t skip)
{
auto s = cast<Private>(resource);
Q_ASSERT(client == *s->client);
s->m_skipTaskbar = (bool)skip;
emit s->q_func()->skipTaskbarChanged();
}
void PlasmaShellSurfaceInterface::Private::setPanelBehavior(org_kde_plasma_surface_panel_behavior behavior)
{
PanelBehavior newBehavior = PanelBehavior::AlwaysVisible;
@ -303,5 +314,11 @@ PlasmaShellSurfaceInterface::PanelBehavior PlasmaShellSurfaceInterface::panelBeh
return d->m_panelBehavior;
}
bool PlasmaShellSurfaceInterface::skipTaskbar() const
{
Q_D();
return d->m_skipTaskbar;
}
}
}

View file

@ -129,6 +129,13 @@ public:
**/
PanelBehavior panelBehavior() const;
/**
* @returns true if this window doesn't want to be listed
* in the taskbar
* @since 5.5
*/
bool skipTaskbar() const;
Q_SIGNALS:
/**
* A change of global position has been requested.
@ -142,6 +149,10 @@ Q_SIGNALS:
* A change of the panel behavior has been requested.
**/
void panelBehaviorChanged();
/**
* A change in the skip taskbar property has been requested
*/
void skipTaskbarChanged();
private:
friend class PlasmaShellInterface;

View file

@ -99,7 +99,7 @@ private:
static const struct org_kde_plasma_window_interface s_interface;
};
const quint32 PlasmaWindowManagementInterface::Private::s_version = 1;
const quint32 PlasmaWindowManagementInterface::Private::s_version = 2;
PlasmaWindowManagementInterface::Private::Private(PlasmaWindowManagementInterface *q, Display *d)
: Global::Private(d, &org_kde_plasma_window_management_interface, s_version)
@ -434,6 +434,9 @@ void PlasmaWindowInterface::Private::setStateCallback(wl_client *client, wl_reso
if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREENABLE) {
emit p->q->fullscreenableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREENABLE);
}
if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPTASKBAR) {
emit p->q->skipTaskbarRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPTASKBAR);
}
}
PlasmaWindowInterface::PlasmaWindowInterface(PlasmaWindowManagementInterface *wm, QObject *parent)
@ -524,6 +527,11 @@ void PlasmaWindowInterface::setMinimizeable(bool set)
d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZABLE, set);
}
void PlasmaWindowInterface::setSkipTaskbar(bool set)
{
d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPTASKBAR, set);
}
void PlasmaWindowInterface::setThemedIconName(const QString &iconName)
{
d->setThemedIconName(iconName);

View file

@ -82,6 +82,7 @@ public:
void setMinimizeable(bool set);
void setMaximizeable(bool set);
void setFullscreenable(bool set);
void setSkipTaskbar(bool skip);
void setThemedIconName(const QString &iconName);
void unmap();
@ -100,6 +101,7 @@ Q_SIGNALS:
void minimizeableRequested(bool set);
void maximizeableRequested(bool set);
void fullscreenableRequested(bool set);
void skipTaskbarRequested(bool set);
private:
friend class PlasmaWindowManagementInterface;