[pygtk] WNCK question

Danny Milosavljevic danny.milo at gmx.net
Thu Apr 20 02:56:10 WST 2006


Hi,

Am Dienstag, den 18.04.2006, 23:13 +0100 schrieb Magnus Therning:
> After discovering wmctrl and EWMH I decided to play around a little with
> wnck. Of course I'd like to do it in Python. However I'm having some
> problems to get started. I entered the following in ipython running in
> a gnome-terminal:
> 
>  In [1]: import wnck
> 
>  In [2]: scr = wnck.screen_get_default()
> 
>  In [3]: scr
>  Out[3]: <wnck.Screen object (WnckScreen) at 0xa7b08e3c>
> 
>  In [4]: scr.get_windows()
>  Out[4]: []
> 
>  In [5]: scr.get_active_window()
> 
>  In [6]: scr.get_windows_stacked()
>  Out[6]: []
> 
>  In [7]: scr.get_workspace_count()
>  Out[7]: 0
> 
> The results are a little surprising to me. I was expecting to find some
> windows on the current screen, and I have 8 workspaces. Am I missing
> something here?
> 
> I have only managed to find the reference docs for libwnck. The only
> program I know uses it is devilspie, but it's not exactly ideal for
> jumpstarting my plying with wnck...
> 
> /M

We, the Xfce Project, have an old fork of wnck (called netk now), and
there it didn't update the window list until some idle callback of it
had been called by the main loop (i.e. the main loop was already
running!)

I patched that by now, but I guess the original wnck still has the
problem :)

cheers,
  Danny




More information about the pygtk mailing list