diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 67ddb53e8..71a04502f 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -51,6 +51,7 @@ #include "ui/InstanceWindow.h" #include "ui/MainWindow.h" #include "ui/ViewLogWindow.h" +#include "ui/ToolTipFilter.h" #include "ui/dialogs/ProgressDialog.h" #include "ui/instanceview/AccessibleInstanceView.h" @@ -1199,6 +1200,10 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv) } } + if (qgetenv("XDG_CURRENT_DESKTOP") == "gamescope") { + installEventFilter(new ToolTipFilter); + } + if (createSetupWizard()) { return; } diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index e5d69986c..d1878e3b0 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -843,6 +843,8 @@ SET(LAUNCHER_SOURCES ui/InstanceWindow.cpp ui/ViewLogWindow.h ui/ViewLogWindow.cpp + ui/ToolTipFilter.h + ui/ToolTipFilter.cpp # FIXME: maybe find a better home for this. FileIgnoreProxy.cpp diff --git a/launcher/ui/ToolTipFilter.cpp b/launcher/ui/ToolTipFilter.cpp new file mode 100644 index 000000000..0a95356c1 --- /dev/null +++ b/launcher/ui/ToolTipFilter.cpp @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-3.0-only +/* + * Prism Launcher - Minecraft Launcher + * Copyright (C) 2026 Mark Deneen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "ToolTipFilter.h" + +bool ToolTipFilter::eventFilter(QObject* obj, QEvent* ev) { + if (ev->type() == QEvent::ToolTip) { + return true; + } else { + return QObject::eventFilter(obj, ev); + } +} diff --git a/launcher/ui/ToolTipFilter.h b/launcher/ui/ToolTipFilter.h new file mode 100644 index 000000000..3cbb1f1d6 --- /dev/null +++ b/launcher/ui/ToolTipFilter.h @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-3.0-only +/* + * Prism Launcher - Minecraft Launcher + * Copyright (C) 2026 Mark Deneen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include + +class ToolTipFilter : public QObject +{ + Q_OBJECT +protected: + bool eventFilter(QObject *obj, QEvent *event); +};