Use current_screen() function in OSD Pretty

This commit is contained in:
Jonas Kvinge 2020-04-06 23:01:50 +02:00
parent 7f39a38d6c
commit 5a5f50e1e4
1 changed files with 1 additions and 5 deletions

View File

@ -463,11 +463,7 @@ void OSDPretty::mouseMoveEvent(QMouseEvent *e) {
QPoint new_pos = original_window_pos_ + delta;
// Keep it to the bounds of the desktop
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QScreen *screen = QGuiApplication::screenAt(e->globalPos());
#else
QScreen *screen = (window() && window()->windowHandle() ? window()->windowHandle()->screen() : nullptr);
#endif
QScreen *screen = current_screen(e->globalPos());
if (!screen) return;
QRect geometry = screen->availableGeometry();