Skip to content

Commit

Permalink
fix: crash on treeland (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
wineee authored Dec 6, 2024
1 parent 9d2f4fe commit 3fabbe4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,11 @@ QString MainWindow::getConfigWindowState()
QSize MainWindow::halfScreenSize()
{
QScreen *screen = QGuiApplication::screenAt(QCursor::pos());
if (!screen) {
qCritical() << "Can't get the screen where the cursor is located!";
return QSize(0 ,0);
}

int w = screen->availableGeometry().width();
int h = screen->availableGeometry().height();

Expand Down

0 comments on commit 3fabbe4

Please sign in to comment.