C programming with the X11 library, is there a way to get notified if a new window appears? I found XSetAfterFunction , but is for debugging purposes only ...
Thank you for your help!
Henry
@edit:
This code solves my problem
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;
}
source
share