[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-active
Subject:    Re: [share-like-connect] dataengine/providers/activities: restore the
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2011-09-30 9:04:56
Message-ID: 1903106.5Hffy9BFza () freedom
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


On Thursday, September 29, 2011 21:06:45 Marco Martin wrote:
> one thing that is still missing and would be needed to be really completed
> is to send the window as well to all the newly connected activities
> (correct me if i'm wrong but there still isn't api from kwin?)

i don't think there is in kwin; what would be great is if kwin could be 
notified about these changes or at least check (if it doesn't already) 
whenever the current activity changes. that would still mean the window would  
not "disappear" from the current activity until an activity switch though .. 
hm .. yes, i think we really need some sort of DBUS API in kwin for this, 
something like:

setWindowActivities(qlonglong winId, const QStringList &activities)

Martin: what do you think about something like that for kwin? attached is a 
sketch patch that implements the idea (or would if i could figure out how to 
get the Client* for a given window id ... see the "something()" call in 
setRelatedWindowActivities to see where i'm stuck ;)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks

["kwin_setRelatedWindowActivities.diff" (kwin_setRelatedWindowActivities.diff)]

diff --git a/kwin/org.kde.KWin.xml b/kwin/org.kde.KWin.xml
index bd993ed..98fbe08 100644
--- a/kwin/org.kde.KWin.xml
+++ b/kwin/org.kde.KWin.xml
@@ -26,6 +26,10 @@
       <arg name="x" type="i" direction="in"/>
       <arg name="y" type="i" direction="in"/>
     </method>
+    <method name="setRelatedWindowActivities">
+      <arg name="winId" type="x" direction="in"/>
+      <arg name="activities" type="as" direction="in"/>
+    </method>
     <method name="setCurrentDesktop">
       <arg name="desktop" type="i" direction="in"/>
       <arg type="b" direction="out"/>
diff --git a/kwin/workspace.cpp b/kwin/workspace.cpp
index 466dece..614afc2 100644
--- a/kwin/workspace.cpp
+++ b/kwin/workspace.cpp
@@ -1677,6 +1677,33 @@ void Workspace::toggleClientOnActivity(Client* c, const QString &activity, bool
     updateClientArea();
 }
 
+void Workspace::setRelatedWindowActivities(unsigned long id, const QStringList &activities)
+{
+    for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it) {
+        if (*it->something() == id) {
+            setRelatedActivities(*it, activities);
+            break;
+        }
+    }
+}
+
+/**
+ * Sets client \a c to be on \a activities.
+ *
+ * Takes care of transients as well.
+ */
+void Workspace::setRelatedActivities(Client *c, const QStringList &activities)
+{
+    c->setOnActivities(activities);
+
+    ClientList transients_stacking_order = ensureStackingOrder(c->transients());
+    for (ClientList::ConstIterator it = transients_stacking_order.constBegin();
+            it != transients_stacking_order.constEnd();
+            ++it)
+        setRelatedActivities(*it, activities);
+    updateClientArea();
+}
+
 int Workspace::numScreens() const
 {
     if (!options->xineramaEnabled)
diff --git a/kwin/workspace.h b/kwin/workspace.h
index 09edd9e..6df7da2 100644
--- a/kwin/workspace.h
+++ b/kwin/workspace.h
@@ -389,6 +389,8 @@ public:
 
     // KDE4 remove me - And it's also in the DCOP interface :(
     void showWindowMenuAt(unsigned long id, int x, int y);
+    void setRelatedWindowActivities(unsigned long id, const QStringList &activities);
+    void setRelatedActivities(Client *c, const QStringList &activities);
 
     void toggleCompositing();
     void loadEffect(const QString& name);

["signature.asc" (application/pgp-signature)]

_______________________________________________
Active mailing list
Active@kde.org
https://mail.kde.org/mailman/listinfo/active


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic