Something like windowWillClose ?

Sep 25, 2011 at 2:34pm

Something like windowWillClose ?

Hello folks,

i have an UI external in a subpatch ; external’s appearance change according to focus/focusLost ; problem occurs when i close/reopen the window : i get few milliseconds latency (drawn focused colors) before to paint it as it should (unfocused colors) … is there a way to paint it just before to close the window ? Is there a kind of windowWillClosed notification to avoid this behavior ?

any clue welcomed ;-)

Sep 26, 2011 at 10:33am



Sep 26, 2011 at 1:29pm


Sep 26, 2011 at 1:44pm


after investigated deeper in process order,
i founded that strange behavior :

close the window :

- FocusLost method called;
- Invisible method called;

reopen it :

- Focus method called; ###???
- Paint method called;
- FocusLost method called;
- Visible method called;

i just add something like that in my paint method :

if (x->isVisible) {
paint layers;
Sep 26, 2011 at 3:43pm

… and finally add a t_clock … and cancel the focusGainedTask in case of a focusLost called later … headache ;-)

all that stuff because max seems to ALWAYS send a focusGained method AND a focutLost method to my GUI before to open and close the patcher window.


You must be logged in to reply to this topic.