Create the panels where the focus is by default

Using screenAt(cursor) is a bad idea in general. It doesn't work
properly on Wayland. We can't really tell where our cursor is, so it
always will fall about wherever our top-leftmost screen is.

Instead, just create them wherever we gave focus last.
wilder-5.24
Aleix Pol 5 years ago committed by Nate Graham
parent d117dea344
commit f3bfe3591c
  1. 2
      shell/shellcorona.cpp

@ -1770,7 +1770,7 @@ Plasma::Containment *ShellCorona::addPanel(const QString &plugin)
}
// find out what screen this panel should go on
QScreen *wantedScreen = QGuiApplication::screenAt(QCursor::pos());
QScreen *wantedScreen = qGuiApp->focusWindow() ? qGuiApp->focusWindow()->screen() : qGuiApp->primaryScreen();
QList<Plasma::Types::Location> availableLocations;
availableLocations << Plasma::Types::LeftEdge << Plasma::Types::TopEdge << Plasma::Types::RightEdge << Plasma::Types::BottomEdge;

Loading…
Cancel
Save