Index: ChangeLog =================================================================== RCS file: /cvs/xorg/xc/ChangeLog,v retrieving revision 1.369.2.2 retrieving revision 1.369.2.3 diff -u -r1.369.2.2 -r1.369.2.3 --- ChangeLog 17 Sep 2004 08:58:19 -0000 1.369.2.2 +++ ChangeLog 4 Nov 2004 13:18:42 -0000 1.369.2.3 @@ -1,3 +1,9 @@ +2004-11-04 Alexander Gottwald + + * xc/programs/Xserver/Imakefile: + Link XWin.exe and XWin_GL.exe with binmode.o to make sure all files + are read without \r\n conversion + 2004-09-15 Daniel Stone * xc/extras/Xpm/lib/Attrib.c: Index: programs/Xserver/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Imakefile,v retrieving revision 1.1.4.2.2.11 retrieving revision 1.1.4.2.2.12 diff -u -r1.1.4.2.2.11 -r1.1.4.2.2.12 --- programs/Xserver/Imakefile 15 Sep 2004 16:33:23 -0000 1.1.4.2.2.11 +++ programs/Xserver/Imakefile 4 Nov 2004 13:18:43 -0000 1.1.4.2.2.12 @@ -1019,7 +1019,8 @@ XWINOBJS = $(XWINDDXDIR)/stubs.o $(XWINDDXDIR)/XWin.res XWINLIBS = PreFbLibs $(XWINLIB) FbPostFbLibs $(XWINLIB) $(XWINLAYERLIB) \ $(SHADOW) $(XWINPARSERLIB) $(ROOTLESSLIB) -XWINSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XONLYLIB) $(SYSLIBS) -lgdi32 +XWINSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XONLYLIB) $(SYSLIBS) -lgdi32 \ + -lbinmode EXTRA_LDOPTIONS = -e _mainCRTStartup Index: programs/Xserver/hw/xwin/ChangeLog =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/ChangeLog,v retrieving revision 1.1.2.17 retrieving revision 1.1.2.27 diff -u -r1.1.2.17 -r1.1.2.27 --- programs/Xserver/hw/xwin/ChangeLog 16 Sep 2004 12:55:11 -0000 1.1.2.17 +++ programs/Xserver/hw/xwin/ChangeLog 11 Nov 2004 14:34:03 -0000 1.1.2.27 @@ -1,3 +1,69 @@ +2004-11-11 Alexander Gottwald + + * winconfig.c: + added keyboard layout "French (Switzerland)" + +2004-10-28 Alexander Gottwald + + * win.h: + add fRetryCreateSurface + * winshaddnl.c (winBltExposedRegionsShadowDDNL): + try to recreate the primary surface if it was lost + * winshaddnl.c (winCreatePrimarySurfaceShadowDDNL): + mark screen to retry creating the primary surface if it failed + +2004-10-23 Alexander Gottwald + + * winconfig (winConfigFiles): + Simplify /etc/X11/font-dirs parsing + +2004-10-20 Alexander Gottwald + + * XWin.rc, winresource.h, winwndproc.c: + Add ShowCursor entry to tray menu + +2004-10-20 Alexander Gottwald + + * Imakefile: + Add ETCX11DIR to DEFINES + * InitOutput.c (InitOutput): + * winconfig.c (winConfigFiles) : + Add entries from /etc/X11/font-dirs to default fontpath + +2004-10-16 Alexander Gottwald + + * winprocarg.c (winInitializeDefaultScreens, ddxProcessArgument): + * win.h: + Make multiple monitors default for -multiwindow and -mwextwm. + Added a flag to indicate if the user has overridden the multimonitor + settings. (Øyvind Harboe, Alexander Gottwald) + +2004-10-05 Alexander Gottwald + + * XWin.rc: + Set the dialogstyle to DS_CENTERMOUSE. Dialogs will now popup on the + monitor where the mouse is and not on the center of the whole desktop. + +2004-10-02 Alexander Gottwald + + * winmouse.c (winMouseProc): + Make sure buttons 1-3 are mouse buttons and wheel events are 4-5 + Document code + Replace ErrorF with appropriate winMsg + use a symbolic name for the wheel event offset + +2004-10-01 Alexander Gottwald + + * wincreatewnd.c (winCreateBoundingWindowWindowed): + Do not adjust workarea if native windowmanager is used + +2004-09-22 Kensuke Matsuzaki + + * winclipboardthread.c (winClipboardErrorHandler): + * winclipboardwndproc.c (winClipboardWindowProc): + * winclipboardxevents.c (winClipboardFlushXEvents): + Fix clipboard bug with unicode applications. + 2004-09-16 Alexander Gottwald * wincreatewnd.c (winCreateBoundingWindowWindowed): Index: programs/Xserver/hw/xwin/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Imakefile,v retrieving revision 1.1.4.1.2.16 retrieving revision 1.1.4.1.2.17 diff -u -r1.1.4.1.2.16 -r1.1.4.1.2.17 --- programs/Xserver/hw/xwin/Imakefile 23 Apr 2004 07:43:06 -0000 1.1.4.1.2.16 +++ programs/Xserver/hw/xwin/Imakefile 20 Oct 2004 19:29:13 -0000 1.1.4.1.2.17 @@ -263,7 +263,7 @@ VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_CONTACT) $(VERSION_STRING) DEFINES = $(OS_DEFINES) $(SHMDEF) $(MMAPDEF) \ - -DPROJECTROOT="\"$(PROJECTROOT)\"" + -DPROJECTROOT="\"$(PROJECTROOT)\"" -DETCX11DIR="\"$(ETCX11DIR)\"" LinkSourceFile(stubs.c,$(SERVERSRC)/Xi) SpecialCObjectRule(stubs,$(ICONFIGFILES),$(EXT_DEFINES)) Index: programs/Xserver/hw/xwin/InitOutput.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/InitOutput.c,v retrieving revision 1.1.4.1.2.42 retrieving revision 1.1.4.1.2.43 diff -u -r1.1.4.1.2.42 -r1.1.4.1.2.43 --- programs/Xserver/hw/xwin/InitOutput.c 15 Sep 2004 16:34:15 -0000 1.1.4.1.2.42 +++ programs/Xserver/hw/xwin/InitOutput.c 20 Oct 2004 19:29:13 -0000 1.1.4.1.2.43 @@ -30,9 +30,7 @@ #include "win.h" #include "winmsg.h" -#ifdef XWIN_XF86CONFIG #include "winconfig.h" -#endif #include "winprefs.h" #include "X11/Xlocale.h" #include @@ -635,6 +633,7 @@ winMsg(X_INFO, "XF86Config is not supported\n"); winMsg(X_INFO, "See http://x.cygwin.com/docs/faq/cygwin-x-faq.html " "for more information\n"); + winConfigFiles (); #endif /* Load preferences from XWinrc file */ Index: programs/Xserver/hw/xwin/XWin.rc =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/XWin.rc,v retrieving revision 1.1.4.1.2.10 retrieving revision 1.1.4.1.2.12 diff -u -r1.1.4.1.2.10 -r1.1.4.1.2.12 --- programs/Xserver/hw/xwin/XWin.rc 28 Mar 2004 17:49:32 -0000 1.1.4.1.2.10 +++ programs/Xserver/hw/xwin/XWin.rc 20 Oct 2004 19:33:49 -0000 1.1.4.1.2.12 @@ -37,7 +37,7 @@ /* About */ ABOUT_BOX DIALOG DISCARDABLE 32, 32, 240, 105 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTER +STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE CAPTION "About Cygwin/X" FONT 8, "MS Sans Serif" BEGIN @@ -59,7 +59,7 @@ /* Depth change */ DEPTH_CHANGE_BOX DIALOG DISCARDABLE 32, 32, 180, 100 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTER +STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTERMOUSE FONT 8, "MS Sans Serif" CAPTION "Cygwin/X" BEGIN @@ -73,7 +73,7 @@ /* Exit */ EXIT_DIALOG DIALOG DISCARDABLE 32, 32, 180, 78 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTER +STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE FONT 8, "MS Sans Serif" CAPTION "Cygwin/X - Exit?" BEGIN @@ -94,6 +94,7 @@ POPUP "TRAYICON_MENU" BEGIN MENUITEM "&Hide Root Window", ID_APP_HIDE_ROOT + MENUITEM "Show Cursor", ID_APP_SHOWCURSOR MENUITEM "&About...", ID_APP_ABOUT MENUITEM SEPARATOR MENUITEM "E&xit", ID_APP_EXIT Index: programs/Xserver/hw/xwin/win.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/win.h,v retrieving revision 1.1.4.1.2.36 retrieving revision 1.1.4.1.2.38 diff -u -r1.1.4.1.2.36 -r1.1.4.1.2.38 --- programs/Xserver/hw/xwin/win.h 16 Sep 2004 12:55:11 -0000 1.1.4.1.2.36 +++ programs/Xserver/hw/xwin/win.h 28 Oct 2004 12:30:28 -0000 1.1.4.1.2.38 @@ -425,6 +425,9 @@ #ifdef XWIN_MULTIWINDOW Bool fMultiWindow; #endif +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) + Bool fMultiMonitorOverride; +#endif Bool fMultipleMonitors; Bool fLessPointer; Bool fScrollbars; @@ -508,6 +511,7 @@ LPDIRECTDRAW4 pdd4; LPDIRECTDRAWSURFACE4 pddsShadow4; LPDIRECTDRAWSURFACE4 pddsPrimary4; + BOOL fRetryCreateSurface; /* Privates used by both shadow fb DirectDraw servers */ LPDIRECTDRAWCLIPPER pddcPrimary; Index: programs/Xserver/hw/xwin/winclipboardthread.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winclipboardthread.c,v retrieving revision 1.1.4.1.2.15 retrieving revision 1.1.4.1.2.16 diff -u -r1.1.4.1.2.15 -r1.1.4.1.2.16 --- programs/Xserver/hw/xwin/winclipboardthread.c 3 Aug 2004 03:56:40 -0000 1.1.4.1.2.15 +++ programs/Xserver/hw/xwin/winclipboardthread.c 22 Sep 2004 08:11:35 -0000 1.1.4.1.2.16 @@ -429,8 +429,12 @@ pErr->error_code, pszErrorMsg, sizeof (pszErrorMsg)); - ErrorF ("winClipboardErrorHandler - ERROR: \n\t%s\n", pszErrorMsg); - + ErrorF ("winClipboardErrorHandler - ERROR: \n\t%s\n" + "\tSerial: %d, Request Code: %d, Minor Code: %d\n", + pszErrorMsg, + pErr->serial, + pErr->request_code, + pErr->minor_code); return 0; } Index: programs/Xserver/hw/xwin/winclipboardwndproc.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winclipboardwndproc.c,v retrieving revision 1.1.4.1.2.22 retrieving revision 1.1.4.1.2.23 diff -u -r1.1.4.1.2.22 -r1.1.4.1.2.23 --- programs/Xserver/hw/xwin/winclipboardwndproc.c 3 Aug 2004 03:56:40 -0000 1.1.4.1.2.22 +++ programs/Xserver/hw/xwin/winclipboardwndproc.c 22 Sep 2004 08:11:35 -0000 1.1.4.1.2.23 @@ -44,6 +44,7 @@ */ extern Bool g_fUseUnicode; +extern Bool g_fUnicodeSupport; extern void *g_pClipboardDisplay; extern Window g_iClipboardWindow; extern Atom g_atomLastOwnedSelection; @@ -445,7 +446,7 @@ if (message == WM_RENDERALLFORMATS) fConvertToUnicode = FALSE; else - fConvertToUnicode = g_fUseUnicode && (CF_UNICODETEXT == wParam); + fConvertToUnicode = g_fUnicodeSupport && (CF_UNICODETEXT == wParam); /* Request the selection contents */ iReturn = XConvertSelection (pDisplay, @@ -521,10 +522,9 @@ if (WIN_XEVENTS_NOTIFY != iReturn) { /* Paste no data, to satisfy required call to SetClipboardData */ - if (fConvertToUnicode) + if (g_fUnicodeSupport) SetClipboardData (CF_UNICODETEXT, NULL); - else - SetClipboardData (CF_TEXT, NULL); + SetClipboardData (CF_TEXT, NULL); } /* Special handling for WM_RENDERALLFORMATS */ Index: programs/Xserver/hw/xwin/winclipboardxevents.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winclipboardxevents.c,v retrieving revision 1.1.4.1.2.19 retrieving revision 1.1.4.1.2.20 diff -u -r1.1.4.1.2.19 -r1.1.4.1.2.20 --- programs/Xserver/hw/xwin/winclipboardxevents.c 3 Aug 2004 03:56:41 -0000 1.1.4.1.2.19 +++ programs/Xserver/hw/xwin/winclipboardxevents.c 22 Sep 2004 08:11:35 -0000 1.1.4.1.2.20 @@ -135,8 +135,8 @@ iReturn = XChangeProperty (pDisplay, event.xselectionrequest.requestor, event.xselectionrequest.property, - event.xselectionrequest.target, - sizeof (atomTargetArr[0]), + XA_ATOM, + 32, PropModeReplace, (unsigned char *) atomTargetArr, (sizeof (atomTargetArr) Index: programs/Xserver/hw/xwin/winconfig.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winconfig.c,v retrieving revision 1.1.4.1.2.21 retrieving revision 1.1.4.1.2.24 diff -u -r1.1.4.1.2.21 -r1.1.4.1.2.24 --- programs/Xserver/hw/xwin/winconfig.c 9 Jul 2004 12:08:58 -0000 1.1.4.1.2.21 +++ programs/Xserver/hw/xwin/winconfig.c 11 Nov 2004 14:34:03 -0000 1.1.4.1.2.24 @@ -247,6 +247,7 @@ { 0x40b, -1, "pc105", "fi", NULL, NULL, "Finnish"}, { 0x40c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"}, { 0x80c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"}, + { 0x100c, -1, "pc105", "fr_CH", NULL, NULL, "French (Switzerland)"}, { 0x410, -1, "pc105", "it", NULL, NULL, "Italian"}, { 0x411, 7, "jp106", "jp", NULL, NULL, "Japanese"}, { 0x813, -1, "pc105", "be", NULL, NULL, "Dutch (Belgian)"}, @@ -730,6 +731,127 @@ return TRUE; } +#else +Bool +winConfigFiles () +{ + MessageType from; + + /* Fontpath */ + from = X_DEFAULT; + + if (g_cmdline.fontPath) + { + from = X_CMDLINE; + defaultFontPath = g_cmdline.fontPath; + } + else + { + /* Open fontpath configuration file */ + FILE *fontdirs = fopen(ETCX11DIR "/font-dirs", "rt"); + if (fontdirs != NULL) + { + char buffer[256]; + int needs_sep = TRUE; + int comment_block = FALSE; + + /* get defautl fontpath */ + char *fontpath = xstrdup(defaultFontPath); + size_t size = strlen(fontpath); + + /* read all lines */ + while (!feof(fontdirs)) + { + size_t blen; + char *hashchar; + char *str; + int has_eol = FALSE; + + /* read one line */ + str = fgets(buffer, sizeof(buffer), fontdirs); + if (str == NULL) /* stop on error or eof */ + break; + + if (strchr(str, '\n') != NULL) + has_eol = TRUE; + + /* check if block is continued comment */ + if (comment_block) + { + /* ignore all input */ + *str = 0; + blen = 0; + if (has_eol) /* check if line ended in this block */ + comment_block = FALSE; + } + else + { + /* find comment character. ignore all trailing input */ + hashchar = strchr(str, '#'); + if (hashchar != NULL) + { + *hashchar = 0; + if (!has_eol) /* mark next block as continued comment */ + comment_block = TRUE; + } + } + + /* strip whitespaces from beginning */ + while (*str == ' ' || *str == '\t') + str++; + + /* get size, strip whitespaces from end */ + blen = strlen(str); + while (blen > 0 && (str[blen-1] == ' ' || + str[blen-1] == '\t' || str[blen-1] == '\n')) + { + str[--blen] = 0; + } + + /* still something left to add? */ + if (blen > 0) + { + size_t newsize = size + blen; + /* reserve one character more for ',' */ + if (needs_sep) + newsize++; + + /* allocate memory */ + if (fontpath == NULL) + fontpath = malloc(newsize+1); + else + fontpath = realloc(fontpath, newsize+1); + + /* add separator */ + if (needs_sep) + { + fontpath[size] = ','; + size++; + needs_sep = FALSE; + } + + /* mark next line as new entry */ + if (has_eol) + needs_sep = TRUE; + + /* add block */ + strncpy(fontpath + size, str, blen); + fontpath[newsize] = 0; + size = newsize; + } + } + + /* cleanup */ + fclose(fontdirs); + from = X_CONFIG; + defaultFontPath = xstrdup(fontpath); + free(fontpath); + } + } + winMsg (from, "FontPath set to \"%s\"\n", defaultFontPath); + + return TRUE; +} #endif Index: programs/Xserver/hw/xwin/wincreatewnd.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/wincreatewnd.c,v retrieving revision 1.1.4.1.2.12 retrieving revision 1.1.4.1.2.13 diff -u -r1.1.4.1.2.12 -r1.1.4.1.2.13 --- programs/Xserver/hw/xwin/wincreatewnd.c 16 Sep 2004 12:50:59 -0000 1.1.4.1.2.12 +++ programs/Xserver/hw/xwin/wincreatewnd.c 1 Oct 2004 11:28:16 -0000 1.1.4.1.2.13 @@ -271,20 +271,30 @@ /* We cannot have scrollbars if we do not have a window border */ pScreenInfo->fScrollbars = FALSE; } - - /* Trim window width to fit work area */ - if (iWidth > (rcWorkArea.right - rcWorkArea.left)) - iWidth = rcWorkArea.right - rcWorkArea.left; - - /* Trim window height to fit work area */ - if (iHeight >= (rcWorkArea.bottom - rcWorkArea.top)) - iHeight = rcWorkArea.bottom - rcWorkArea.top; + + if (TRUE +#ifdef XWIN_MULTIWINDOWEXTWM + && !pScreenInfo->fMWExtWM +#endif +#ifdef XWIN_MULTIWINDOW + && !pScreenInfo->fMultiWindow +#endif + ) + { + /* Trim window width to fit work area */ + if (iWidth > (rcWorkArea.right - rcWorkArea.left)) + iWidth = rcWorkArea.right - rcWorkArea.left; + + /* Trim window height to fit work area */ + if (iHeight >= (rcWorkArea.bottom - rcWorkArea.top)) + iHeight = rcWorkArea.bottom - rcWorkArea.top; #if CYGDEBUG - winDebug ("winCreateBoundingWindowWindowed - Adjusted width: %d "\ - "height: %d\n", - iWidth, iHeight); + winDebug ("winCreateBoundingWindowWindowed - Adjusted width: %d "\ + "height: %d\n", + iWidth, iHeight); #endif + } /* Set display and screen-specific tooltip text */ if (g_pszQueryHost != NULL) Index: programs/Xserver/hw/xwin/winmouse.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winmouse.c,v retrieving revision 1.1.6.5 retrieving revision 1.1.6.6 diff -u -r1.1.6.5 -r1.1.6.6 --- programs/Xserver/hw/xwin/winmouse.c 16 Sep 2004 12:55:11 -0000 1.1.6.5 +++ programs/Xserver/hw/xwin/winmouse.c 2 Oct 2004 12:44:25 -0000 1.1.6.6 @@ -65,21 +65,39 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) { int lngMouseButtons, i; + int lngWheelEvents = 2; CARD8 *map; DevicePtr pDevice = (DevicePtr) pDeviceInt; switch (iState) { case DEVICE_INIT: + /* Get number of mouse buttons */ lngMouseButtons = GetSystemMetrics(SM_CMOUSEBUTTONS); - ErrorF ("%d mouse buttons found\n", lngMouseButtons); - map = malloc(sizeof(CARD8) * (lngMouseButtons + 1 + 2)); - - for (i=1; i <= lngMouseButtons + 2; i++) + + /* Mapping of windows events to X events: + * LEFT:1 MIDDLE:2 RIGHT:3 + * SCROLL_UP:4 SCROLL_DOWN:5 + * XBUTTON 1:6 XBUTTON 2:7 ... + * + * To map scroll wheel correctly we need at least the 3 normal buttons + */ + if (lngMouseButtons < 3) + lngMouseButtons = 3; + winMsg(X_PROBED, "%d mouse buttons found\n", lngMouseButtons); + + /* allocate memory: + * number of buttons + 2x mouse wheel event + 1 extra (offset for map) + */ + map = malloc(sizeof(CARD8) * (lngMouseButtons + lngWheelEvents + 1)); + + /* initalize button map */ + map[0] = 0; + for (i=1; i <= lngMouseButtons + lngWheelEvents; i++) map[i] = i; InitPointerDeviceStruct (pDevice, map, - lngMouseButtons + 2, /* Buttons 4 and 5 are mouse wheel events */ + lngMouseButtons + lngWheelEvents, miPointerGetMotionEvents, winMouseCtrl, miPointerGetMotionBufferSize ()); Index: programs/Xserver/hw/xwin/winprocarg.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winprocarg.c,v retrieving revision 1.1.2.19 retrieving revision 1.1.2.20 diff -u -r1.1.2.19 -r1.1.2.20 --- programs/Xserver/hw/xwin/winprocarg.c 9 Jul 2004 12:11:31 -0000 1.1.2.19 +++ programs/Xserver/hw/xwin/winprocarg.c 16 Oct 2004 01:28:52 -0000 1.1.2.20 @@ -128,6 +128,9 @@ #ifdef XWIN_MULTIWINDOW g_ScreenInfo[i].fMultiWindow = FALSE; #endif +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) + g_ScreenInfo[i].fMultiMonitorOverride = FALSE; +#endif g_ScreenInfo[i].fMultipleMonitors = FALSE; g_ScreenInfo[i].fLessPointer = FALSE; g_ScreenInfo[i].fScrollbars = FALSE; @@ -399,12 +402,16 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { + if (!g_ScreenInfo[j].fMultiMonitorOverride) + g_ScreenInfo[j].fMultipleMonitors = FALSE; g_ScreenInfo[j].fFullScreen = TRUE; } } else { /* Parameter is for a single screen */ + if (!g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride) + g_ScreenInfo[g_iLastScreen].fMultipleMonitors = FALSE; g_ScreenInfo[g_iLastScreen].fFullScreen = TRUE; } @@ -451,12 +458,16 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { + if (!g_ScreenInfo[j].fMultiMonitorOverride) + g_ScreenInfo[j].fMultipleMonitors = FALSE; g_ScreenInfo[j].fDecoration = FALSE; } } else { /* Parameter is for a single screen */ + if (!g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride) + g_ScreenInfo[g_iLastScreen].fMultipleMonitors = FALSE; g_ScreenInfo[g_iLastScreen].fDecoration = FALSE; } @@ -478,12 +489,16 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { + if (!g_ScreenInfo[j].fMultiMonitorOverride) + g_ScreenInfo[j].fMultipleMonitors = TRUE; g_ScreenInfo[j].fMWExtWM = TRUE; } } else { /* Parameter is for a single screen */ + if (!g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride) + g_ScreenInfo[g_iLastScreen].fMultipleMonitors = TRUE; g_ScreenInfo[g_iLastScreen].fMWExtWM = TRUE; } @@ -505,12 +520,16 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { + if (!g_ScreenInfo[j].fMultiMonitorOverride) + g_ScreenInfo[j].fMultipleMonitors = FALSE; g_ScreenInfo[j].fRootless = TRUE; } } else { /* Parameter is for a single screen */ + if (!g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride) + g_ScreenInfo[g_iLastScreen].fMultipleMonitors = FALSE; g_ScreenInfo[g_iLastScreen].fRootless = TRUE; } @@ -532,12 +551,16 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { + if (!g_ScreenInfo[j].fMultiMonitorOverride) + g_ScreenInfo[j].fMultipleMonitors = TRUE; g_ScreenInfo[j].fMultiWindow = TRUE; } } else { /* Parameter is for a single screen */ + if (!g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride) + g_ScreenInfo[g_iLastScreen].fMultipleMonitors = TRUE; g_ScreenInfo[g_iLastScreen].fMultiWindow = TRUE; } @@ -560,12 +583,14 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { + g_ScreenInfo[j].fMultiMonitorOverride = TRUE; g_ScreenInfo[j].fMultipleMonitors = TRUE; } } else { /* Parameter is for a single screen */ + g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride = TRUE; g_ScreenInfo[g_iLastScreen].fMultipleMonitors = TRUE; } @@ -574,6 +599,36 @@ } /* + * Look for the '-nomultiplemonitors' argument + */ + if (IS_OPTION ("-nomultiplemonitors") + || IS_OPTION ("-nomultimonitors")) + { + /* Is this parameter attached to a screen or is it global? */ + if (-1 == g_iLastScreen) + { + int j; + + /* Parameter is for all screens */ + for (j = 0; j < MAXSCREENS; j++) + { + g_ScreenInfo[j].fMultiMonitorOverride = TRUE; + g_ScreenInfo[j].fMultipleMonitors = FALSE; + } + } + else + { + /* Parameter is for a single screen */ + g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride = TRUE; + g_ScreenInfo[g_iLastScreen].fMultipleMonitors = FALSE; + } + + /* Indicate that we have processed this argument */ + return 1; + } + + + /* * Look for the '-scrollbars' argument */ if (IS_OPTION ("-scrollbars")) Index: programs/Xserver/hw/xwin/winresource.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winresource.h,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- programs/Xserver/hw/xwin/winresource.h 28 Mar 2004 17:49:32 -0000 1.1.2.6 +++ programs/Xserver/hw/xwin/winresource.h 20 Oct 2004 19:33:50 -0000 1.1.2.7 @@ -48,6 +48,7 @@ #define ID_APP_HIDE_ROOT 201 #define ID_APP_ALWAYS_ON_TOP 202 #define ID_APP_ABOUT 203 +#define ID_APP_SHOWCURSOR 204 #define ID_ABOUT_UG 300 #define ID_ABOUT_FAQ 301 Index: programs/Xserver/hw/xwin/winshadddnl.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winshadddnl.c,v retrieving revision 1.1.4.1.2.9 retrieving revision 1.1.4.1.2.10 diff -u -r1.1.4.1.2.9 -r1.1.4.1.2.10 --- programs/Xserver/hw/xwin/winshadddnl.c 25 Apr 2004 19:27:05 -0000 1.1.4.1.2.9 +++ programs/Xserver/hw/xwin/winshadddnl.c 28 Oct 2004 12:30:28 -0000 1.1.4.1.2.10 @@ -141,11 +141,21 @@ &ddsd, &pScreenPriv->pddsPrimary4, NULL); + pScreenPriv->fRetryCreateSurface = FALSE; if (FAILED (ddrval)) { - ErrorF ("winCreatePrimarySurfaceShadowDDNL - Could not create primary " - "surface: %08x\n", - (unsigned int) ddrval); + if (ddrval == DDERR_NOEXCLUSIVEMODE) + { + /* Recreating the surface failed. Mark screen to retry later */ + pScreenPriv->fRetryCreateSurface = TRUE; + winDebug ("winCreatePrimarySurfaceShadowDDNL - Could not create " + "primary surface: DDERR_NOEXCLUSIVEMODE\n"); + } + else + { + ErrorF ("winCreatePrimarySurfaceShadowDDNL - Could not create " + "primary surface: %08x\n", (unsigned int) ddrval); + } return FALSE; } @@ -1055,6 +1065,17 @@ Bool fReturn = TRUE; int i; + /* Quite common case. The primary surface was lost (maybe because of depth + * change). Try to create a new primary surface. Bail out if this fails */ + if (pScreenPriv->pddsPrimary4 == NULL && pScreenPriv->fRetryCreateSurface && + !winCreatePrimarySurfaceShadowDDNL(pScreen)) + { + Sleep(100); + return FALSE; + } + if (pScreenPriv->pddsPrimary4 == NULL) + return FALSE; + /* BeginPaint gives us an hdc that clips to the invalidated region */ hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps); if (hdcUpdate == NULL) Index: programs/Xserver/hw/xwin/winwndproc.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winwndproc.c,v retrieving revision 1.1.4.1.2.26 retrieving revision 1.1.4.1.2.27 diff -u -r1.1.4.1.2.26 -r1.1.4.1.2.27 --- programs/Xserver/hw/xwin/winwndproc.c 16 Sep 2004 12:55:11 -0000 1.1.4.1.2.26 +++ programs/Xserver/hw/xwin/winwndproc.c 20 Oct 2004 19:33:50 -0000 1.1.4.1.2.27 @@ -1161,6 +1161,9 @@ /* Display Exit dialog */ winDisplayExitDialog (s_pScreenPriv); return 0; + case ID_APP_SHOWCURSOR: + winDebug("ShowCursor: %d\n", ShowCursor(TRUE)); + return 0; #ifdef XWIN_MULTIWINDOW case ID_APP_HIDE_ROOT: