diff -BburN WindowMaker-0.80.1.orig/configure WindowMaker-0.80.1/configure --- WindowMaker-0.80.1.orig/configure Tue Jul 2 02:37:46 2002 +++ WindowMaker-0.80.1/configure Thu Sep 5 10:01:24 2002 @@ -11747,7 +11747,7 @@ fi -xinerama=no +xinerama=yes #AC_ARG_ENABLE(xinerama, #[ --disable-xinerama disable XInerama extension support], # xinerama=$enableval, xinerama=yes) diff -BburN WindowMaker-0.80.1.orig/configure.ac WindowMaker-0.80.1/configure.ac --- WindowMaker-0.80.1.orig/configure.ac Tue Mar 26 11:47:11 2002 +++ WindowMaker-0.80.1/configure.ac Thu Sep 5 10:01:12 2002 @@ -461,10 +461,10 @@ dnl XINERAMA support dnl ================ -xinerama=no -#AC_ARG_ENABLE(xinerama, -#[ --disable-xinerama disable XInerama extension support], -# xinerama=$enableval, xinerama=yes) +xinerama=yes +AC_ARG_ENABLE(xinerama, +[ --disable-xinerama disable XInerama extension support], + xinerama=$enableval, xinerama=yes) if test "$xinerama" = yes; then AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [XLIBS="-lXinerama $XLIBS" diff -BburN WindowMaker-0.80.1.orig/src/dialog.c WindowMaker-0.80.1/src/dialog.c --- WindowMaker-0.80.1.orig/src/dialog.c Thu Feb 21 12:28:48 2002 +++ WindowMaker-0.80.1/src/dialog.c Thu Sep 5 10:00:06 2002 @@ -145,6 +145,7 @@ Window parent; WWindow *wwin; int result; + WMPoint center; panel = WMCreateAlertPanel(scr->wmscreen, NULL, title, message, defBtn, altBtn, othBtn); @@ -163,9 +164,9 @@ XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0); - wwin = wManageInternalWindow(scr, parent, None, NULL, - (scr->scr_width - 400)/2, - (scr->scr_height - 180)/2, 400, 180); + center = getCenter(scr, 400, 180); + wwin = wManageInternalWindow(scr, parent, None, NULL, center.x, center.y, + 400, 180); wwin->client_leader = WMWidgetXID(panel->win); WMMapWidget(panel->win); diff -BburN WindowMaker-0.80.1.orig/src/placement.c WindowMaker-0.80.1/src/placement.c --- WindowMaker-0.80.1.orig/src/placement.c Tue Jan 8 14:45:13 2002 +++ WindowMaker-0.80.1/src/placement.c Thu Sep 5 10:00:05 2002 @@ -39,7 +39,7 @@ #include "application.h" #include "appicon.h" #include "dock.h" - +#include "xinerama.h" extern WPreferences wPreferences; @@ -334,6 +334,28 @@ return sum_isect; } +#ifdef XINERAMA +static int +isOverBoard(WScreen *scr, int x, int y, unsigned int w, unsigned int h) +{ + WMRect rect; + WMPoint point; + + point.x = x; + point.y = y; + + rect = wGetRectForHead(scr, wGetHeadForPoint(scr, point)); + if (rect.pos.x <= x && + rect.pos.y <= y && + x + w <= rect.pos.x + rect.size.width - + wPreferences.window_place_origin.x && + y + h <= rect.pos.y + rect.size.height - + wPreferences.window_place_origin.y) + return 0; + else + return 1; +} +#endif static void smartPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, @@ -367,6 +388,11 @@ while ((test_x + width) < usableArea.x2) { +#ifdef XINERAMA + if (isOverBoard(scr, test_x, test_y, width, height)) { + sum_isect = INT_MAX; + } else +#endif sum_isect = calcSumOfCoveredAreas(wwin, test_x, test_y, width, height); @@ -395,6 +421,11 @@ for (test_x = from_x; test_x < to_x; test_x++) { for (test_y = from_y; test_y < to_y; test_y++) { +#ifdef XINERAMA + if (isOverBoard(scr, test_x, test_y, width, height)) { + sum_isect = INT_MAX; + } else +#endif sum_isect = calcSumOfCoveredAreas(wwin, test_x, test_y, width, height); diff -BburN WindowMaker-0.80.1.orig/src/xinerama.c WindowMaker-0.80.1/src/xinerama.c --- WindowMaker-0.80.1.orig/src/xinerama.c Sat Feb 16 05:53:33 2002 +++ WindowMaker-0.80.1/src/xinerama.c Thu Sep 5 10:00:04 2002 @@ -220,6 +220,8 @@ WMRect wGetUsableRectForHead(WScreen *scr, int head) { + WMRect rect; + if (head < scr->xine_count) { rect.pos.x = scr->xine_screens[head].x_org; rect.pos.y = scr->xine_screens[head].y_org;