#7 Don't render garbage on multi monitor setup

open
nobody
None
5
2005-02-10
2005-02-10
No

Make loadWallpaper and prepareWallpaper aware of the
current screen. Replace prepareWallpaper with this:

void KSmoothDock::prepareWallpaper() {
DCOPClient *client = KApplication::dcopClient();
if (!client->isAttached()) {
client->attach();
client->registerAs( QCString( "KSmoothDock" ) );
}
QByteArray data;
QDataStream args( data, IO_WriteOnly );
args << 1;

Display *display = qt_xdisplay();

QCString appname( "kdesktop" );
int screen_number = DefaultScreen(qt_xdisplay());
if ( screen_number )
appname.sprintf("kdesktop-screen-%d", screen_number );

client->send( appname, "KBackgroundIface",
"setExport(int)", data );
}

and loadWallpaper() with this:

void KSmoothDock::loadWallpaper() {
// cout << "Load wallpaper " << curDesk << endl;
if (wallpapers[curDesk - 1] == NULL) {
wallpapers[curDesk - 1] = new KSharedPixmap();
connect(wallpapers[curDesk - 1],
SIGNAL(done(bool)), SLOT(wallpaperLoaded(bool)));
}

QCString atomname;
int screen_number = DefaultScreen(qt_xdisplay());
if ( screen_number )

atomname.sprintf("SCREEN%d-DESKTOP%d",screen_number,curDesk);
else
atomname.sprintf("DESKTOP%d",curDesk);

wallpapers[curDesk - 1]->loadFromShared(atomname);
}

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks