So I checked out plwm from svn and installed it.  I tried to run but I get an error saying another window manager is running.  I can't figure out how to stop Metacity -- if I kill it, it restarts itself.  I couldn't figure out how to get plwm to launch on boot instead of Metacity/Gnome/GDM/whatever it's called.  I created .xinitrc, .wmmrc, and .Xdefaults in my home dir and copy pasted the example files from plwm.pdf into them, but they didn't seem to have any effect. If I logout and start a terminal before Metacity is launched, for some reason when I do an ls some directories are invisible -- I think they're being displayed as black text on a black background for some reason.  ...headaches abound...

On Sun, Oct 19, 2008 at 3:28 PM, Mike Meyer <> wrote:
On Sun, 19 Oct 2008 08:39:46 -0500
"Jesse Aldridge" <> wrote:

> I want to bring a given window to the top and give it focus.  I made the
> program below to test this.  The program displays the name of each window in
> the window tree in a text control.  Clicking on a line in the text control
> should cause the corresponding window to come to the front and get the
> focus.  It doesn't work -- while the window gets the focus, it doesn't get
> raised until I close the window I created in the program.  How can I get
> this working?

The code looks right to me, and works in plwm/ However,
your example doesn't work as well as you describe for me. Of course,
my window manager is configured to *not allow* windows to grab focus
(evil, evil practice, that) or raise themselves (evil practice,
that). I'm not familiar with metacity, but you might check to see if
it is interfering with what you're trying to do.


> I using Ubuntu 8.04 / Gnome / Metacity.
> ------------------
> import wx,
> import Xlib.display
> from Xlib import X
> app = wx.App(redirect=False)
> frame = wx.Frame(None)
> panel = wx.Panel(frame)
> panel.SetSizer(wx.BoxSizer(wx.VERTICAL))
> display = Xlib.display.Display()
> root_window = display.screen().root
> class MyTextControl(
>     def __init__(self):
>, panel)
>         self.Bind(wx.EVT_LEFT_UP, self.on_left_up)
>     def on_left_up(self, e):
>         e.Skip()
>         window = windows[self.GetCurrentLine()]
>         window.configure(stack_mode=X.Above)
>         window.set_input_focus(X.RevertToParent, X.CurrentTime)
>         display.sync()
> text_control = MyTextControl()
> panel.GetSizer().Add(text_control, flag=wx.EXPAND, proportion=1)
> def each_window(window, depth):
>     yield window, depth
>     for child in window.query_tree().children:
>         for grandchild, new_depth in each_window(child, depth + 1):
>             yield grandchild, new_depth
> windows = []
> for window, depth in each_window(root_window, 0):
>     windows.append(window)
>     text_control.AppendText(depth * 2 * ' ' + str(window.get_wm_name()) +
> "\n")
> frame.Show()
> app.MainLoop()

Mike Meyer <>    
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail -