From kde-panel-devel Sat Apr 24 17:55:36 2010 From: Marco Martin Date: Sat, 24 Apr 2010 17:55:36 +0000 To: kde-panel-devel Subject: KDE/kdebase/workspace/plasma/desktop/shell Message-Id: <20100424175536.A0454AC8A2 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-panel-devel&m=127213155911513 SVN commit 1118428 by mart: Two desktop views were getting created, as fix, do: - move the logic of desktop view creation in createWaitingDesktops - call createView upon containment creation only when the new containment is a panel CCMAIL:plasma-devel@kde.org M +35 -30 plasmaapp.cpp --- trunk/KDE/kdebase/workspace/plasma/desktop/shell/plasmaapp.cpp #1118427:1118428 @@ -769,32 +769,8 @@ } } - KConfigGroup viewIds(KGlobal::config(), "ViewIds"); - const int id = viewIds.readEntry(QString::number(containment->id()), 0); - DesktopView *view = viewForScreen(containment->screen(), - AppSettings::perVirtualDesktopViews() ? containment->desktop() : -1); - if (view) { - kDebug() << "had a view for" << containment->screen() << containment->desktop(); - // we already have a view for this screen - return; - } - - kDebug() << "creating a new view for" << containment->screen() << containment->desktop() - << "and we have" << Kephal::ScreenUtils::numScreens() << "screens"; - - // we have a new screen. neat. - view = new DesktopView(containment, id, 0); - connect(view, SIGNAL(dashboardClosed()), this, SLOT(dashboardClosed())); - if (m_corona) { - connect(m_corona, SIGNAL(screenOwnerChanged(int,int,Plasma::Containment*)), - view, SLOT(screenOwnerChanged(int,int,Plasma::Containment*))); - connect(m_corona, SIGNAL(shortcutsChanged()), - view, SLOT(updateShortcuts())); - } - - m_desktops.append(view); - view->show(); - setWmClass(view->winId()); + m_desktopsWaiting.append(containment); + m_desktopViewCreationTimer.start(); } } @@ -845,9 +821,35 @@ const QList > containments = m_desktopsWaiting; m_desktopsWaiting.clear(); - foreach (QWeakPointer containment, containments) { - if (containment) { - createView(containment.data()); + foreach (QWeakPointer weakContainment, containments) { + if (weakContainment) { + Plasma::Containment *containment = weakContainment.data(); + KConfigGroup viewIds(KGlobal::config(), "ViewIds"); + const int id = viewIds.readEntry(QString::number(containment->id()), 0); + DesktopView *view = viewForScreen(containment->screen(), + AppSettings::perVirtualDesktopViews() ? containment->desktop() : -1); + if (view) { + kDebug() << "had a view for" << containment->screen() << containment->desktop(); + // we already have a view for this screen + return; + } + + kDebug() << "creating a new view for" << containment->screen() << containment->desktop() + << "and we have" << Kephal::ScreenUtils::numScreens() << "screens"; + + // we have a new screen. neat. + view = new DesktopView(containment, id, 0); + connect(view, SIGNAL(dashboardClosed()), this, SLOT(dashboardClosed())); + if (m_corona) { + connect(m_corona, SIGNAL(screenOwnerChanged(int,int,Plasma::Containment*)), + view, SLOT(screenOwnerChanged(int,int,Plasma::Containment*))); + connect(m_corona, SIGNAL(shortcutsChanged()), + view, SLOT(updateShortcuts())); + } + + m_desktops.append(view); + view->show(); + setWmClass(view->winId()); } } } @@ -863,7 +865,10 @@ } } - createView(containment); + if (isPanelContainment(containment)) { + createView(containment); + } + disconnect(containment, 0, this, 0); connect(containment, SIGNAL(configureRequested(Plasma::Containment*)), this, SLOT(configureContainment(Plasma::Containment*))); _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel