summaryrefslogtreecommitdiff
path: root/hw/xwin/winnativegdi.c
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:01 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:01 +0000
commitadc7f9a4ebdfe11d4cd6de9388b63dfe36450b39 (patch)
tree23eb7becc5360b2cbe16aa8d45529880067f3989 /hw/xwin/winnativegdi.c
parent90f1536dd315cd265bfc7ef35058761a65a01734 (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'hw/xwin/winnativegdi.c')
-rw-r--r--hw/xwin/winnativegdi.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c
index 5fe8b4f38..f7d8a4a1a 100644
--- a/hw/xwin/winnativegdi.c
+++ b/hw/xwin/winnativegdi.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winnativegdi.c,v 1.13 2002/10/17 08:18:22 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winnativegdi.c,v 1.15 2003/08/07 23:47:58 alanh Exp $ */
#include "win.h"
@@ -65,6 +65,17 @@ winCloseScreenNativeGDI (int nIndex, ScreenPtr pScreen)
ErrorF ("winCloseScreenNativeGDI - Destroying window\n");
+ /* Delete tray icon, if we have one */
+ if (!pScreenInfo->fNoTrayIcon)
+ winDeleteNotifyIcon (pScreenPriv);
+
+ /* Free the exit confirmation dialog box, if it exists */
+ if (g_hDlgExit != NULL)
+ {
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+ }
+
/* Kill our window */
if (pScreenPriv->hwndScreen)
{
@@ -207,13 +218,28 @@ winAdjustVideoModeNativeGDI (ScreenPtr pScreen)
/* Query GDI for current display depth */
dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+ pScreenInfo->dwDepth = GetDeviceCaps (hdc, PLANES);
+
+ switch (pScreenInfo->dwDepth) {
+ case 24:
+ case 16:
+ case 15:
+ case 8:
+ break;
+ default:
+ if (dwBPP == 32)
+ pScreenInfo->dwDepth = 24;
+ else
+ pScreenInfo->dwDepth = dwBPP;
+ break;
+ }
/* GDI cannot change the screen depth */
if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
{
/* No -depth parameter passed, let the user know the depth being used */
ErrorF ("winAdjustVideoModeNativeGDI - Using Windows display "
- "depth of %d bits per pixel\n", dwBPP);
+ "depth of %d bits per pixel, %d depth\n", dwBPP, pScreenInfo->dwDepth);
/* Use GDI's depth */
pScreenInfo->dwBPP = dwBPP;