--Boundary-00=_hpxqGZWIQ0sA7q9 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, When used with multiple screens (Xinerama) kslideshow.kss paints right in t= he=20 middle of the xinerama screen, between two monitors. This patch fixes this= =20 behavior. It paints a different picture on each screen. The patch is against kde-3.5.7. slideshow.(cpp|h) are in the kdeartwork=20 package (kscreensaver/kdesavers). =46rom a quick glance the patch should also appy to trunk. I haven't tested= it=20 since I don't have a working env for kde4 development. It breaks portabilit= y=20 though, because it calls X11-specific functions.=20 =2D-=20 Regards, Arno. --Boundary-00=_hpxqGZWIQ0sA7q9 Content-Type: text/x-diff; charset="iso-8859-1"; name="slideshow.h.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="slideshow.h.patch" --- slideshow.h.old 2007-07-28 11:48:24.854947743 +0200 +++ slideshow.h 2007-07-28 11:29:14.659085750 +0200 @@ -85,6 +85,14 @@ void startPainter(Qt::PenStyle penStyle=NoPen); protected: + struct mScreenGeo { + mScreenGeo(int w, int h, int x, int y) : mW(w), mH(h), mXorg(x), mYorg(y) {}; + int mW; + int mH; + int mXorg; + int mYorg; + }; + QPtrList mGeoList; bool mEffectRunning; QTimer mTimer; int mColorContext; --Boundary-00=_hpxqGZWIQ0sA7q9 Content-Type: text/x-diff; charset="iso-8859-1"; name="slideshow.cpp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="slideshow.cpp.patch" --- slideshow.cpp.old 2007-07-28 11:48:14.290617982 +0200 +++ slideshow.cpp 2007-07-28 12:13:49.382390706 +0200 @@ -34,6 +34,8 @@ #include #include +#include + #include #include #include @@ -94,11 +96,26 @@ mColorContext = QColor::enterAllocContext(); mEffectRunning = false; - loadNextImage(); - createNextScreen(); mTimer.start(10, true); connect(&mTimer, SIGNAL(timeout()), SLOT(slotTimeout())); + + Display *dPtr = QPaintDevice::x11AppDisplay(); + mGeoList.setAutoDelete(true); + if(XineramaIsActive(dPtr)) + { + int numScreens = 0; + XineramaScreenInfo *scrInfo = XineramaQueryScreens(dPtr, &numScreens); + for(int i = 0; i < numScreens; ++i) + { + mGeoList.append(new mScreenGeo(scrInfo[i].width, scrInfo[i].height, scrInfo[i].x_org, scrInfo[i].y_org)); + } + } + else + { + mGeoList.append(new mScreenGeo(mNextScreen.width(), mNextScreen.height(), 0, 0)); + } + createNextScreen(); } @@ -724,12 +741,17 @@ mNextScreen.fill(black); - ww = mNextScreen.width(); - wh = mNextScreen.height(); + p.begin(&mNextScreen); + + mScreenGeo *geoptr = 0; + for(geoptr = mGeoList.first(); geoptr; geoptr = mGeoList.next()) + { + loadNextImage(); + iw = mImage.width(); ih = mImage.height(); - - p.begin(&mNextScreen); + ww = geoptr->mW; + wh = geoptr->mH; if (mFileList.isEmpty()) { @@ -749,8 +771,8 @@ ih = (int)(ih * fx); QImage scaledImg = mImage.smoothScale(iw, ih); - x = (ww - iw) >> 1; - y = (wh - ih) >> 1; + x = ((ww - iw) >> 1) + geoptr->mXorg; + y = ((wh - ih) >> 1) + geoptr->mYorg; p.drawImage(x, y, scaledImg); } @@ -766,8 +788,8 @@ ih = (int)(ih * fx); QImage scaledImg = mImage.smoothScale(iw, ih); - x = (ww - iw) >> 1; - y = (wh - ih) >> 1; + x = ((ww - iw) >> 1) + geoptr->mXorg; + y = ((wh - ih) >> 1) + geoptr->mYorg; p.drawImage(x, y, scaledImg); } @@ -775,13 +797,13 @@ { if(mRandomPosition) { - x = rand() % (ww - iw); - y = rand() % (wh - ih); + x = (rand() % (ww - iw)) + geoptr->mXorg; + y = (rand() % (wh - ih)) + geoptr->mYorg; } else { - x = (ww - iw) >> 1; - y = (wh - ih) >> 1; + x = ((ww - iw) >> 1) + geoptr->mXorg; + y = ((wh - ih) >> 1) + geoptr->mYorg; } // bitBlt(&mNextScreen, x, y, &mImage, 0, 0, iw, ih, CopyROP, false); @@ -794,12 +816,12 @@ p.setPen(QColor("black")); for (x=9; x<=11; x++) for (y=21; y>=19; y--) - p.drawText(x, wh-y, mImageName); + p.drawText(x + geoptr->mXorg, wh-y+geoptr->mYorg, mImageName); p.setPen(QColor("white")); - p.drawText(10, wh-20, mImageName); + p.drawText(10 + geoptr->mXorg, wh-20 + geoptr->mYorg, mImageName); + } } } - p.end(); } --Boundary-00=_hpxqGZWIQ0sA7q9 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --Boundary-00=_hpxqGZWIQ0sA7q9--