From d725fd941361f300d9cdf9501d42514fbb06bcc9 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 17 Oct 2008 05:16:26 +0000 Subject: [PATCH] swap screens with the containment we kick off our screen if we have a screen of our own to trade them svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=872382 --- containment.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/containment.cpp b/containment.cpp index 436ec9199..7a937bf11 100644 --- a/containment.cpp +++ b/containment.cpp @@ -722,7 +722,17 @@ Applet::List Containment::applets() const void Containment::setScreen(int screen) { - // screen of -1 means no associated screen. + // What we want to do in here is: + // * claim the screen as our own + // * signal whatever may be watching this containment about the switch + // * if we are a full screen containment, then: + // * resize to match the screen if we're that kind of containment + // * kick other full-screen containments off this screen + // * if we had a screen, then give our screen to the containment + // we kick out + // + // a screen of -1 means no associated screen. + Containment *swapScreensWith(0); if (d->type == DesktopContainment || d->type == CustomContainment) { #ifndef Q_OS_WIN // we want to listen to changes in work area if our screen changes @@ -742,6 +752,7 @@ void Containment::setScreen(int screen) // << "and is" << currently->name() // << (QObject*)currently << (QObject*)this; currently->setScreen(-1); + swapScreensWith = currently; } } } @@ -771,6 +782,10 @@ void Containment::setScreen(int screen) c.writeEntry("screen", d->screen); emit configNeedsSaving(); } + + if (swapScreensWith) { + swapScreensWith->setScreen(oldScreen); + } } int Containment::screen() const