【发布时间】:2011-07-05 07:02:03
【问题描述】:
以下代码如何去除窗口边框?
//note the struct is declared elsewhere, is here just for clarity.
//code is from [http://tonyobryan.com/index.php?article=9][1]
typedef struct Hints
{
unsigned long flags;
unsigned long functions;
unsigned long decorations;
long inputMode;
unsigned long status;
} Hints;
//code to remove decoration
Hints hints;
Atom property;
hints.flags = 2;
hints.decorations = 0;
property = XInternAtom(display, "_MOTIF_WM_HINTS", true);
XChangeProperty(display,window,property,property,32,PropModeReplace,(unsigned char *)&hints,5);
XMapWindow(display, window);
到目前为止,我已经收集到 Atom 是一种类似于 Window 和 Display 的标识符,但我无法弄清楚 Hints 结构或“_MOTIF_WM_HINTS”的来源。谁能为我解释所有这些代码?在此先感谢,呃。
【问题讨论】:
-
这是您的来源,还是您的目的地? tonyobryan.com/index.php?article=9
-
这是我的源代码的一个小sn-p。 Hint 结构在别处声明,但为了清楚起见在此显示。而且我读过那篇文章,它没有解释提示结构(“我认为这个结构来自 Motif,但我不确定”......)
-
是的,它实际上不是我的来源,好点。
-
您正在运行的窗口管理器负责是否遵守此提示。如果它尊重它,那么如果窗口设置了这个提示,窗口管理器将从窗口中删除窗口装饰。
标签: c++ linux xlib window-managers