summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/xwin/ChangeLog6
-rw-r--r--hw/xwin/wincreatewnd.c23
2 files changed, 26 insertions, 3 deletions
diff --git a/hw/xwin/ChangeLog b/hw/xwin/ChangeLog
index 93174a680..1c6995da7 100644
--- a/hw/xwin/ChangeLog
+++ b/hw/xwin/ChangeLog
@@ -1,3 +1,9 @@
+2005-02-02 Alexander Gottwald <ago at freedesktop dot org>
+
+ * wincreatewnd.c:
+ Force ShowWindow if XWin was started via run.exe. Fixes mainwindow
+ not showing bug
+
2005-01-31 Alexander Gottwald <ago at freedesktop dot org>
* winmultiwindowwindow.c
diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
index 909519916..613111d1c 100644
--- a/hw/xwin/wincreatewnd.c
+++ b/hw/xwin/wincreatewnd.c
@@ -148,6 +148,7 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
WNDCLASS wc;
RECT rcClient, rcWorkArea;
DWORD dwWindowStyle;
+ BOOL fForceShowWindow = FALSE;
char szTitle[256];
winDebug ("winCreateBoundingWindowWindowed - User w: %d h: %d\n",
@@ -169,9 +170,19 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
#endif
)
{
- dwWindowStyle |= WS_CAPTION;
- if (pScreenInfo->fScrollbars)
- dwWindowStyle |= WS_THICKFRAME | WS_MAXIMIZEBOX;
+ /* Try to handle startup via run.exe. run.exe instructs Windows to
+ * hide all created windows. Detect this case and make sure the
+ * window is shown nevertheless */
+ STARTUPINFO startupInfo;
+ GetStartupInfo(&startupInfo);
+ if (startupInfo.dwFlags & STARTF_USESHOWWINDOW &&
+ startupInfo.wShowWindow == SW_HIDE)
+ {
+ fForceShowWindow = TRUE;
+ }
+ dwWindowStyle |= WS_CAPTION;
+ if (pScreenInfo->fScrollbars)
+ dwWindowStyle |= WS_THICKFRAME | WS_MAXIMIZEBOX;
}
else
dwWindowStyle |= WS_POPUP;
@@ -346,6 +357,12 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
winDebug ("winCreateBoundingWindowWindowed - CreateWindowEx () returned\n");
#endif
+ if (fForceShowWindow)
+ {
+ ErrorF("winCreateBoundingWindowWindowed - Setting normal windowstyle\n");
+ ShowWindow(*phwnd, SW_SHOW);
+ }
+
/* Get the client area coordinates */
if (!GetClientRect (*phwnd, &rcClient))
{