Python: Xlib - How can I raise (output up) windows?

I tried using:

win.configure(stack_mode=X.TopIf) win.set_input_focus(X.RevertToParent, X.CurrentTime) 

However, even without preventing loss of focus in my window manager, this does not work, does anyone know of another way to do this? Xlib or not.

+4
source share
3 answers

There is a wmctrl command line tool that allows you to interact with XWMH / NetWM window managers.

For instance,

 wmctrl -l 

lists all windows managed by the window manager, and

 wmctrl -a Mozilla 

activates the first window in the list with the line "Mozilla" in the title. There are other ways to select windows; the above is just an example.

wmctrl allows you to move and resize windows.

+3
source

Perhaps this solution:
[Xlib] Force Raise / Map / Focus for this window

The solution given (follows the thread) involves using wnck, which in Python is part of the Gtk + bindings.

0
source

Try the following:

 window=Display().screen().root.query_pointer().child window.set_input_focus(X.RevertToParent, X.CurrentTime) window.configure(stack_mode=X.Above) 
0
source

All Articles