mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 21:15:55 +03:00
Merge pull request #4279 from nextcloud/bugfix/simplify-current-screen
Simplify currentScreen in systray.cpp
This commit is contained in:
commit
fe3011cefd
1 changed files with 3 additions and 7 deletions
|
@ -308,15 +308,11 @@ void Systray::forceWindowInit(QQuickWindow *window) const
|
|||
|
||||
QScreen *Systray::currentScreen() const
|
||||
{
|
||||
const auto screens = QGuiApplication::screens();
|
||||
const auto cursorPos = QCursor::pos();
|
||||
const auto screen = QGuiApplication::screenAt(QCursor::pos());
|
||||
|
||||
for (const auto screen : screens) {
|
||||
if (screen->geometry().contains(cursorPos)) {
|
||||
return screen;
|
||||
}
|
||||
if(screen) {
|
||||
return screen;
|
||||
}
|
||||
|
||||
// Didn't find anything matching the cursor position,
|
||||
// falling back to the primary screen
|
||||
return QGuiApplication::primaryScreen();
|
||||
|
|
Loading…
Reference in a new issue