We are about to switch to a new forum software. Until then we have removed the registration on this forum.
There is here an example how to build a processing program having two windows:https://forum.processing.org/two/discussion/12272/multiple-windows-with-processing-3 My question is how it can be figured out which window is active? And when I am using mouse-events which Window is relevant? I want to handle Mouse events from the two windows.
Answers
If done correctly you never have to know which window is active.
The OS will capture events such as mouse, keyboard etc and forwards them to the active window. Each window will only receive and process it's own events.
Focus only in current active window which you activate by clicking within the sketch window. Check the demo below. I added some other things that you don't need btw.
This demo creates a master window and three slave windows which are randomly placed within your display. Click any of the slave windows.
Kf