Callback for window un-minimized (as opposed to maximized)


#1

There doesn’t seem to be a callback for when a window is restored after being minimized to the Taskbar (Windows) or Dock (OSX). Am I missing something?


#2

Never mind, I found it. Didn’t think to look in the Component class.


#3

Actually, it looks like this is working for Windows, but not for OS X. Bug perhaps?

Specifically I should say that I’m talking about the minimisationStateChanged() function. It gets called on Windows but not OS X.


#4

This seems to fix it, in juce_mac_NSViewComponentPeer.mm:

if (! owner_->isSharedWindow)
{
        [notificationCenter  addObserver: self
                                selector: @selector (frameChanged:)
                                    name: NSWindowDidMoveNotification
                                  object: owner_->window];

        // added these two lines:

        [notificationCenter  addObserver: self
                                selector: @selector (frameChanged:)
                                    name: NSWindowDidMiniaturizeNotification
                                  object: owner_->window];
        
        [notificationCenter  addObserver: self
                                selector: @selector (frameChanged:)
                                    name: NSWindowDidDeminiaturizeNotification
                                  object: owner_->window];
}

#5

Ok, thanks! I’ll take a look at that…