メニューはWMによって管理されておらず、WM固有のプロパティもありません。
ウィンドウを監視するには、を使用してルートウィンドウでイベントをキャッチXMapNotify
します。これは何かをする非常に単純なプログラムです:XUnmapNotify
SubstructureNotifyMask
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
int main () {
Display* d = XOpenDisplay(0);
if (!d) {
printf ("Oops...!\n");
exit (EXIT_FAILURE);
}
XSelectInput(d, DefaultRootWindow(d), SubstructureNotifyMask);
for(;;) {
XEvent e;
XNextEvent(d, &e);
if (e.type == MapNotify) {
printf ("Window %lx mapped!\n", e.xmap.window);
}
if (e.type == UnmapNotify) {
printf ("Window %lx unmapped!\n", e.xunmap.window);
}
}
}
Unmap
単純に無視できるスプリアスイベントを報告します。
より完全なプログラムは、おそらくとによって選択されたすべてのイベントを監視する必要がSubstructureNotifyMask
ありSubstructureRedirectMask
ます。