diff --git a/containment.cpp b/containment.cpp index 2e05c9cf9..948754c64 100644 --- a/containment.cpp +++ b/containment.cpp @@ -120,16 +120,6 @@ void Containment::init() } } - if (type() == PanelContainment) { - //kDebug() << "we are a panel, let's move ourselves to a negative coordinate system"; - QDesktopWidget desktop; - QRect r = desktop.screenGeometry(screen()); - //FIXME PANELS: multiple panel support means having to move the panels up - // this requires a proper panel manager, discuss in the panel - // irc meeting - translate(0, -r.height() - INTER_CONTAINMENT_MARGIN); - } - //TODO: would be nice to not do this on init, as it causes Phase to init connect(Phase::self(), SIGNAL(animationComplete(QGraphicsItem*,Plasma::Phase::Animation)), this, SLOT(appletDisappearComplete(QGraphicsItem*,Plasma::Phase::Animation))); @@ -472,6 +462,8 @@ Applet::List Containment::applets() const void Containment::setScreen(int screen) { + // screen of -1 means no associated screen. + //kDebug() << "setting screen to" << screen; QDesktopWidget desktop; int numScreens = desktop.numScreens(); @@ -480,9 +472,19 @@ void Containment::setScreen(int screen) } //kDebug() << "setting scrreen to " << screen << "and type is" << type(); - if (screen > -1 && type() == DesktopContainment) { - setGeometry(desktop.screenGeometry(screen)); - //kDebug() << "setting geometry to" << desktop.screenGeometry(screen) << geometry(); + if (screen > -1) { + if (type() == DesktopContainment) { + setGeometry(desktop.screenGeometry(screen)); + //kDebug() << "setting geometry to" << desktop.screenGeometry(screen) << geometry(); + } else if (type() == PanelContainment) { + //kDebug() << "we are a panel, let's move ourselves to a negative coordinate system"; + QDesktopWidget desktop; + QRect r = desktop.screenGeometry(screen); + //FIXME PANELS: multiple panel support means having to move the panels up + // this requires a proper panel manager, discuss in the panel + // irc meeting + translate(0, -r.height() - INTER_CONTAINMENT_MARGIN); + } } d->screen = screen; diff --git a/corona.cpp b/corona.cpp index ac24a59ed..89da1ba36 100644 --- a/corona.cpp +++ b/corona.cpp @@ -221,6 +221,7 @@ void Corona::loadDefaultSetup() // make a panel at the bottom Containment* panel = addContainment("panel", (QVariantList() << (int)Plasma::BottomEdge)); + panel->setScreen(0); // some default applets to get a usable UI panel->addApplet("launcher"); diff --git a/widgets/widget.cpp b/widgets/widget.cpp index 733c76b94..5c93fc470 100644 --- a/widgets/widget.cpp +++ b/widgets/widget.cpp @@ -378,7 +378,7 @@ void Widget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QW // Auto-adjust the pixmap size. if (deviceRect.size() != pix.size()) { pix = QPixmap(deviceRect.size()); - pix.fill(Qt::transparent); + pix.fill(Qt::transparent); exposed = brect; } @@ -441,10 +441,10 @@ void Widget::managingLayoutChanged() if (managingLayout()) { d->wasMovable = flags() & ItemIsMovable; if (!dynamic_cast(managingLayout())) { -// setFlag(ItemIsMovable, false); + setFlag(ItemIsMovable, false); } } else { -// setFlag(ItemIsMovable, d->wasMovable); + setFlag(ItemIsMovable, d->wasMovable); } }