Commit 06cd7566 authored by Jonoerik's avatar Jonoerik Committed by Nicolas Fella
Browse files

Fix screen index preference resetting unexpectedly

Update MainWindow::moveEvent() to correctly handle a result of -1 from
QApplication::desktop()->screenNumber() ("widget is not on any screen"),
which was previously causing a user preference for "show yakuake on a
fixed screen" to revert to "show yakuake on the same screen as the
mouse".

BUG: 445106
(cherry picked from commit 554ca4bc)
parent 8399af82
Pipeline #175022 skipped
......@@ -1090,8 +1090,10 @@ void MainWindow::paintEvent(QPaintEvent *event)
void MainWindow::moveEvent(QMoveEvent *event)
{
if (Settings::screen() && QApplication::desktop()->screenNumber(this) != getScreen()) {
Settings::setScreen(QApplication::desktop()->screenNumber(this) + 1);
int widgetCurrentScreen = QApplication::desktop()->screenNumber(this);
if (Settings::screen() && widgetCurrentScreen != -1 && widgetCurrentScreen != getScreen()) {
Settings::setScreen(widgetCurrentScreen + 1);
updateScreenMenu();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment