fgError( "Failed to create a window (%s)!", title );
/* Store title */
- {
- window->State.pWState.WindowTitle = malloc (strlen(title) + 1);
- strcpy(window->State.pWState.WindowTitle, title);
- }
+ window->State.pWState.WindowTitle = strdup(title);
#if !defined(_WIN32_WCE)
/* Need to set requested style again, apparently Windows doesn't listen when requesting windows without title bar or borders */
#if defined(_WIN32_WCE)
ShowWindow( window->Window.Handle, SW_SHOW );
#else
- ShowWindow( window->Window.Handle,
- fgState.ForceIconic ? SW_SHOWMINIMIZED : SW_SHOWNORMAL );
+ {
+ BOOL iconic = fgState.ForceIconic && !window->IsMenu && !gameMode && !isSubWindow;
+ ShowWindow( window->Window.Handle,
+ iconic ? SW_SHOWMINIMIZED : SW_SHOWNORMAL );
+ }
#endif /* defined(_WIN32_WCE) */
ShowCursor( TRUE );
void fgPlatformDisplayWindow ( SFG_Window *window )
{
+ /* This immediately generates a WM_PAINT message upon which we call the display callbacks to redraw the window */
RedrawWindow(
window->Window.Handle, NULL, NULL,
RDW_NOERASE | RDW_INTERNALPAINT | RDW_INVALIDATE | RDW_UPDATENOW
free(wstr);
}
#else
- SetWindowText( fgStructure.CurrentWindow->Window.Handle, title );
+ if (!IsIconic(fgStructure.CurrentWindow->Window.Handle))
+ SetWindowText( fgStructure.CurrentWindow->Window.Handle, title );
#endif
/* Make copy of string to refer to later */
if (fgStructure.CurrentWindow->State.pWState.WindowTitle)
free(fgStructure.CurrentWindow->State.pWState.WindowTitle);
- fgStructure.CurrentWindow->State.pWState.WindowTitle = malloc (strlen(title) + 1);
- strcpy(fgStructure.CurrentWindow->State.pWState.WindowTitle, title);
+ fgStructure.CurrentWindow->State.pWState.WindowTitle = strdup(title);
}
/*
*/
void fgPlatformGlutSetIconTitle( const char* title )
{
+#ifndef _WIN32_WCE
+ if (IsIconic(fgStructure.CurrentWindow->Window.Handle))
+ SetWindowText( fgStructure.CurrentWindow->Window.Handle, title );
+#endif
+
/* Make copy of string to refer to later */
if (fgStructure.CurrentWindow->State.pWState.IconTitle)
free(fgStructure.CurrentWindow->State.pWState.IconTitle);
- fgStructure.CurrentWindow->State.pWState.IconTitle = malloc (strlen(title) + 1);
- strcpy(fgStructure.CurrentWindow->State.pWState.IconTitle, title);
+ fgStructure.CurrentWindow->State.pWState.IconTitle = strdup(title);
}
/*