[PyQt] Capturing WindowChangeEvent in KDE

Raja rajasaur at gmail.com
Thu Nov 12 13:19:22 GMT 2009


Im a newbie on KDE and PyKDE and am trying to write a python snippet that
will listen for window switches (Alt-Tab or clicking on taskbar) and write
to a logfile for a particular user. I saw a few examples that use
QObject.connect with "activeWindowChanged" signal. There are couple of
problems that I could see there

a) All applications required a KAboutData and KCmdlineArgs before I got
access to KApplication. This created a window that sat there but did
nothing. Im trying to make this run as a non-windowed application that could
be started up on logging into KDE.  I guess Id have to use the KWindowSystem
to listen for all signals that happen on that object. Is it possible to run
this in a windowless mode?

b) Using the same example, I wrote a signal handler that listened for
"activewindowchange". The callback had a "wid" method, but I couldnt find
any references in PyKDE that would get me the WindowInfo depending on a Wid.
KDE seems to be having a KWin.WindowInfo object but couldnt find an
equivalent in PyKDE.

Any pointers would be great.

Thanks very much
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091112/6a4a3715/attachment.html

More information about the PyQt mailing list