Assing first screen if `screen` is null

BUG: 438277
wilder-5.24
Felipe Kinoshita 5 years ago
parent 047fe48b6a
commit 60ab32584b
No known key found for this signature in database
GPG Key ID: E5FF0D0C1A82B6A1
  1. 2
      klipper/klipperpopup.cpp

@ -86,7 +86,7 @@ KlipperPopup::KlipperPopup(History *history)
QRect geometry = windowInfo.geometry(); QRect geometry = windowInfo.geometry();
QScreen *screen = QGuiApplication::screenAt(geometry.center()); QScreen *screen = QGuiApplication::screenAt(geometry.center());
if (screen == nullptr) { if (screen == nullptr) {
return; screen = QGuiApplication::screens()[0];
} }
int menuHeight = (screen->geometry().height()) * 3 / 4; int menuHeight = (screen->geometry().height()) * 3 / 4;
int menuWidth = (screen->geometry().width()) * 1 / 3; int menuWidth = (screen->geometry().width()) * 1 / 3;

Loading…
Cancel
Save