apply suggestion

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2025-03-31 01:19:34 +03:00
parent f7f7e1e336
commit 2bdd8c2d5a
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
14 changed files with 18 additions and 18 deletions

View File

@ -1673,7 +1673,7 @@ void Application::ShowGlobalSettings(class QWidget* parent, QString open_page)
SettingsObject::Lock lock(APPLICATION->settings());
PageDialog dlg(m_globalSettingsProvider.get(), open_page, parent);
connect(&dlg, &PageDialog::applied, this, &Application::globalSettingsApplied);
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
dlg.showFullScreen();
dlg.setFixedSize(dlg.width(), dlg.height());
}

View File

@ -84,9 +84,9 @@ bool isSnap()
#endif
}
bool isGameScope()
bool isSteamDeckGameScope()
{
return qgetenv("XDG_CURRENT_DESKTOP") == "gamescope";
return qgetenv("XDG_CURRENT_DESKTOP") == "gamescope" && qgetenv("STEAM_DECK") == "1";
}
} // namespace DesktopServices

View File

@ -45,5 +45,5 @@ bool isSnap();
/**
* Determine whether the launcher is running in a gamescope environment
*/
bool isGameScope();
bool isSteamDeckGameScope();
} // namespace DesktopServices

View File

@ -119,7 +119,7 @@ InstanceWindow::InstanceWindow(InstancePtr instance, QWidget* parent) : QMainWin
{
auto base64State = APPLICATION->settings()->get("ConsoleWindowState").toString().toUtf8();
restoreState(QByteArray::fromBase64(base64State));
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
} else {

View File

@ -232,7 +232,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
// add a close button at the end of the main toolbar when running on gamescope / steam deck
// this is only needed on gamescope because it defaults to an X11/XWayland session and
// does not implement decorations
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
ui->mainToolBar->addAction(ui->actionCloseWindow);
showFullScreen();
setFixedSize(this->width(), this->height());

View File

@ -181,7 +181,7 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDia
connect(ui->closeButton, &QPushButton::clicked, this, &AboutDialog::close);
connect(ui->aboutQt, &QPushButton::clicked, &QApplication::aboutQt);
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
}

View File

@ -91,7 +91,7 @@ ExportInstanceDialog::ExportInstanceDialog(InstancePtr instance, QWidget* parent
m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
}

View File

@ -124,7 +124,7 @@ ExportPackDialog::ExportPackDialog(MinecraftInstancePtr instance, QWidget* paren
m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
}

View File

@ -69,7 +69,7 @@ ExportToModListDialog::ExportToModListDialog(QString name, QList<Mod*> mods, QWi
ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
ui->buttonBox->button(QDialogButtonBox::Save)->setText(tr("Save"));
triggerImp();
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
}

View File

@ -128,7 +128,7 @@ InstallLoaderDialog::InstallLoaderDialog(std::shared_ptr<PackProfile> profile, c
connect(container, &PageContainer::selectedPageChanged, this, [this](BasePage* previous, BasePage* current) { validate(current); });
pageCast(container->selectedPage())->selectSearch();
validate(container->selectedPage());
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
}

View File

@ -136,7 +136,7 @@ NewInstanceDialog::NewInstanceDialog(const QString& initialGroup,
connect(m_container, &PageContainer::selectedPageChanged, this, &NewInstanceDialog::selectedPageChanged);
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
} else {

View File

@ -24,7 +24,7 @@ NewsDialog::NewsDialog(QList<NewsEntryPtr> entries, QWidget* parent) : QDialog(p
ui->currentArticleContentBrowser->setText(article_entry->content);
ui->currentArticleContentBrowser->flush();
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
}

View File

@ -275,7 +275,7 @@ ModDownloadDialog::ModDownloadDialog(QWidget* parent, const std::shared_ptr<ModF
initializeContainer();
connectButtons();
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
} else if (!geometrySaveKey().isEmpty())
@ -321,7 +321,7 @@ ResourcePackDownloadDialog::ResourcePackDownloadDialog(QWidget* parent,
initializeContainer();
connectButtons();
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
} else if (!geometrySaveKey().isEmpty())
@ -349,7 +349,7 @@ TexturePackDownloadDialog::TexturePackDownloadDialog(QWidget* parent,
initializeContainer();
connectButtons();
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
} else if (!geometrySaveKey().isEmpty())
@ -377,7 +377,7 @@ ShaderPackDownloadDialog::ShaderPackDownloadDialog(QWidget* parent,
initializeContainer();
connectButtons();
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
showFullScreen();
setFixedSize(this->width(), this->height());
} else if (!geometrySaveKey().isEmpty())

View File

@ -91,7 +91,7 @@ VersionSelectDialog::VersionSelectDialog(BaseVersionList* vlist, QString title,
if (!cancelable) {
m_buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false);
}
if (DesktopServices::isGameScope()) {
if (DesktopServices::isSteamDeckGameScope()) {
this->showFullScreen();
this->setFixedSize(this->width(), this->height());
}