Patch for multiple monitors
Hi, I attach a patch for multiple monitors, diffed against xwin-20021107-0015. I have added a command-line flag -multiplemonitors which activates the extra code. This works on my machine in both windowed and rootless modes for engines 1, 2 and 4. It does not work in fullscreen mode because the defaults for the fullscreen dimensions are calculated before the command line parameters are parsed (as far as I could figure out). It should be possible to make this behaviour the default (SM_CXSCREEN == SM_CXVIRTUALSCREEN etc. if there is only one monitor), which would remove many of the if {} else {} blocks, and also might make fullscreen mode work My machine is running Windows 2000. Both my graphics cards are set at 1600x1200 32bit colour. It's great - I'm running KDE in rootless mode, and I get the kicker across the bottom of both monitors, and I can drag X windows from one monitor to the other ... Comments? Nick diff -uw ./InitOutput.c ../../x-devel/build/opt/programs/Xserver/hw/xwin/InitOutput.c --- ./InitOutput.c 2002-11-07 05:21:18.0 + +++ ../../x-devel/build/opt/programs/Xserver/hw/xwin/InitOutput.c 2003-01-09 16:51:10.0 + @@ -114,7 +114,8 @@ /* Zero the memory used for storing the screen info */ ZeroMemory (g_ScreenInfo, MAXSCREENS * sizeof (winScreenInfo)); - /* Get default width and height */ + /* Get default width and height. These will just be for the primary + monitor in the case that we have multiple monitors. */ dwWidth = GetSystemMetrics (SM_CXSCREEN); dwHeight = GetSystemMetrics (SM_CYSCREEN); @@ -139,6 +140,7 @@ g_ScreenInfo[i].fFullScreen = FALSE; g_ScreenInfo[i].fDecoration = TRUE; g_ScreenInfo[i].fRootless = FALSE; + g_ScreenInfo[i].fMultiplemonitors = FALSE; g_ScreenInfo[i].fLessPointer = FALSE; g_ScreenInfo[i].fScrollbars = FALSE; g_ScreenInfo[i].iE3BTimeout = WIN_E3B_OFF; @@ -303,6 +305,10 @@ ErrorF (-rootless\n \tEXPERIMENTAL: Run the server in pseudo-rootless mode.\n); + ErrorF (-multiplemonitors\n + \tEXPERIMENTAL: Use the entire virtual screen if multiple\n + \tmonitors are present.\n); + ErrorF (-scrollbars\n \tIn windowed mode, allow screens bigger than the Windows desktop.\n \tMoreover, if the window has decorations, one can now resize\n @@ -653,6 +659,32 @@ } /* + * Look for the '-multiplemonitors' argument + */ + if (strcmp (argv[i], -multiplemonitors) == 0) +{ + /* 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].fMultiplemonitors = TRUE; + } + } + else + { + /* Parameter is for a single screen */ + g_ScreenInfo[g_iLastScreen].fMultiplemonitors = TRUE; + } + + /* Indicate that we have processed this argument */ + return 1; +} + + /* * Look for the '-scrollbars' argument */ if (strcmp (argv[i], -scrollbars) == 0) diff -uw ./win.h ../../x-devel/build/opt/programs/Xserver/hw/xwin/win.h --- ./win.h 2002-11-07 05:33:17.0 + +++ ../../x-devel/build/opt/programs/Xserver/hw/xwin/win.h 2003-01-09 16:51:38.0 + @@ -390,6 +390,7 @@ Bool fFullScreen; Bool fDecoration; Bool fRootless; + Bool fMultiplemonitors; Bool fLessPointer; Bool fScrollbars; int iE3BTimeout; diff -uw ./wincreatewnd.c ../../x-devel/build/opt/programs/Xserver/hw/xwin/wincreatewnd.c --- ./wincreatewnd.c2002-10-19 04:56:52.0 +0100 +++ ../../x-devel/build/opt/programs/Xserver/hw/xwin/wincreatewnd.c 2003-01-10 15:11:26.0 + @@ -31,16 +31,17 @@ #include win.h #include shellapi.h /* * Local function prototypes */ static Bool +winGetWorkArea (RECT *prcWorkArea, winScreenInfo *pScreenInfo); +static Bool winAdjustForAutoHide (RECT *prcWorkArea); - /* * Create a full screen window */ @@ -155,7 +156,7 @@ RegisterClass (wc); /* Get size of work area */ - SystemParametersInfo (SPI_GETWORKAREA, 0, rcWorkArea, 0); + winGetWorkArea (rcWorkArea, pScreenInfo); /* Adjust for auto-hide taskbars */ winAdjustForAutoHide (rcWorkArea); @@ -206,10 +207,18 @@ * In this case we have to ignore the requested width and height * and instead use the largest possible window that we can. */ + if (pScreenInfo-fMultiplemonitors) + { + iWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN); + iHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN); + } + else + { iWidth = GetSystemMetrics (SM_CXSCREEN); iHeight = GetSystemMetrics (SM_CYSCREEN); } } +
Re: Patch for multiple monitors
Nick, Wow! I like it alot! I am currently trying to get a build of Kensuke's latest multiwindow patch posted and a patch to xwinclip to handle the -display parameter. Once I get those done I will start merging your patch. Or, I may merge them both at once, but it would probably be wiser to wait so we have two versions to assign bug blame :) Thanks for the patch, Harold Nick Crabtree wrote: Hi, I attach a patch for multiple monitors, diffed against xwin-20021107-0015. I have added a command-line flag -multiplemonitors which activates the extra code. This works on my machine in both windowed and rootless modes for engines 1, 2 and 4. It does not work in fullscreen mode because the defaults for the fullscreen dimensions are calculated before the command line parameters are parsed (as far as I could figure out). It should be possible to make this behaviour the default (SM_CXSCREEN == SM_CXVIRTUALSCREEN etc. if there is only one monitor), which would remove many of the if {} else {} blocks, and also might make fullscreen mode work My machine is running Windows 2000. Both my graphics cards are set at 1600x1200 32bit colour. It's great - I'm running KDE in rootless mode, and I get the kicker across the bottom of both monitors, and I can drag X windows from one monitor to the other ... Comments? Nick diff -uw ./InitOutput.c ../../x-devel/build/opt/programs/Xserver/hw/xwin/InitOutput.c --- ./InitOutput.c 2002-11-07 05:21:18.0 + +++ ../../x-devel/build/opt/programs/Xserver/hw/xwin/InitOutput.c 2003-01-09 16:51:10.0 + @@ -114,7 +114,8 @@ /* Zero the memory used for storing the screen info */ ZeroMemory (g_ScreenInfo, MAXSCREENS * sizeof (winScreenInfo)); - /* Get default width and height */ + /* Get default width and height. These will just be for the primary + monitor in the case that we have multiple monitors. */ dwWidth = GetSystemMetrics (SM_CXSCREEN); dwHeight = GetSystemMetrics (SM_CYSCREEN); @@ -139,6 +140,7 @@ g_ScreenInfo[i].fFullScreen = FALSE; g_ScreenInfo[i].fDecoration = TRUE; g_ScreenInfo[i].fRootless = FALSE; + g_ScreenInfo[i].fMultiplemonitors = FALSE; g_ScreenInfo[i].fLessPointer = FALSE; g_ScreenInfo[i].fScrollbars = FALSE; g_ScreenInfo[i].iE3BTimeout = WIN_E3B_OFF; @@ -303,6 +305,10 @@ ErrorF (-rootless\n \tEXPERIMENTAL: Run the server in pseudo-rootless mode.\n); + ErrorF (-multiplemonitors\n + \tEXPERIMENTAL: Use the entire virtual screen if multiple\n + \tmonitors are present.\n); + ErrorF (-scrollbars\n \tIn windowed mode, allow screens bigger than the Windows desktop.\n \tMoreover, if the window has decorations, one can now resize\n @@ -653,6 +659,32 @@ } /* + * Look for the '-multiplemonitors' argument + */ + if (strcmp (argv[i], -multiplemonitors) == 0) +{ + /* 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].fMultiplemonitors = TRUE; + } + } + else + { + /* Parameter is for a single screen */ + g_ScreenInfo[g_iLastScreen].fMultiplemonitors = TRUE; + } + + /* Indicate that we have processed this argument */ + return 1; +} + + /* * Look for the '-scrollbars' argument */ if (strcmp (argv[i], -scrollbars) == 0) diff -uw ./win.h ../../x-devel/build/opt/programs/Xserver/hw/xwin/win.h --- ./win.h 2002-11-07 05:33:17.0 + +++ ../../x-devel/build/opt/programs/Xserver/hw/xwin/win.h 2003-01-09 16:51:38.0 + @@ -390,6 +390,7 @@ Bool fFullScreen; Bool fDecoration; Bool fRootless; + Bool fMultiplemonitors; Bool fLessPointer; Bool fScrollbars; int iE3BTimeout; diff -uw ./wincreatewnd.c ../../x-devel/build/opt/programs/Xserver/hw/xwin/wincreatewnd.c --- ./wincreatewnd.c 2002-10-19 04:56:52.0 +0100 +++ ../../x-devel/build/opt/programs/Xserver/hw/xwin/wincreatewnd.c 2003-01-10 15:11:26.0 + @@ -31,16 +31,17 @@ #include win.h #include shellapi.h /* * Local function prototypes */ static Bool +winGetWorkArea (RECT *prcWorkArea, winScreenInfo *pScreenInfo); +static Bool winAdjustForAutoHide (RECT *prcWorkArea); - /* * Create a full screen window */ @@ -155,7 +156,7 @@ RegisterClass (wc); /* Get size of work area */ - SystemParametersInfo (SPI_GETWORKAREA, 0, rcWorkArea, 0); + winGetWorkArea (rcWorkArea, pScreenInfo); /* Adjust for auto-hide taskbars */ winAdjustForAutoHide (rcWorkArea); @@ -206,10 +207,18 @@ * In this case we have to ignore the requested width and height * and instead use the largest possible window that we can. */ + if (pScreenInfo-fMultiplemonitors) + { + iWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN); + iHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN); + } + else + { iWidth = GetSystemMetrics (SM_CXSCREEN);
Error linking GLUT
I'm trying to compile Redbook examples, but ld is unable to resolve glut calls. I'm trying to use X11/GL, not Win32, is it possible?. I've installed ALL packages (including XFree and Opengl). I've got Windows XP SP1, videocard Radeon 9000, cygwin is installed on c:\cygwin. Thanks. Manuel. ___ Yahoo! Postales Felicita las Navidades con las postales más divertidas desde http://postales.yahoo.es
Re: Error linking GLUT
Manuel, Yes, it is very possible. You need to grab the XFree86-prog package, and you need to make sure that your -L link flags are in the correct order. Output from the compiler (with the actual commands shown) would help us figure out what is wrong. Harold Manuel Garcia Rodriguez wrote: I'm trying to compile Redbook examples, but ld is unable to resolve glut calls. I'm trying to use X11/GL, not Win32, is it possible?. I've installed ALL packages (including XFree and Opengl). I've got Windows XP SP1, videocard Radeon 9000, cygwin is installed on c:\cygwin. Thanks. Manuel. ___ Yahoo! Postales Felicita las Navidades con las postales más divertidas desde http://postales.yahoo.es
RE: Window Maker received signal 11
Patrick Knodle wrote: I just installed the latest version of XFree86 and made 2 changes to the startxwin.bat file to access our servers. When I open this file I get the message: I think I saw this when I was using text-mounted file systems. Switching to binary mounts corrected it for me. I'm pretty sure this is in a FAQ someplace. Or you can always search/google the archives. -Jerry