experiment in delaying the panel creation
This commit is contained in:
parent
f979e1bbcb
commit
336055edc5
@ -732,7 +732,7 @@ void AppletInterface::itemChange(ItemChange change, const ItemChangeData &value)
|
|||||||
{
|
{
|
||||||
if (change == QQuickItem::ItemSceneChange) {
|
if (change == QQuickItem::ItemSceneChange) {
|
||||||
//we have a window: create the
|
//we have a window: create the
|
||||||
if (value.window && !m_qmlObject->rootObject() && !m_creationTimer->isActive()) {
|
if (value.window && !m_qmlObject->rootObject() /*&& !m_creationTimer->isActive()*/) {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
/*Experiment on even more delayed, doesn't seem to be good
|
/*Experiment on even more delayed, doesn't seem to be good
|
||||||
|
@ -213,6 +213,7 @@ private:
|
|||||||
Plasma::Types::BackgroundHints m_backgroundHints;
|
Plasma::Types::BackgroundHints m_backgroundHints;
|
||||||
bool m_busy : 1;
|
bool m_busy : 1;
|
||||||
bool m_expanded : 1;
|
bool m_expanded : 1;
|
||||||
|
friend class ContainmentInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -67,6 +67,17 @@ void ContainmentInterface::init()
|
|||||||
connect(containment()->corona(), &Plasma::Corona::availableScreenRegionChanged,
|
connect(containment()->corona(), &Plasma::Corona::availableScreenRegionChanged,
|
||||||
this, &ContainmentInterface::availableScreenRegionChanged);
|
this, &ContainmentInterface::availableScreenRegionChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//HACK, why appletAddedForward doesn't get called?
|
||||||
|
foreach (Plasma::Applet *applet, containment()->applets()) {
|
||||||
|
appletAddedForward(applet);
|
||||||
|
}
|
||||||
|
foreach (QObject *appletObj, m_appletInterfaces) {
|
||||||
|
AppletInterface *applet = qobject_cast<AppletInterface *>(appletObj);
|
||||||
|
if (!applet->qmlObject()) {
|
||||||
|
applet->init();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList <QObject *> ContainmentInterface::applets()
|
QList <QObject *> ContainmentInterface::applets()
|
||||||
|
@ -50,6 +50,11 @@ DesktopCorona::DesktopCorona(QObject *parent)
|
|||||||
connect(m_appConfigSyncTimer, &QTimer::timeout,
|
connect(m_appConfigSyncTimer, &QTimer::timeout,
|
||||||
this, &DesktopCorona::syncAppConfig);
|
this, &DesktopCorona::syncAppConfig);
|
||||||
|
|
||||||
|
m_waitingPanelsTimer = new QTimer(this);
|
||||||
|
m_waitingPanelsTimer->setSingleShot(true);
|
||||||
|
connect(m_waitingPanelsTimer, &QTimer::timeout,
|
||||||
|
this, &DesktopCorona::createWaitingPanels);
|
||||||
|
|
||||||
|
|
||||||
connect(m_desktopWidget, SIGNAL(resized(int)),
|
connect(m_desktopWidget, SIGNAL(resized(int)),
|
||||||
this, SLOT(screenResized(int)));
|
this, SLOT(screenResized(int)));
|
||||||
@ -252,6 +257,16 @@ void DesktopCorona::checkViews()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DesktopCorona::createWaitingPanels()
|
||||||
|
{
|
||||||
|
foreach (Plasma::Containment *cont, m_waitingPanels) {
|
||||||
|
m_panelViews[cont] = new PanelView(this);
|
||||||
|
m_panelViews[cont]->setContainment(cont);
|
||||||
|
m_panelViews[cont]->show();
|
||||||
|
}
|
||||||
|
m_waitingPanels.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void DesktopCorona::updateScreenOwner(int wasScreen, int isScreen, Plasma::Containment *containment)
|
void DesktopCorona::updateScreenOwner(int wasScreen, int isScreen, Plasma::Containment *containment)
|
||||||
{
|
{
|
||||||
qDebug() << "Was screen" << wasScreen << "Is screen" << isScreen <<"Containment" << containment << containment->title();
|
qDebug() << "Was screen" << wasScreen << "Is screen" << isScreen <<"Containment" << containment << containment->title();
|
||||||
@ -260,9 +275,8 @@ void DesktopCorona::updateScreenOwner(int wasScreen, int isScreen, Plasma::Conta
|
|||||||
containment->formFactor() == Plasma::Types::Vertical) {
|
containment->formFactor() == Plasma::Types::Vertical) {
|
||||||
|
|
||||||
if (isScreen >= 0) {
|
if (isScreen >= 0) {
|
||||||
m_panelViews[containment] = new PanelView(this);
|
m_waitingPanels << containment;
|
||||||
m_panelViews[containment]->setContainment(containment);
|
m_waitingPanelsTimer->start(250);
|
||||||
m_panelViews[containment]->show();
|
|
||||||
} else {
|
} else {
|
||||||
if (m_panelViews.contains(containment)) {
|
if (m_panelViews.contains(containment)) {
|
||||||
m_panelViews[containment]->setContainment(0);
|
m_panelViews[containment]->setContainment(0);
|
||||||
@ -274,6 +288,9 @@ void DesktopCorona::updateScreenOwner(int wasScreen, int isScreen, Plasma::Conta
|
|||||||
//Desktop view
|
//Desktop view
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
if (m_waitingPanelsTimer->isActive()) {
|
||||||
|
m_waitingPanelsTimer->start(250);
|
||||||
|
}
|
||||||
if (isScreen < 0 || m_views.count() < isScreen + 1) {
|
if (isScreen < 0 || m_views.count() < isScreen + 1) {
|
||||||
qWarning() << "Invalid screen";
|
qWarning() << "Invalid screen";
|
||||||
return;
|
return;
|
||||||
|
@ -99,14 +99,17 @@ private Q_SLOTS:
|
|||||||
void handleContainmentAdded(Plasma::Containment *c);
|
void handleContainmentAdded(Plasma::Containment *c);
|
||||||
void showWidgetExplorer();
|
void showWidgetExplorer();
|
||||||
void syncAppConfig();
|
void syncAppConfig();
|
||||||
|
void createWaitingPanels();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QDesktopWidget *m_desktopWidget;
|
QDesktopWidget *m_desktopWidget;
|
||||||
QList <View *> m_views;
|
QList <View *> m_views;
|
||||||
WidgetExplorerView *m_widgetExplorerView;
|
WidgetExplorerView *m_widgetExplorerView;
|
||||||
|
QList<Plasma::Containment *> m_waitingPanels;
|
||||||
QHash<Plasma::Containment *, PanelView *> m_panelViews;
|
QHash<Plasma::Containment *, PanelView *> m_panelViews;
|
||||||
KConfigGroup m_desktopDefaultsConfig;
|
KConfigGroup m_desktopDefaultsConfig;
|
||||||
QTimer *m_appConfigSyncTimer;
|
QTimer *m_appConfigSyncTimer;
|
||||||
|
QTimer *m_waitingPanelsTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user