kwin and plasma tasks applet activities cleanup

This commit is contained in:
Ivailo Monev 2014-12-08 23:19:10 +00:00
parent 39738a730f
commit adc2ea8512
31 changed files with 24 additions and 330 deletions

View file

@ -400,7 +400,7 @@ void Workspace::handleTakeActivity(KWin::Client *c, xcb_timestamp_t /*timestamp*
*/
void Workspace::clientHidden(Client* c)
{
assert(!c->isShown(true) || !c->isOnCurrentDesktop() || !c->isOnCurrentActivity());
assert(!c->isShown(true) || !c->isOnCurrentDesktop());
activateNextClient(c);
}
@ -416,7 +416,7 @@ Client *Workspace::clientUnderMouse(int screen) const
// rule out clients which are not really visible.
// the screen test is rather superfluous for xrandr & twinview since the geometry would differ -> TODO: might be dropped
if (!(client->isShown(false) && client->isOnCurrentDesktop() &&
client->isOnCurrentActivity() && client->isOnScreen(screen)))
client->isOnScreen(screen)))
continue;
if (client->geometry().contains(Cursor::pos())) {

View file

@ -90,8 +90,6 @@ Client::Client()
, m_wrapper()
, decoration(NULL)
, bridge(new Bridge(this))
, m_activityUpdatesBlocked(false)
, m_blockedActivityUpdatesRequireTransients(false)
, m_moveResizeGrabWindow()
, move_resize_has_keyboard_grab(false)
, m_managed(false)
@ -130,7 +128,6 @@ Client::Client()
, paintRedirector(0)
, m_firstInTabBox(false)
, electricMaximizing(false)
, activitiesDefined(false)
, needsSessionInteract(false)
, needsXWindowMove(false)
#ifdef KWIN_BUILD_KAPPMENU
@ -1093,13 +1090,6 @@ void Client::updateVisibility()
internalHide();
return;
}
if (!isOnCurrentActivity()) {
if (compositing() && options->hiddenPreviews() != HiddenPreviewsNever)
internalKeep();
else
internalHide();
return;
}
if (isManaged())
resetShowingDesktop(true);
internalShow();
@ -1489,59 +1479,6 @@ void Client::setDesktop(int desktop)
emit desktopPresenceChanged(this, was_desk);
}
/**
* Sets whether the client is on @p activity.
* If you remove it from its last activity, then it's on all activities.
*
* Note: If it was on all activities and you try to remove it from one, nothing will happen;
* I don't think that's an important enough use case to handle here.
*/
void Client::setOnActivity(const QString &activity, bool enable)
{
Q_UNUSED(activity)
Q_UNUSED(enable)
}
/**
* set exactly which activities this client is on
*/
void Client::setOnActivities(QStringList newActivitiesList)
{
Q_UNUSED(newActivitiesList)
}
void Client::blockActivityUpdates(bool b)
{
if (b) {
++m_activityUpdatesBlocked;
} else {
Q_ASSERT(m_activityUpdatesBlocked);
--m_activityUpdatesBlocked;
if (!m_activityUpdatesBlocked)
updateActivities(m_blockedActivityUpdatesRequireTransients);
}
}
/**
* update after activities changed
*/
void Client::updateActivities(bool includeTransients)
{
if (m_activityUpdatesBlocked) {
m_blockedActivityUpdatesRequireTransients |= includeTransients;
return;
}
emit activitiesChanged(this);
m_blockedActivityUpdatesRequireTransients = false; // reset
FocusChain::self()->update(this, FocusChain::MakeFirst);
updateVisibility();
updateWindowRules(Rules::Activity);
// Update states of all other windows in this group
if (tabGroup())
tabGroup()->updateStates(this, TabGroup::Activity);
}
/**
* Returns the virtual desktop within the workspace() the client window
* is located in, 0 if it isn't located on any special desktop (not mapped yet),
@ -1556,19 +1493,6 @@ int Client::desktop() const
return desk;
}
/**
* Returns the list of activities the client window is on.
* if it's on all activities, the list will be empty.
* Don't use this, use isOnActivity() and friends (from class Toplevel)
*/
QStringList Client::activities() const
{
if (needsSessionInteract) {
return QStringList();
}
return activityList;
}
void Client::setOnAllDesktops(bool b)
{
if ((b && isOnAllDesktops()) ||
@ -1584,14 +1508,6 @@ void Client::setOnAllDesktops(bool b)
tabGroup()->updateStates(this, TabGroup::Desktop);
}
/**
* if @p on is true, sets on all activities.
* if it's false, sets it to only be on the current activity
*/
void Client::setOnAllActivities(bool on)
{
}
/**
* Performs activation and/or raising of the window
*/
@ -2064,10 +1980,10 @@ void Client::getWindowProtocols()
Pdeletewindow = 1;
else if (p[i] == atoms->wm_take_focus)
Ptakefocus = 1;
else if (p[i] == atoms->net_wm_take_activity)
Ptakeactivity = 1;
else if (p[i] == atoms->net_wm_context_help)
Pcontexthelp = 1;
else if (p[i] == atoms->net_wm_take_activity)
Ptakeactivity = 1;
else if (p[i] == atoms->net_wm_ping)
Pping = 1;
}
@ -2322,10 +2238,6 @@ QPixmap* kwin_get_menu_pix_hack()
return &p;
}
void Client::checkActivities()
{
}
void Client::setSessionInteract(bool needed)
{
needsSessionInteract = needed;

View file

@ -348,13 +348,6 @@ public:
void sendToScreen(int screen);
virtual QStringList activities() const;
void setOnActivity(const QString &activity, bool enable);
void setOnAllActivities(bool set);
void setOnActivities(QStringList newActivitiesList);
void updateActivities(bool includeTransients);
void blockActivityUpdates(bool b = true);
/// Is not minimized and not hidden. I.e. normally visible on some virtual desktop.
bool isShown(bool shaded_is_shown) const;
bool isHiddenInternal() const; // For compositing
@ -841,9 +834,6 @@ private:
KDecoration* decoration;
Bridge* bridge;
int desk;
QStringList activityList;
int m_activityUpdatesBlocked;
bool m_blockedActivityUpdatesRequireTransients;
bool buttonDown;
bool moveResizeMode;
Xcb::Window m_moveResizeGrabWindow;
@ -984,9 +974,6 @@ private:
friend bool performTransiencyCheck();
void checkActivities();
bool activitiesDefined; //whether the x property was actually set
bool needsSessionInteract;
bool needsXWindowMove;

View file

@ -126,16 +126,6 @@ WRAP(bool, waitForCompositingSetup)
#undef WRAP
bool DBusInterface::startActivity(const QString &in0)
{
return false;
}
bool DBusInterface::stopActivity(const QString &in0)
{
return false;
}
void DBusInterface::doNotManage(const QString &name)
{
Q_UNUSED(name)

View file

@ -78,8 +78,6 @@ public Q_SLOTS: // METHODS
* @deprecated
**/
void showWindowMenuAt(qlonglong winId, int x, int y);
bool startActivity(const QString &in0);
bool stopActivity(const QString &in0);
QString supportInformation();
Q_NOREPLY void unclutterDesktop();
// from compositor

View file

@ -74,7 +74,6 @@ void Deleted::copyToDeleted(Toplevel* c)
assert(dynamic_cast< Deleted* >(c) == NULL);
Toplevel::copyToDeleted(c);
desk = c->desktop();
activityList = c->activities();
contentsRect = QRect(c->clientPos(), c->clientSize());
transparent_rect = c->transparentRect();
m_layer = c->layer();
@ -125,11 +124,6 @@ int Deleted::desktop() const
return desk;
}
QStringList Deleted::activities() const
{
return activityList;
}
QPoint Deleted::clientPos() const
{
return contentsRect.topLeft();

View file

@ -40,7 +40,6 @@ public:
void unrefWindow();
void discard();
virtual int desktop() const;
virtual QStringList activities() const;
virtual QPoint clientPos() const;
virtual QSize clientSize() const;
virtual QRect transparentRect() const;
@ -81,7 +80,6 @@ private:
int delete_refcount;
double window_opacity;
int desk;
QStringList activityList;
QRect contentsRect; // for clientPos()/clientSize()
QRect transparent_rect;

View file

@ -36,9 +36,6 @@ effects['desktopChanged(int,int)'].connect(function(oldDesktop, newDesktop) {
if (w.minimized) {
continue;
}
if (!w.isOnActivity(effects.currentActivity)){
continue;
}
if (w.desktop == oldDesktop) {
effect.animate(w, Effect.Opacity, duration, 0.0);
} else {

View file

@ -719,8 +719,6 @@ void Client::propertyNotifyEvent(XPropertyEvent* e)
getMotifHints();
else if (e->atom == atoms->net_wm_sync_request_counter)
getSyncCounter();
else if (e->atom == atoms->activities)
checkActivities();
else if (e->atom == atoms->kde_net_wm_block_compositing)
updateCompositeBlocking(true);
else if (e->atom == atoms->kde_first_in_window_list)

View file

@ -70,15 +70,6 @@ Client *FocusChain::getForActivation(uint desktop, int screen) const
if (it == m_desktopFocusChains.constEnd()) {
return NULL;
}
const QList<Client*> &chain = it.value();
for (int i = chain.size() - 1; i >= 0; --i) {
Client *tmp = chain.at(i);
// TODO: move the check into Client
if (tmp->isShown(false) && tmp->isOnCurrentActivity()
&& ( !m_separateScreenFocus || tmp->screen() == screen)) {
return tmp;
}
}
return NULL;
}
@ -212,7 +203,7 @@ Client *FocusChain::nextMostRecentlyUsed(Client *reference) const
bool FocusChain::isUsableFocusCandidate(Client *c, Client *prev) const
{
return c != prev &&
c->isShown(false) && c->isOnCurrentDesktop() && c->isOnCurrentActivity() &&
c->isShown(false) && c->isOnCurrentDesktop() &&
(!m_separateScreenFocus || c->isOnScreen(prev ? prev->screen() : screens()->current()));
}

View file

@ -476,8 +476,6 @@ QPoint Workspace::adjustClientPosition(Client* c, QPoint pos, bool unrestricted,
continue; // is not active tab
if (!((*l)->isOnDesktop(c->desktop()) || c->isOnDesktop((*l)->desktop())))
continue; // wrong virtual desktop
if (!(*l)->isOnCurrentActivity())
continue; // wrong activity
if ((*l)->isDesktop() || (*l)->isSplash())
continue;

View file

@ -251,7 +251,7 @@ Client* Workspace::topClientOnDesktop(int desktop, int screen, bool unconstraine
if (!c) {
continue;
}
if (c->isOnDesktop(desktop) && c->isShown(false) && c->isOnCurrentActivity()) {
if (c->isOnDesktop(desktop) && c->isShown(false)) {
if (screen != -1 && c->screen() != screen)
continue;
if (!only_normal)
@ -382,7 +382,6 @@ void Workspace::raiseClient(Client* c, bool nogroup)
if (!c->isSpecialWindow()) {
most_recently_raised = c;
pending_take_activity = NULL;
}
}
@ -743,7 +742,7 @@ void Client::restackWindow(xcb_window_t above, int detail, NET::RequestSource sr
Client *c = qobject_cast<Client*>(*it);
if (!c || !( (*it)->isNormalWindow() && c->isShown(true) &&
(*it)->isOnCurrentDesktop() && (*it)->isOnCurrentActivity() && (*it)->isOnScreen(screen()) ))
(*it)->isOnCurrentDesktop() && (*it)->isOnScreen(screen()) ))
continue; // irrelevant clients
if (*(it - 1) == other)

View file

@ -709,7 +709,6 @@ WINDOW_HELPER(bool, isManaged, "managed")
WINDOW_HELPER(bool, isDeleted, "deleted")
WINDOW_HELPER(bool, hasOwnShape, "shaped")
WINDOW_HELPER(QString, windowRole, "windowRole")
WINDOW_HELPER(QStringList, activities, "activities")
WINDOW_HELPER(bool, skipsCloseAnimation, "skipsCloseAnimation")
QString EffectWindow::windowClass() const
@ -727,17 +726,6 @@ NET::WindowType EffectWindow::windowType() const
return static_cast<NET::WindowType>(parent()->property("windowType").toInt());
}
bool EffectWindow::isOnActivity(QString activity) const
{
const QStringList activities = parent()->property("activities").toStringList();
return activities.isEmpty() || activities.contains(activity);
}
bool EffectWindow::isOnAllActivities() const
{
return parent()->property("activities").toStringList().isEmpty();
}
#undef WINDOW_HELPER
#define WINDOW_HELPER_DEFAULT( rettype, prototype, propertyname, defaultValue ) \
@ -822,10 +810,6 @@ void EffectWindow::addLayerRepaint(const QRect &r)
QMetaObject::invokeMethod(parent(), "addLayerRepaint", Q_ARG(const QRect&, r));
}
bool EffectWindow::isOnCurrentActivity() const
{
return isOnActivity(effects->currentActivity());
}
bool EffectWindow::isOnCurrentDesktop() const
{
@ -849,9 +833,7 @@ bool EffectWindow::hasDecoration() const
bool EffectWindow::isVisible() const
{
return !isMinimized()
&& isOnCurrentDesktop()
&& isOnCurrentActivity();
return !isMinimized() && isOnCurrentDesktop();
}

View file

@ -599,7 +599,6 @@ class KWIN_EXPORT EffectsHandler : public QObject
{
Q_OBJECT
Q_PROPERTY(int currentDesktop READ currentDesktop WRITE setCurrentDesktop NOTIFY desktopChanged)
Q_PROPERTY(QString currentActivity READ currentActivity NOTIFY currentActivityChanged)
Q_PROPERTY(KWin::EffectWindow *activeWindow READ activeWindow WRITE activateWindow NOTIFY windowActivated)
Q_PROPERTY(QSize desktopGridSize READ desktopGridSize)
Q_PROPERTY(int desktopGridWidth READ desktopGridWidth)
@ -698,12 +697,6 @@ public:
Q_SCRIPTABLE virtual void windowToScreen(KWin::EffectWindow* w, int screen) = 0;
virtual void setShowingDesktop(bool showing) = 0;
// Activities
/**
* @returns The ID of the current activity.
*/
virtual QString currentActivity() const = 0;
// Desktops
/**
* @returns The ID of the current desktop.
@ -1181,26 +1174,6 @@ Q_SIGNALS:
**/
void screenGeometryChanged(const QSize &size);
/**
* This signal is emitted when the global
* activity is changed
* @param id id of the new current activity
* @since 4.9
**/
void currentActivityChanged(const QString &id);
/**
* This signal is emitted when a new activity is added
* @param id id of the new activity
* @since 4.9
*/
void activityAdded(const QString &id);
/**
* This signal is emitted when the activity
* is removed
* @param id id of the removed activity
* @since 4.9
*/
void activityRemoved(const QString &id);
/**
* This signal is emitted when the screen got locked or unlocked.
* @param locked @c true if the screen is now locked, @c false if it is now unlocked
@ -1422,9 +1395,6 @@ class KWIN_EXPORT EffectWindow : public QObject
*/
Q_PROPERTY(QRect decorationInnerRect READ decorationInnerRect)
Q_PROPERTY(bool hasDecoration READ hasDecoration)
Q_PROPERTY(QStringList activities READ activities)
Q_PROPERTY(bool onCurrentActivity READ isOnCurrentActivity)
Q_PROPERTY(bool onAllActivities READ isOnAllActivities)
/**
* Whether the decoration currently uses an alpha channel.
* @since 4.10
@ -1435,7 +1405,6 @@ class KWIN_EXPORT EffectWindow : public QObject
* <ul>
* <li>Not minimized</li>
* <li>On current desktop</li>
* <li>On current activity</li>
* </ul>
* @since 4.11
**/
@ -1460,8 +1429,6 @@ public:
PAINT_DISABLED_BY_MINIMIZE = 1 << 3,
/** Window will not be painted because it is not the active window in a client group */
PAINT_DISABLED_BY_TAB_GROUP = 1 << 4,
/** Window will not be painted because it's not on the current activity */
PAINT_DISABLED_BY_ACTIVITY = 1 << 5
};
explicit EffectWindow(QObject *parent = NULL);
@ -1484,11 +1451,6 @@ public:
double opacity() const;
bool hasAlpha() const;
bool isOnCurrentActivity() const;
Q_SCRIPTABLE bool isOnActivity(QString id) const;
bool isOnAllActivities() const;
QStringList activities() const;
bool isOnDesktop(int d) const;
bool isOnCurrentDesktop() const;
bool isOnAllDesktops() const;

View file

@ -157,14 +157,11 @@ bool Client::manage(xcb_window_t w, bool isMapped)
init_minimize = rules()->checkMinimize(init_minimize, !isMapped);
noborder = rules()->checkNoBorder(noborder, !isMapped);
checkActivities();
// Initial desktop placement
if (session) {
desk = session->desktop;
if (session->onAllDesktops)
desk = NET::OnAllDesktops;
setOnActivities(session->activities);
} else {
// If this window is transient, ensure that it is opened on the
// same window as its parent. this is necessary when an application
@ -192,9 +189,6 @@ bool Client::manage(xcb_window_t w, bool isMapped)
desk = VirtualDesktopManager::self()->current();
else if (maincl != NULL)
desk = maincl->desktop();
if (maincl)
setOnActivities(maincl->activities());
}
if (info->desktop())
desk = info->desktop(); // Window had the initial desktop property, force it
@ -211,11 +205,6 @@ bool Client::manage(xcb_window_t w, bool isMapped)
workspace()->updateOnAllDesktopsOfTransients(this); // SELI TODO
//onAllDesktopsChange(); // Decoration doesn't exist here yet
QString activitiesList;
activitiesList = rules()->checkActivity(activitiesList, !isMapped);
if (!activitiesList.isEmpty())
setOnActivities(activitiesList.split(','));
QRect geom(attr.x, attr.y, attr.width, attr.height);
bool placementDone = false;
@ -319,7 +308,7 @@ bool Client::manage(xcb_window_t w, bool isMapped)
foreach (Client *other, workspace()->clientList()) {
if (other->maximizeMode() != MaximizeFull &&
geom == QRect(other->pos(), other->clientSize()) &&
desk == other->desktop() && activities() == other->activities()) {
desk == other->desktop()) {
tabBehind(other, autogroupInFg);
break;
@ -567,9 +556,6 @@ bool Client::manage(xcb_window_t w, bool isMapped)
if (!isOnCurrentDesktop() && options->focusPolicyIsReasonable()) {
VirtualDesktopManager::self()->setCurrent(desktop());
}
/*if (!isOnCurrentActivity()) {
workspace()->setCurrentActivity( activities().first() );
} FIXME no such method*/
}
}
@ -715,8 +701,6 @@ Client* Client::findAutogroupCandidate() const
QString wGId = rules()->checkAutogroupById(QString());
if (!wGId.isEmpty()) {
foreach (Client *c, workspace()->clientList()) {
if (activities() != c->activities())
continue; // don't cross activities
if (wGId == c->rules()->checkAutogroupById(QString())) {
if (found && found->tabGroup() != c->tabGroup()) { // We've found two, ignore both
found = NULL;
@ -737,7 +721,7 @@ Client* Client::findAutogroupCandidate() const
if (rules()->checkAutogrouping(options->isAutogroupSimilarWindows())) {
QByteArray wRole = truncatedWindowRole(windowRole());
foreach (Client *c, workspace()->clientList()) {
if (desktop() != c->desktop() || activities() != c->activities())
if (desktop() != c->desktop())
continue;
QByteArray wRoleB = truncatedWindowRole(c->windowRole());
if (resourceClass() == c->resourceClass() && // Same resource class

View file

@ -73,14 +73,6 @@
<arg type="ai" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;int>"/>
</method>
<method name="stopActivity">
<arg type="s" direction="in"/>
<arg type="b" direction="out"/>
</method>
<method name="startActivity">
<arg type="s" direction="in"/>
<arg type="b" direction="out"/>
</method>
<method name="activeEffects">
<arg type="as" direction="out"/>
</method>

View file

@ -178,8 +178,6 @@ static inline bool isIrrelevant(const Client *client, const Client *regarding, i
return true;
if (!client->isOnDesktop(desktop))
return true;
if (!client->isOnCurrentActivity())
return true;
if (client->isDesktop())
return true;
return false;

View file

@ -470,12 +470,6 @@ bool Rules::update(Client* c, int selection)
updated = updated || screen != c->screen();
screen = c->screen();
}
if NOW_REMEMBER(Activity, activity) {
// TODO: ivan - multiple activities support
const QString & joinedActivities = c->activities().join(",");
updated = updated || activity != joinedActivities;
activity = joinedActivities;
}
if NOW_REMEMBER(MaximizeVert, maximizevert) {
updated = updated || maximizevert != bool(c->maximizeMode() & MaximizeVertical);
maximizevert = c->maximizeMode() & MaximizeVertical;
@ -860,7 +854,6 @@ void Client::applyWindowRules()
// IgnoreGeometry
setDesktop(desktop());
workspace()->sendClientToScreen(this, screen());
setOnActivities(activities());
// Type
maximize(maximizeMode());
// Minimize : functions don't check, and there are two functions

View file

@ -717,8 +717,6 @@ bool Scene::Window::isVisible() const
return false;
if (!toplevel->isOnCurrentDesktop())
return false;
if (!toplevel->isOnCurrentActivity())
return false;
if (toplevel->isClient())
return (static_cast< Client *>(toplevel))->isShown(true);
return true; // Unmanaged is always visible
@ -747,8 +745,6 @@ void Scene::Window::resetPaintingEnabled()
if (!toplevel->isOnCurrentDesktop())
disable_painting |= PAINT_DISABLED_BY_DESKTOP;
}
if (!toplevel->isOnCurrentActivity())
disable_painting |= PAINT_DISABLED_BY_ACTIVITY;
if (toplevel->isClient()) {
Client *c = static_cast<Client*>(toplevel);
if (c->isMinimized())

View file

@ -217,8 +217,6 @@ public:
PAINT_DISABLED_BY_MINIMIZE = 1 << 3,
// Window will not be painted because it is not the active window in a client group
PAINT_DISABLED_BY_TAB_GROUP = 1 << 4,
// Window will not be painted because it's not on the current activity
PAINT_DISABLED_BY_ACTIVITY = 1 << 5
};
void enablePainting(int reason);
void disablePainting(int reason);

View file

@ -149,7 +149,6 @@ void Workspace::storeClient(KConfigGroup &cg, int num, Client *c)
cg.writeEntry(QString("stackingOrder") + n, unconstrained_stacking_order.indexOf(c));
// KConfig doesn't support long so we need to live with less precision on 64-bit systems
cg.writeEntry(QString("tabGroup") + n, static_cast<int>(reinterpret_cast<long>(c->tabGroup())));
cg.writeEntry(QString("activities") + n, c->activities());
}
void Workspace::storeSubSession(const QString &name, QSet<QByteArray> sessionIds)
@ -229,7 +228,6 @@ void Workspace::addSessionInfo(KConfigGroup &cg)
info->stackingOrder = cg.readEntry(QString("stackingOrder") + n, -1);
info->tabGroup = cg.readEntry(QString("tabGroup") + n, 0);
info->tabGroupClient = NULL;
info->activities = cg.readEntry(QString("activities") + n, QStringList());
}
}

View file

@ -166,20 +166,6 @@ bool TabBoxHandlerImpl::checkDesktop(TabBoxClient* client, int desktop) const
}
}
bool TabBoxHandlerImpl::checkActivity(TabBoxClient* client) const
{
Client* current = (static_cast< TabBoxClientImpl* >(client))->client();
switch (config().clientActivitiesMode()) {
case TabBoxConfig::AllActivitiesClients:
return true;
case TabBoxConfig::ExcludeCurrentActivityClients:
return !current->isOnCurrentActivity();
default: // TabBoxConfig::OnlyCurrentActivityClients
return current->isOnCurrentActivity();
}
}
bool TabBoxHandlerImpl::checkApplications(TabBoxClient* client) const
{
Client* current = (static_cast< TabBoxClientImpl* >(client))->client();
@ -253,7 +239,6 @@ QWeakPointer<TabBoxClient> TabBoxHandlerImpl::clientToAddToList(TabBoxClient* cl
Client* current = (static_cast< TabBoxClientImpl* >(client))->client();
bool addClient = checkDesktop(client, desktop)
&& checkActivity(client)
&& checkApplications(client)
&& checkMinimized(client)
&& checkMultiScreen(client);
@ -1253,7 +1238,7 @@ void TabBox::CDEWalkThroughWindows(bool forward)
i >= 0 ;
--i) {
Client* it = qobject_cast<Client*>(Workspace::self()->stackingOrder().at(i));
if (it && it->isOnCurrentActivity() && it->isOnCurrentDesktop() && !it->isSpecialWindow()
if (it && it->isOnCurrentDesktop() && !it->isSpecialWindow()
&& it->isShown(false) && it->wantsTabFocus()
&& !it->keepAbove() && !it->keepBelow()) {
c = it;
@ -1281,7 +1266,7 @@ void TabBox::CDEWalkThroughWindows(bool forward)
}
} while (nc && nc != c &&
((!options_traverse_all && !nc->isOnDesktop(currentDesktop())) ||
nc->isMinimized() || !nc->wantsTabFocus() || nc->keepAbove() || nc->keepBelow() || !nc->isOnCurrentActivity()));
nc->isMinimized() || !nc->wantsTabFocus() || nc->keepAbove() || nc->keepBelow()));
if (nc) {
if (c && c != nc)
Workspace::self()->lowerClient(c);

View file

@ -70,7 +70,6 @@ public:
private:
bool checkDesktop(TabBoxClient* client, int desktop) const;
bool checkActivity(TabBoxClient* client) const;
bool checkApplications(TabBoxClient* client) const;
bool checkMinimized(TabBoxClient* client) const;
bool checkMultiScreen(TabBoxClient* client) const;

View file

@ -338,9 +338,6 @@ void TabGroup::updateStates(Client* main, States states, Client* only)
if (c->desktop() != main->desktop())
c->setDesktop(main->desktop());
}
if ((states & Activity) && c->activities() != main->activities()) {
c->setOnActivities(main->activities());
}
if (states & Layer) {
if (c->keepAbove() != main->keepAbove())
c->setKeepAbove(main->keepAbove());

View file

@ -446,11 +446,6 @@ bool Toplevel::isDeleted() const
return false;
}
bool Toplevel::isOnCurrentActivity() const
{
return true;
}
void Toplevel::elevate(bool elevate)
{
if (!effectWindow()) {

View file

@ -149,7 +149,6 @@ class Toplevel
* See http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .
*/
Q_PROPERTY(int windowType READ windowType)
Q_PROPERTY(QStringList activities READ activities NOTIFY activitiesChanged)
/**
* Whether this Toplevel is managed by KWin (it has control over its placement and other
* aspects, as opposed to override-redirect windows that are entirely handled by the application).
@ -213,13 +212,9 @@ public:
bool isDNDIcon() const;
virtual int desktop() const = 0;
virtual QStringList activities() const = 0;
bool isOnDesktop(int d) const;
bool isOnActivity(const QString &activity) const;
bool isOnCurrentDesktop() const;
bool isOnCurrentActivity() const;
bool isOnAllDesktops() const;
bool isOnAllActivities() const;
QByteArray windowRole() const;
QByteArray sessionId() const;
@ -335,7 +330,6 @@ signals:
* schedule a repaint of the scene.
**/
void needsRepaint();
void activitiesChanged(KWin::Toplevel* toplevel);
/**
* Emitted whenever the Toplevel's screen changes. This can happen either in consequence to
* a screen being removed/added or if the Toplevel's geometry changes.
@ -613,21 +607,11 @@ inline bool Toplevel::isOnAllDesktops() const
return desktop() == NET::OnAllDesktops;
}
inline bool Toplevel::isOnAllActivities() const
{
return activities().isEmpty();
}
inline bool Toplevel::isOnDesktop(int d) const
{
return desktop() == d || /*desk == 0 ||*/ isOnAllDesktops();
}
inline bool Toplevel::isOnActivity(const QString &activity) const
{
return activities().isEmpty() || activities().contains(activity);
}
inline bool Toplevel::isOnCurrentDesktop() const
{
return isOnDesktop(VirtualDesktopManager::self()->current());

View file

@ -160,13 +160,9 @@ void UserActionsMenu::show(const QRect &pos, const QWeakPointer<Client> &cl)
int x = pos.left();
int y = pos.bottom();
if (y == pos.top()) {
m_client.data()->blockActivityUpdates(true);
m_menu->exec(QPoint(x, y));
if (!m_client.isNull())
m_client.data()->blockActivityUpdates(false);
}
else {
m_client.data()->blockActivityUpdates(true);
QRect area = ws->clientArea(ScreenArea, QPoint(x, y), VirtualDesktopManager::self()->current());
menuAboutToShow(); // needed for sizeHint() to be correct :-/
int popupHeight = m_menu->sizeHint().height();
@ -174,8 +170,6 @@ void UserActionsMenu::show(const QRect &pos, const QWeakPointer<Client> &cl)
m_menu->exec(QPoint(x, y));
else
m_menu->exec(QPoint(x, pos.top() - popupHeight));
if (!m_client.isNull())
m_client.data()->blockActivityUpdates(true);
}
}
@ -1158,7 +1152,7 @@ bool Client::performMouseCommand(Options::MouseCommand command, const QPoint &gl
Client *c = qobject_cast<Client*>(*it);
if (!c || (c->keepAbove() && !keepAbove()) || (keepBelow() && !c->keepBelow()))
continue; // can never raise above "it"
mustReplay = !(c->isOnCurrentDesktop() && c->isOnCurrentActivity() && c->geometry().intersects(geometry()));
mustReplay = !(c->isOnCurrentDesktop() && c->geometry().intersects(geometry()));
}
}
workspace()->takeActivity(this, ActivityFocus | ActivityRaise, handled && replay);
@ -1652,7 +1646,7 @@ void Workspace::switchWindow(Direction direction)
continue;
}
if (client->wantsTabFocus() && *i != c &&
client->desktop() == d && !client->isMinimized() && (*i)->isOnCurrentActivity()) {
client->desktop() == d && !client->isMinimized()) {
// Centre of the other window
QPoint other(client->pos().x() + client->geometry().width() / 2,
client->pos().y() + client->geometry().height() / 2);

View file

@ -930,7 +930,7 @@ void Workspace::updateClientVisibilityOnDesktopChange(uint oldDesktop, uint newD
if (!c) {
continue;
}
if (!c->isOnDesktop(newDesktop) && c != movingClient && c->isOnCurrentActivity()) {
if (!c->isOnDesktop(newDesktop) && c != movingClient) {
if (c->isShown(true) && c->isOnDesktop(oldDesktop) && !compositing())
obs_wins.create(c);
(c)->updateVisibility();
@ -948,7 +948,7 @@ void Workspace::updateClientVisibilityOnDesktopChange(uint oldDesktop, uint newD
if (!c) {
continue;
}
if (c->isOnDesktop(newDesktop) && c->isOnCurrentActivity())
if (c->isOnDesktop(newDesktop))
c->updateVisibility();
}
--block_showing_desktop;
@ -999,8 +999,7 @@ Client *Workspace::findClientToActivateOnDesktop(uint desktop)
continue;
}
if (!(client->isShown(false) && client->isOnDesktop(desktop) &&
client->isOnCurrentActivity() && client->isOnActiveScreen()))
if (!(client->isShown(false) && client->isOnDesktop(desktop)))
continue;
if (client->geometry().contains(Cursor::pos())) {
@ -1013,18 +1012,6 @@ Client *Workspace::findClientToActivateOnDesktop(uint desktop)
return FocusChain::self()->getForActivation(desktop);
}
/**
* Updates the current activity when it changes
* do *not* call this directly; it does not set the activity.
*
* Shows/Hides windows according to the stacking order
*/
void Workspace::updateCurrentActivity(const QString &new_activity)
{
Q_UNUSED(new_activity)
}
void Workspace::moveClientsFromRemovedDesktops()
{
for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it) {
@ -1127,12 +1114,6 @@ void Workspace::sendPingToWindow(xcb_window_t window, xcb_timestamp_t timestamp)
rootInfo()->sendPing(window, timestamp);
}
void Workspace::sendTakeActivity(KWin::Client *c, xcb_timestamp_t timestamp, long int flags)
{
rootInfo()->takeActivity(c->window(), timestamp, flags);
pending_take_activity = c;
}
/**
* Delayed focus functions
*/
@ -1172,6 +1153,12 @@ void Workspace::focusToNull()
m_nullFocus->focus();
}
void Workspace::sendTakeActivity(KWin::Client *c, xcb_timestamp_t timestamp, long int flags)
{
rootInfo()->takeActivity(c->window(), timestamp, flags);
pending_take_activity = c;
}
void Workspace::setShowingDesktop(bool showing)
{
rootInfo()->setShowingDesktop(showing);
@ -1190,7 +1177,7 @@ void Workspace::setShowingDesktop(bool showing)
if (!c) {
continue;
}
if (c->isOnCurrentActivity() && c->isOnCurrentDesktop() && c->isShown(true) && !c->isSpecialWindow())
if (c->isOnCurrentDesktop() && c->isShown(true) && !c->isSpecialWindow())
showing_desktop_clients.prepend(c); // Topmost first to reduce flicker
}
for (ClientList::ConstIterator it = showing_desktop_clients.constBegin();

View file

@ -381,7 +381,6 @@ private slots:
void delayFocus();
void slotBlockShortcuts(int data);
void slotReloadConfig();
void updateCurrentActivity(const QString &new_activity);
// virtual desktop handling
void moveClientsFromRemovedDesktops();
void slotDesktopCountChanged(uint previousCount, uint newCount);

View file

@ -256,16 +256,6 @@ public:
*/
QRect geometry() const;
/**
* Returns true if the task's window is on the current activity.
*/
bool isOnCurrentActivity() const;
/**
* Returns true if the task's window is on all activities
*/
bool isOnAllActivities() const;
/**
* Returns the activities on which this task's window resides.
*/

View file

@ -526,7 +526,6 @@ void Tasks::createConfigurationInterface(KConfigDialog *parent)
m_ui.sortingStrategy->addItem(i18n("Manually"),QVariant(TaskManager::GroupManager::ManualSorting));
m_ui.sortingStrategy->addItem(i18n("Alphabetically"),QVariant(TaskManager::GroupManager::AlphaSorting));
m_ui.sortingStrategy->addItem(i18n("By Desktop"),QVariant(TaskManager::GroupManager::DesktopSorting));
m_ui.sortingStrategy->addItem(i18n("By Activity"),QVariant(TaskManager::GroupManager::ActivitySorting));
switch (m_groupManager->sortingStrategy()) {
case TaskManager::GroupManager::NoSorting: