Made sure that the qt version check is in place

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-11-25 16:08:12 +02:00
parent 1be29076ea
commit 81c5866fa9
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -765,7 +765,12 @@ QString MinecraftInstance::createLaunchScript(AuthSessionPtr session, MinecraftT
for (auto w : QApplication::topLevelWidgets()) {
auto mainWindow = qobject_cast<QMainWindow*>(w);
if (mainWindow) {
screenGeometry = screenGeometry.shrunkBy(mainWindow->windowHandle()->frameMargins());
auto m = mainWindow->windowHandle()->frameMargins();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
screenGeometry = screenGeometry.shrunkBy(m);
#else
screenGeometry = { screenGeometry.width() - m.left() - m.right(), screenGeometry.height() - m.top() - m.bottom() };
#endif
break;
}
}