aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/windialogs.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/windialogs.c')
-rw-r--r--xorg-server/hw/xwin/windialogs.c68
1 files changed, 31 insertions, 37 deletions
diff --git a/xorg-server/hw/xwin/windialogs.c b/xorg-server/hw/xwin/windialogs.c
index a1e2e1709..17d4d3226 100644
--- a/xorg-server/hw/xwin/windialogs.c
+++ b/xorg-server/hw/xwin/windialogs.c
@@ -214,8 +214,8 @@ winInitDialog (HWND hwndDlg)
*/
if (GetSystemMetrics(SM_CMONITORS)>1) {
/* Still need to refresh the frame change. */
- SetWindowPos (hwndDlg, HWND_TOPMOST, 0,0,0,0,
- SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ SetWindowPos (hwndDlg, HWND_TOP, 0,0,0,0,
+ SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
} else {
GetWindowRect (hwndDesk, &rcDesk);
GetWindowRect (hwndDlg, &rcDlg);
@@ -254,12 +254,8 @@ winInitDialog (HWND hwndDlg)
}
-/*
- * Display the Exit dialog box
- */
-
-void
-winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
+int
+GetLiveClients (winPrivScreenPtr pScreenPriv)
{
int i;
int liveClients = 0;
@@ -280,7 +276,21 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
/* A user reported that this sometimes drops below zero. just eye-candy. */
if (liveClients < 0)
- liveClients = 0;
+ liveClients = 0;
+
+ pScreenPriv->iConnectedClients = liveClients;
+
+ return liveClients;
+}
+
+/*
+ * Display the Exit dialog box
+ */
+
+void
+winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
+{
+ int liveClients = GetLiveClients(pScreenPriv);
/* Don't show the exit confirmation dialog if SilentExit & no clients,
or ForceExit, is enabled */
@@ -295,8 +305,6 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
return;
}
- pScreenPriv->iConnectedClients = liveClients;
-
/* Check if dialog already exists */
if (g_hDlgExit != NULL)
{
@@ -324,7 +332,7 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
/* Set focus to the Cancel button */
PostMessage (g_hDlgExit, WM_NEXTDLGCTL,
- GetDlgItem (g_hDlgExit, IDCANCEL), TRUE);
+ (WPARAM)GetDlgItem (g_hDlgExit, IDCANCEL), TRUE);
}
#define CONNECTED_CLIENTS_FORMAT "There %s currently %d client%s connected."
@@ -447,9 +455,9 @@ winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv)
/* Show the dialog box */
ShowWindow (g_hDlgDepthChange, SW_SHOW);
- ErrorF ("winDisplayDepthChangeDialog - DialogBox returned: %d\n",
+ winDebug ("winDisplayDepthChangeDialog - DialogBox returned: %d\n",
(int) g_hDlgDepthChange);
- ErrorF ("winDisplayDepthChangeDialog - GetLastError: %d\n",
+ winDebug ("winDisplayDepthChangeDialog - GetLastError: %d\n",
(int) GetLastError ());
/* Minimize the display window */
@@ -470,53 +478,43 @@ winChangeDepthDlgProc (HWND hwndDialog, UINT message,
static winScreenInfo *s_pScreenInfo = NULL;
static ScreenPtr s_pScreen = NULL;
-#if CYGDEBUG
winDebug ("winChangeDepthDlgProc\n");
-#endif
/* Branch on message type */
switch (message)
{
case WM_INITDIALOG:
-#if CYGDEBUG
winDebug ("winChangeDepthDlgProc - WM_INITDIALOG\n");
-#endif
/* Store pointers to private structures for future use */
s_pScreenPriv = (winPrivScreenPtr) lParam;
s_pScreenInfo = s_pScreenPriv->pScreenInfo;
s_pScreen = s_pScreenInfo->pScreen;
-#if CYGDEBUG
winDebug ("winChangeDepthDlgProc - WM_INITDIALOG - s_pScreenPriv: %08x, "
"s_pScreenInfo: %08x, s_pScreen: %08x\n",
s_pScreenPriv, s_pScreenInfo, s_pScreen);
-#endif
-#if CYGDEBUG
winDebug ("winChangeDepthDlgProc - WM_INITDIALOG - orig bpp: %d, "
"last bpp: %d\n",
s_pScreenInfo->dwBPP,
s_pScreenPriv->dwLastWindowsBitsPixel);
-#endif
winInitDialog( hwndDialog );
return TRUE;
case WM_DISPLAYCHANGE:
-#if CYGDEBUG
winDebug ("winChangeDepthDlgProc - WM_DISPLAYCHANGE - orig bpp: %d, "
"last bpp: %d, new bpp: %d\n",
s_pScreenInfo->dwBPP,
s_pScreenPriv->dwLastWindowsBitsPixel,
wParam);
-#endif
/* Dismiss the dialog if the display returns to the original depth */
if (wParam == s_pScreenInfo->dwBPP)
{
- ErrorF ("winChangeDelthDlgProc - wParam == s_pScreenInfo->dwBPP\n");
+ winDebug ("winChangeDelthDlgProc - wParam == s_pScreenInfo->dwBPP\n");
/* Depth has been restored, dismiss dialog */
DestroyWindow (g_hDlgDepthChange);
@@ -544,7 +542,7 @@ winChangeDepthDlgProc (HWND hwndDialog, UINT message,
break;
case WM_CLOSE:
- ErrorF ("winChangeDepthDlgProc - WM_CLOSE\n");
+ winDebug ("winChangeDepthDlgProc - WM_CLOSE\n");
DestroyWindow (g_hDlgAbout);
g_hDlgAbout = NULL;
@@ -594,7 +592,7 @@ winDisplayAboutDialog (winPrivScreenPtr pScreenPriv)
/* Set focus to the OK button */
PostMessage (g_hDlgAbout, WM_NEXTDLGCTL,
- GetDlgItem (g_hDlgAbout, IDOK), TRUE);
+ (WPARAM)GetDlgItem (g_hDlgAbout, IDOK), TRUE);
}
@@ -610,17 +608,13 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
static winScreenInfo *s_pScreenInfo = NULL;
static ScreenPtr s_pScreen = NULL;
-#if CYGDEBUG
winDebug ("winAboutDlgProc\n");
-#endif
/* Branch on message type */
switch (message)
{
case WM_INITDIALOG:
-#if CYGDEBUG
winDebug ("winAboutDlgProc - WM_INITDIALOG\n");
-#endif
/* Store pointers to private structures for future use */
s_pScreenPriv = (winPrivScreenPtr) lParam;
@@ -657,7 +651,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
{
case IDOK:
case IDCANCEL:
- ErrorF ("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
+ winDebug ("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
DestroyWindow (g_hDlgAbout);
g_hDlgAbout = NULL;
@@ -675,7 +669,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
case ID_ABOUT_CHANGELOG:
{
- HINSTANCE iReturn;
+ int iReturn;
#ifdef __CYGWIN__
const char * pszCygPath = "/usr/X11R6/share/doc/"
"xorg-x11-xwin/changelog.html";
@@ -688,7 +682,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
"devel/server/changelog.html";
#endif
- iReturn = ShellExecute (NULL,
+ iReturn = (int)ShellExecute (NULL,
"open",
pszWinPath,
NULL,
@@ -708,7 +702,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
const char * pszPath = __VENDORDWEBSUPPORT__;
int iReturn;
- iReturn = ShellExecute (NULL,
+ iReturn = (int)ShellExecute (NULL,
"open",
pszPath,
NULL,
@@ -728,7 +722,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
const char * pszPath = "http://x.cygwin.com/docs/ug/";
int iReturn;
- iReturn = ShellExecute (NULL,
+ iReturn = (int)ShellExecute (NULL,
"open",
pszPath,
NULL,
@@ -748,7 +742,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
const char * pszPath = "http://x.cygwin.com/docs/faq/";
int iReturn;
- iReturn = ShellExecute (NULL,
+ iReturn = (int)ShellExecute (NULL,
"open",
pszPath,
NULL,