Python:Xlib-如何举起Windows? [英] Python: Xlib -- How can I raise(bring to top) windows?
问题描述
我尝试使用:
win.configure(stack_mode=X.TopIf)
win.set_input_focus(X.RevertToParent, X.CurrentTime)
但是,即使在我的窗口管理器上没有任何防止焦点丢失的方法,这也不起作用,有人知道有另一种方法可以做到这一点吗?是否使用Xlib.
However even without any focus loss prevention on my window manager this does not work, does anyone know of another way to do this? Xlib or not.
推荐答案
有一个名为 wmctrl ,使您可以与EWMH/NetWM兼容的X窗口管理器进行交互.
There is a command-line tool called wmctrl which allows you to interact with EWMH/NetWM-compatible X window managers.
例如,
wmctrl -l
列出由窗口管理器管理的所有窗口,并且
lists all the windows managed by the window manager, and
wmctrl -a Mozilla
使列表中的第一个窗口处于活动状态,该窗口的标题为字符串"Mozilla". 还有其他选择窗口的方法.以上只是一个例子.
makes active the first window in the list which has the string "Mozilla" in its title. There are other ways to select windows; the above is just an example.
wmctrl也使您能够移动和调整窗口大小.
wmctrl enables you to move and resize windows too.
这篇关于Python:Xlib-如何举起Windows?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!