Our little application doesn’t repaint when it is shown after hidden in the dock.
Simply start the app, press CMD+H to hide the app and press tab to select the app again which will show the window again.
Following code does fix this:
static pascal OSStatus handleShowHideEvent (EventHandlerCallRef, EventRef theEvent, void* userData)
{
MessageManagerLock messLock;
NativeDesktopWindow* const nw = (NativeDesktopWindow*) userData;
Component* cp = nw->getComponent();
if(nw && cp)
nw->repaint(0, 0, cp->getWidth(), cp->getHeight());
return noErr;
}
and
void NativeDesktopWindow::initialiseNativeWindow (const String& title, int windowStyleFlags)
{
...
const EventTypeSpec types7[] = { { kEventClassWindow, kEventWindowShown } };
InstallWindowEventHandler (window, NewEventHandlerUPP (handleShowHideEvent), 1, types7, (void*) this, 0);