本文介绍了Linux上的无边界窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Linux上使特定窗口无边界的标准方法是吗?我相信窗口边框是由您的窗口管理器绘制的,所以可能我只需要使用一个特定的窗口管理器(可以找到,我只需要知道哪个窗口管理器即可)...我希望是所有的窗口管理器都可能遵循一些标准,使我能够以编程方式执行此操作...
Is their a standard way to make a particular window borderless on Linux? I believe that the window border is drawn by your window manager, so it may be that I just need to use a particular window manager (that would be find, I'd just need to know which one)... My hope is that all the window managers might follow some standard that allows me to do this programatically...
推荐答案
使用Xlib和旧的_MOTIF_WM_HINTS
:
struct MwmHints {
unsigned long flags;
unsigned long functions;
unsigned long decorations;
long input_mode;
unsigned long status;
};
enum {
MWM_HINTS_FUNCTIONS = (1L << 0),
MWM_HINTS_DECORATIONS = (1L << 1),
MWM_FUNC_ALL = (1L << 0),
MWM_FUNC_RESIZE = (1L << 1),
MWM_FUNC_MOVE = (1L << 2),
MWM_FUNC_MINIMIZE = (1L << 3),
MWM_FUNC_MAXIMIZE = (1L << 4),
MWM_FUNC_CLOSE = (1L << 5)
};
Atom mwmHintsProperty = XInternAtom(display, "_MOTIF_WM_HINTS", 0);
struct MwmHints hints;
hints.flags = MWM_HINTS_DECORATIONS;
hints.decorations = 0;
XChangeProperty(display, window, mwmHintsProperty, mwmHintsProperty, 32,
PropModeReplace, (unsigned char *)&hints, 5);
这几天首选 NetWM/EWMH提示,但据我所知知道所有现代窗口管理器仍然支持此功能.
These days NetWM/EWMH hints are preferred, but as far as I know all modern window managers still support this.
这篇关于Linux上的无边界窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!