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

List:       kde-core-devel
Subject:    Re: Window switch notification for plasma applets
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2011-04-14 16:39:30
Message-ID: 2388354.HSOkuNLQrC () freedom
[Download RAW message or body]


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

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

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

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