編程與X11庫C,是如果有一個新的窗口出現時獲取通知的方式?我發現XSetAfterFunction但其僅用於調試目的...X11編程:如果出現新窗口會收到通知?
感謝您的幫助!
海因裏希
@edit:
此代碼解決我的問題
int main() {
Display* display = XOpenDisplay(":2");
XSetWindowAttributes attributes;
attributes.event_mask = SubstructureNotifyMask | StructureNotifyMask;
XChangeWindowAttributes(display, 0x100, CWEventMask, &attributes);
while (true) {
XEvent event;
XNextEvent(display, &event);
std::cout << "Event occured" << std::endl;
}
return 0;
}
您使用的窗口管理器?哪一個? – 2010-11-03 14:40:47
我沒有使用窗口管理器。只是Xvfb。 – Erik 2010-11-03 15:57:24