Window switch notification for plasma applets

Aaron J. Seigo aseigo at
Thu Apr 14 17:39:30 BST 2011

On Wednesday, April 13, 2011 20:31:01 Andriy Rysin wrote:
> So the question is whether there's a way to
> tell "active/focused" applet and get notified on switch?

not currently; well, at least not easily :)

QGraphicsScene does provide QGraphicsItem * QGraphicsScene::focusItem(), and 
you could determine from that what has focus (by going up the object chain 
until you hit a Plasma::Applet). that's rather ugly though :)

what might also work is to make the keyboard switcher accept keyboard focus 
and then when the desktop window becomes active you can check if the switcher 
has focus or not and decide on that. this raises the issue of multiple 
keyboard switchers. using focusItem() might be easier.

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the kde-core-devel mailing list