diff -ur ooo_SRC680_m204_src/vcl.orig/unx/source/window/salframe.cxx ooo_SRC680_m204_src/vcl/unx/source/window/salframe.cxx --- ooo_SRC680_m204_src/vcl.orig/unx/source/window/salframe.cxx 2007-02-27 16:08:48.000000000 +0100 +++ ooo_SRC680_m204_src/vcl/unx/source/window/salframe.cxx 2007-02-27 16:12:07.000000000 +0100 @@ -3442,6 +3442,40 @@ { if( maGeometry.nX != pEvent->x || maGeometry.nY != pEvent->y ) { + Size aScreenSize = GetDisplay()->GetScreenSize( m_nScreen ); + unsigned int nScreenWidth = aScreenSize.Width(); + unsigned int nScreenHeight = aScreenSize.Height(); + + fprintf(stderr, "PJ: screensize %dx%d\n", nScreenWidth, nScreenHeight); + fprintf(stderr, "PJ: old position: +%d+%d\n", maGeometry.nX, maGeometry.nY); + fprintf(stderr, "PJ: new position: +%d+%d\n", pEvent->x, pEvent->y); + +#ifdef MACOSX + // Better would be to test if the X server we are running on is Apple X11, but ... + + // Repaint the window if it was possible to draw outside of the screen (in theory) + // 1. the window was below the screen and the window was moved up + // 2. the window was above the screen and the window was moved down + // 3. the window was out of the screen on the right side and the window was moved left + // 4. the window's left part was out of the screen and the window was moved right + if ( ( maGeometry.nY+maGeometry.nHeight > nScreenHeight && + pEvent->y < maGeometry.nY ) || + ( maGeometry.nY < 0 && pEvent->y > maGeometry.nY ) || + ( maGeometry.nX+maGeometry.nWidth > nScreenWidth && + pEvent->x < maGeometry.nX ) || + ( maGeometry.nX < 0 && pEvent->x > maGeometry.nX) ) + { + XEvent aEvent; + aEvent.xexpose.type = Expose; + aEvent.xexpose.display = pDisplay_->GetDisplay(); + aEvent.xexpose.x = 0; + aEvent.xexpose.y = 0; + aEvent.xexpose.width = maGeometry.nWidth; + aEvent.xexpose.height = maGeometry.nHeight; + aEvent.xexpose.count = 0; + HandleExposeEvent(&aEvent); + } +#endif maGeometry.nX = pEvent->x; maGeometry.nY = pEvent->y; CallCallback( SALEVENT_MOVE, NULL );