From kde-active Fri Sep 30 09:04:56 2011 From: "Aaron J. Seigo" Date: Fri, 30 Sep 2011 09:04:56 +0000 To: kde-active Subject: Re: [share-like-connect] dataengine/providers/activities: restore the Message-Id: <1903106.5Hffy9BFza () freedom> X-MARC-Message: https://marc.info/?l=kde-active&m=131737353615942 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============9172869209095104004==" --===============9172869209095104004== Content-Type: multipart/signed; boundary="nextPart3660965.PJx4g8GvQM"; micalg="pgp-sha1"; protocol="application/pgp-signature" Content-Transfer-Encoding: 7Bit --nextPart3660965.PJx4g8GvQM Content-Type: multipart/mixed; boundary="nextPart2371754.ACitOLG1hg" Content-Transfer-Encoding: 7Bit --nextPart2371754.ACitOLG1hg Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 --nextPart2371754.ACitOLG1hg Content-Disposition: attachment; filename="kwin_setRelatedWindowActivities.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="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 @@ + + + + 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); --nextPart2371754.ACitOLG1hg-- --nextPart3660965.PJx4g8GvQM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEABECAAYFAk6FhkgACgkQ1rcusafx20PN+QCeMYr2VqI2WW5X6UzHFr7U4NsI kE4An36SkBXolMJgpVYaljbb60nHcp7d =Brkg -----END PGP SIGNATURE----- --nextPart3660965.PJx4g8GvQM-- --===============9172869209095104004== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Active mailing list Active@kde.org https://mail.kde.org/mailman/listinfo/active --===============9172869209095104004==--