From adc2ea8512fc3ea0f0c65ded5c9e040d642d8515 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 8 Dec 2014 23:19:10 +0000 Subject: [PATCH] kwin and plasma tasks applet activities cleanup --- kwin/activation.cpp | 4 +- kwin/client.cpp | 92 +--------------------- kwin/client.h | 13 --- kwin/dbusinterface.cpp | 10 --- kwin/dbusinterface.h | 2 - kwin/deleted.cpp | 6 -- kwin/deleted.h | 2 - .../fadedesktop/package/contents/code/main.js | 3 - kwin/events.cpp | 2 - kwin/focuschain.cpp | 11 +-- kwin/geometry.cpp | 2 - kwin/layers.cpp | 5 +- kwin/libkwineffects/kwineffects.cpp | 20 +---- kwin/libkwineffects/kwineffects.h | 38 --------- kwin/manage.cpp | 20 +---- kwin/org.kde.KWin.xml | 8 -- kwin/placement.cpp | 2 - kwin/rules.cpp | 7 -- kwin/scene.cpp | 4 - kwin/scene.h | 2 - kwin/sm.cpp | 2 - kwin/tabbox/tabbox.cpp | 19 +---- kwin/tabbox/tabbox.h | 1 - kwin/tabgroup.cpp | 3 - kwin/toplevel.cpp | 5 -- kwin/toplevel.h | 16 ---- kwin/useractions.cpp | 10 +-- kwin/workspace.cpp | 33 +++----- kwin/workspace.h | 1 - libs/taskmanager/task.h | 10 --- plasma/desktop/applets/tasks/tasks.cpp | 1 - 31 files changed, 24 insertions(+), 330 deletions(-) diff --git a/kwin/activation.cpp b/kwin/activation.cpp index a7687298..ce85ffbc 100644 --- a/kwin/activation.cpp +++ b/kwin/activation.cpp @@ -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())) { diff --git a/kwin/client.cpp b/kwin/client.cpp index 79a32c77..f624ef19 100644 --- a/kwin/client.cpp +++ b/kwin/client.cpp @@ -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(); @@ -1490,59 +1480,6 @@ void Client::setDesktop(int desktop) } /** - * 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), * or NET::OnAllDesktops. Do not use desktop() directly, use @@ -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()) || @@ -1585,14 +1509,6 @@ void Client::setOnAllDesktops(bool b) } /** - * 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 */ void Client::takeActivity(int flags, bool handled) @@ -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; diff --git a/kwin/client.h b/kwin/client.h index c9236993..60d11be8 100644 --- a/kwin/client.h +++ b/kwin/client.h @@ -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; diff --git a/kwin/dbusinterface.cpp b/kwin/dbusinterface.cpp index 7c4cdfa8..570d7615 100644 --- a/kwin/dbusinterface.cpp +++ b/kwin/dbusinterface.cpp @@ -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) diff --git a/kwin/dbusinterface.h b/kwin/dbusinterface.h index f0458dca..cfa25d27 100644 --- a/kwin/dbusinterface.h +++ b/kwin/dbusinterface.h @@ -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 diff --git a/kwin/deleted.cpp b/kwin/deleted.cpp index 5bfc1969..0c40e985 100644 --- a/kwin/deleted.cpp +++ b/kwin/deleted.cpp @@ -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(); diff --git a/kwin/deleted.h b/kwin/deleted.h index 79b93ac0..f09b37ec 100644 --- a/kwin/deleted.h +++ b/kwin/deleted.h @@ -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; diff --git a/kwin/effects/fadedesktop/package/contents/code/main.js b/kwin/effects/fadedesktop/package/contents/code/main.js index d3ba74c2..51ef9d3b 100644 --- a/kwin/effects/fadedesktop/package/contents/code/main.js +++ b/kwin/effects/fadedesktop/package/contents/code/main.js @@ -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 { diff --git a/kwin/events.cpp b/kwin/events.cpp index 5392b18c..4919f3bc 100644 --- a/kwin/events.cpp +++ b/kwin/events.cpp @@ -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) diff --git a/kwin/focuschain.cpp b/kwin/focuschain.cpp index bd98b94a..1a67c777 100644 --- a/kwin/focuschain.cpp +++ b/kwin/focuschain.cpp @@ -70,15 +70,6 @@ Client *FocusChain::getForActivation(uint desktop, int screen) const if (it == m_desktopFocusChains.constEnd()) { return NULL; } - const QList &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())); } diff --git a/kwin/geometry.cpp b/kwin/geometry.cpp index 6934d263..b02e1340 100644 --- a/kwin/geometry.cpp +++ b/kwin/geometry.cpp @@ -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; diff --git a/kwin/layers.cpp b/kwin/layers.cpp index ed373b89..ba29f615 100644 --- a/kwin/layers.cpp +++ b/kwin/layers.cpp @@ -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(*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) diff --git a/kwin/libkwineffects/kwineffects.cpp b/kwin/libkwineffects/kwineffects.cpp index 2d53a9d8..d571ba6a 100644 --- a/kwin/libkwineffects/kwineffects.cpp +++ b/kwin/libkwineffects/kwineffects.cpp @@ -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(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(); } diff --git a/kwin/libkwineffects/kwineffects.h b/kwin/libkwineffects/kwineffects.h index 872482b7..bf46cd46 100644 --- a/kwin/libkwineffects/kwineffects.h +++ b/kwin/libkwineffects/kwineffects.h @@ -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. @@ -1182,26 +1175,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 * @since 4.11 @@ -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 *
    *
  • Not minimized
  • *
  • On current desktop
  • - *
  • On current activity
  • *
* @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; diff --git a/kwin/manage.cpp b/kwin/manage.cpp index 9b474475..0138930d 100644 --- a/kwin/manage.cpp +++ b/kwin/manage.cpp @@ -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 diff --git a/kwin/org.kde.KWin.xml b/kwin/org.kde.KWin.xml index defb3a7c..cdb9ce97 100644 --- a/kwin/org.kde.KWin.xml +++ b/kwin/org.kde.KWin.xml @@ -73,14 +73,6 @@ - - - - - - - - diff --git a/kwin/placement.cpp b/kwin/placement.cpp index f35b9519..07432b17 100644 --- a/kwin/placement.cpp +++ b/kwin/placement.cpp @@ -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; diff --git a/kwin/rules.cpp b/kwin/rules.cpp index 9244d06d..4892ab01 100644 --- a/kwin/rules.cpp +++ b/kwin/rules.cpp @@ -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 diff --git a/kwin/scene.cpp b/kwin/scene.cpp index 2b1c2218..2929f85d 100644 --- a/kwin/scene.cpp +++ b/kwin/scene.cpp @@ -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(toplevel); if (c->isMinimized()) diff --git a/kwin/scene.h b/kwin/scene.h index b988483f..9ddae938 100644 --- a/kwin/scene.h +++ b/kwin/scene.h @@ -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); diff --git a/kwin/sm.cpp b/kwin/sm.cpp index 34efa9d9..d4b90fbf 100644 --- a/kwin/sm.cpp +++ b/kwin/sm.cpp @@ -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(reinterpret_cast(c->tabGroup()))); - cg.writeEntry(QString("activities") + n, c->activities()); } void Workspace::storeSubSession(const QString &name, QSet 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()); } } diff --git a/kwin/tabbox/tabbox.cpp b/kwin/tabbox/tabbox.cpp index f8b993be..f52ae23d 100644 --- a/kwin/tabbox/tabbox.cpp +++ b/kwin/tabbox/tabbox.cpp @@ -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 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(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); diff --git a/kwin/tabbox/tabbox.h b/kwin/tabbox/tabbox.h index 058b202d..db41296b 100644 --- a/kwin/tabbox/tabbox.h +++ b/kwin/tabbox/tabbox.h @@ -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; diff --git a/kwin/tabgroup.cpp b/kwin/tabgroup.cpp index 7135929f..30538d07 100644 --- a/kwin/tabgroup.cpp +++ b/kwin/tabgroup.cpp @@ -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()); diff --git a/kwin/toplevel.cpp b/kwin/toplevel.cpp index 41e411dd..3433a674 100644 --- a/kwin/toplevel.cpp +++ b/kwin/toplevel.cpp @@ -446,11 +446,6 @@ bool Toplevel::isDeleted() const return false; } -bool Toplevel::isOnCurrentActivity() const -{ - return true; -} - void Toplevel::elevate(bool elevate) { if (!effectWindow()) { diff --git a/kwin/toplevel.h b/kwin/toplevel.h index c8dcc6b6..d962a82d 100644 --- a/kwin/toplevel.h +++ b/kwin/toplevel.h @@ -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()); diff --git a/kwin/useractions.cpp b/kwin/useractions.cpp index 64e8bbfc..848a9937 100755 --- a/kwin/useractions.cpp +++ b/kwin/useractions.cpp @@ -160,13 +160,9 @@ void UserActionsMenu::show(const QRect &pos, const QWeakPointer &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 &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(*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); diff --git a/kwin/workspace.cpp b/kwin/workspace.cpp index c837ed02..a491530c 100644 --- a/kwin/workspace.cpp +++ b/kwin/workspace.cpp @@ -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(); diff --git a/kwin/workspace.h b/kwin/workspace.h index e278b988..0cc50ffc 100644 --- a/kwin/workspace.h +++ b/kwin/workspace.h @@ -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); diff --git a/libs/taskmanager/task.h b/libs/taskmanager/task.h index c44f482c..82c3e441 100644 --- a/libs/taskmanager/task.h +++ b/libs/taskmanager/task.h @@ -257,16 +257,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. */ QStringList activities() const; diff --git a/plasma/desktop/applets/tasks/tasks.cpp b/plasma/desktop/applets/tasks/tasks.cpp index f55fa6a3..990a1b21 100644 --- a/plasma/desktop/applets/tasks/tasks.cpp +++ b/plasma/desktop/applets/tasks/tasks.cpp @@ -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: -- 2.11.0