Return valid screenForContainment on panels
This commit is contained in:
parent
e5ef979ba1
commit
547f356edd
@ -72,7 +72,7 @@ public:
|
|||||||
QList <DesktopView *> views;
|
QList <DesktopView *> views;
|
||||||
KActivities::Controller *activityController;
|
KActivities::Controller *activityController;
|
||||||
KActivities::Consumer *activityConsumer;
|
KActivities::Consumer *activityConsumer;
|
||||||
QHash <Plasma::Containment *, PanelView *> panelViews;
|
QHash <const Plasma::Containment *, PanelView *> panelViews;
|
||||||
KConfigGroup desktopDefaultsConfig;
|
KConfigGroup desktopDefaultsConfig;
|
||||||
WorkspaceScripting::DesktopScriptEngine * scriptEngine;
|
WorkspaceScripting::DesktopScriptEngine * scriptEngine;
|
||||||
QList<Plasma::Containment *> waitingPanels;
|
QList<Plasma::Containment *> waitingPanels;
|
||||||
@ -516,7 +516,7 @@ void ShellCorona::addPanel(const QString &plugin)
|
|||||||
QList<Plasma::Types::Location> availableLocations;
|
QList<Plasma::Types::Location> availableLocations;
|
||||||
availableLocations << Plasma::Types::LeftEdge << Plasma::Types::TopEdge << Plasma::Types::RightEdge << Plasma::Types::BottomEdge;
|
availableLocations << Plasma::Types::LeftEdge << Plasma::Types::TopEdge << Plasma::Types::RightEdge << Plasma::Types::BottomEdge;
|
||||||
|
|
||||||
foreach (Plasma::Containment *cont, d->panelViews.keys()) {
|
foreach (const Plasma::Containment *cont, d->panelViews.keys()) {
|
||||||
availableLocations.removeAll(cont->location());
|
availableLocations.removeAll(cont->location());
|
||||||
}
|
}
|
||||||
Plasma::Types::Location loc;
|
Plasma::Types::Location loc;
|
||||||
@ -552,12 +552,19 @@ void ShellCorona::printScriptMessage(const QString &message)
|
|||||||
|
|
||||||
int ShellCorona::screenForContainment(const Plasma::Containment *containment) const
|
int ShellCorona::screenForContainment(const Plasma::Containment *containment) const
|
||||||
{
|
{
|
||||||
|
QScreen* s = nullptr;
|
||||||
for (int i=0; i<d->views.size(); i++) {
|
for (int i=0; i<d->views.size(); i++) {
|
||||||
if (d->views[i]->containment() == containment) {
|
if (d->views[i]->containment() == containment) {
|
||||||
return i;
|
s = d->views[i]->screen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
if(!s) {
|
||||||
|
PanelView *view = d->panelViews[containment];
|
||||||
|
if (view) {
|
||||||
|
s = view->screen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s? qApp->screens().indexOf(s) : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShellCorona::activityOpened()
|
void ShellCorona::activityOpened()
|
||||||
|
Loading…
Reference in New Issue
Block a user