--- src/Screen.hh.orig 2003-08-04 21:34:17.000000000 -0700 +++ src/Screen.hh 2003-08-10 19:58:32.000000000 -0700 @@ -154,6 +154,7 @@ Rect usableArea; #ifdef XINERAMA RectList xineramaUsableArea; + RectList xineramaUsableRect; #endif // XINERAMA typedef std::list StrutList; @@ -375,6 +376,7 @@ const Rect& availableArea(void) const; #ifdef XINERAMA const RectList& allAvailableAreas(void) const; + const RectList& allAvailableRects(void) const; #endif // XINERAMA void updateAvailableArea(void); void addStrut(Strut *strut); --- src/Screen.cc.orig 2003-08-04 19:24:27.000000000 -0700 +++ src/Screen.cc 2003-08-10 20:04:29.000000000 -0700 @@ -2495,6 +2516,15 @@ xineramaUsableArea[0].width(), xineramaUsableArea[0].height()); return xineramaUsableArea; } + +const RectList& BScreen::allAvailableRects(void) const { + assert(isXineramaActive()); + assert(xineramaUsableRect.size() > 0); + fprintf(stderr, "1rect x %d y %d w %d h %d\n", + xineramaUsableRect[0].x(), xineramaUsableRect[0].y(), + xineramaUsableRect[0].width(), xineramaUsableRect[0].height()); + return xineramaUsableRect; +} #endif // XINERAMA @@ -2506,6 +2536,7 @@ // reset to the full areas if (isXineramaActive()) xineramaUsableArea = getXineramaAreas(); + xineramaUsableRect = getXineramaAreas(); #endif // XINERAMA /* these values represent offsets from the screen edge --- src/Window.cc.orig 2003-08-04 21:23:53.000000000 -0700 +++ src/Window.cc 2003-08-10 20:00:59.000000000 -0700 @@ -2101,8 +2101,27 @@ blackbox_attrib.prefull_h = client.rect.height() + frame.margin.top + frame.margin.bottom; // go fullscreen +#ifdef XINERAMA + if (screen->isXineramaActive() && blackbox->doXineramaMaximizing()) { + // find the area to use + RectList availableAreas = screen->allAvailableRects(); + RectList::iterator it, end = availableAreas.end(); + + for (it = availableAreas.begin(); it != end; ++it) + if (it->intersects(frame.rect)) break; + if (it == end) // the window isn't inside an area + it = availableAreas.begin(); // so just default to the first one + + client.rect = *it; + frame.rect = *it; + } else { + client.rect = screen->getRect(); + frame.rect = screen->getRect(); + } +#else client.rect = screen->getRect(); frame.rect = screen->getRect(); +#endif // XINERAMA configure(frame.rect.x(), frame.rect.y(), frame.rect.width(), frame.rect.height()); // disbale decorations