[pygtk] linsplit revolution!

Nathaniel Smith njs at pobox.com
Sun Nov 25 04:09:47 WST 2007


On Sat, Nov 24, 2007 at 06:35:50PM +0000, Stephen Kennedy wrote:
> For anybody with a large screen winsplit revolution is fantastic
> for organizing windows http://reptils.free.fr/ (win32 only though)
> 
> Basically <Ctrl><Alt><Numpad> warps and resizes your windows
> so they're tiled with minimum effort.
> 
> I've attached a first pass at a unix version (Just run from cmd line)
> and would appreciate any hints for the TODO items.
> 
> 1) get the usable destkop area, minus dock area

That's the _NET_WM_WORKAREA property on the root window (see the EWMH
spec for details), but I dunno if wnck exports it.

> 2) why does wnck.set_geometry not work for gnome-terminal?

Not sure, might be some strange interaction between how your window
manager interprets resize requests and how it interprets
gnome-terminal's request to be assigned only certain sizes.

> 3) How can I get the current gdk time? (0 gives a warning)

Create a gtk.gdk.Window, make sure it has PROPERTY_CHANGE_MASK
enabled in its event mask, and then call
   gtk.gdk.x11_get_server_time(that_window)
Alternatively, you can read it out of some X events, including
keypress events.  This is the Correct thing to use in your case,
because it avoids race conditions, but I don't know if the tomboy code
you're using to issue passive grabs gives any way to get at this
information.  In PyGTK generally you can call .get_time() on a
gtk.gdk.Event of the appropriate type.


A general alternative to something like winsplit, of course, is a
naturally tiling window manager.  You might also be interested in my
project, http://partiwm.org, which attempts to become such a wm and is
written in pygtk.

-- Nathaniel

-- 
"Of course, the entire effort is to put oneself
 Outside the ordinary range
 Of what are called statistics."
  -- Stephan Spender


More information about the pygtk mailing list