nanogui: Window ID
Subject:
Re: [nanogui] Re: Window ID
From:
"Greg Haerr" ####@####.####
Date:
5 Oct 2005 07:49:24 +0100
Message-Id: <170801c5c955$bcc271b0$6401a8c0@winXP>
: > execvp(*argv, argv)
: >
: > and with this a new window is created with the new application.
: >
: > However I need its window id to handle this new application window.
:
: For your specific question, you should select on the
: GR_EVENT_TYPE_CHLD_UPDATE event for the root window, and look for the
subtype
: of GR_UPDATE_MAP - this will tell you when a newly created window has been
: mapped (and the id of that window).
Actually, its a bit more complicated than that. After being notified
of any new window being mapped, by selecting on root window
child update events, you'll need to call GrGetWindowInfo for that
window, and compare the 'processid' member value with the
child process you got from the fork() before your execvp() above.
Only in this way can you be completely sure its actually your
child process's window.
Regards,
Greg