diff options
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 0ba7c07cc..24bfa4d34 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -60,6 +60,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include <QPushButton> #include <QShortcut> #include <QStatusBar> +#include <QString> #include <QSysInfo> #include <QUrl> #include <QtConcurrent/QtConcurrent> @@ -854,8 +855,7 @@ void GMainWindow::InitializeHotkeys() { connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Mouse Panning"), this), &QShortcut::activated, this, [&] { Settings::values.mouse_panning = !Settings::values.mouse_panning; - if (UISettings::values.hide_mouse || Settings::values.mouse_panning) { - mouse_hide_timer.start(); + if (Settings::values.mouse_panning) { render_window->installEventFilter(render_window); render_window->setAttribute(Qt::WA_Hover, true); } @@ -1208,11 +1208,14 @@ void GMainWindow::BootGame(const QString& filename, std::size_t program_index) { renderer_status_button->setDisabled(true); if (UISettings::values.hide_mouse || Settings::values.mouse_panning) { - mouse_hide_timer.start(); render_window->installEventFilter(render_window); render_window->setAttribute(Qt::WA_Hover, true); } + if (UISettings::values.hide_mouse) { + mouse_hide_timer.start(); + } + std::string title_name; std::string title_version; const auto res = system.GetGameName(title_name); @@ -2372,12 +2375,15 @@ void GMainWindow::OnConfigure() { if ((UISettings::values.hide_mouse || Settings::values.mouse_panning) && emulation_running) { render_window->installEventFilter(render_window); render_window->setAttribute(Qt::WA_Hover, true); - mouse_hide_timer.start(); } else { render_window->removeEventFilter(render_window); render_window->setAttribute(Qt::WA_Hover, false); } + if (UISettings::values.hide_mouse) { + mouse_hide_timer.start(); + } + UpdateStatusButtons(); } @@ -2615,8 +2621,7 @@ void GMainWindow::UpdateUISettings() { } void GMainWindow::HideMouseCursor() { - if (emu_thread == nullptr || - (!UISettings::values.hide_mouse && !Settings::values.mouse_panning)) { + if (emu_thread == nullptr && UISettings::values.hide_mouse) { mouse_hide_timer.stop(); ShowMouseCursor(); return; @@ -2626,8 +2631,7 @@ void GMainWindow::HideMouseCursor() { void GMainWindow::ShowMouseCursor() { render_window->unsetCursor(); - if (emu_thread != nullptr && - (UISettings::values.hide_mouse || Settings::values.mouse_panning)) { + if (emu_thread != nullptr && UISettings::values.hide_mouse) { mouse_hide_timer.start(); } } @@ -3058,6 +3062,14 @@ int main(int argc, char* argv[]) { chdir(bin_path.c_str()); #endif +#ifdef __linux__ + // Set the DISPLAY variable in order to open web browsers + // TODO (lat9nq): Find a better solution for AppImages to start external applications + if (QString::fromLocal8Bit(qgetenv("DISPLAY")).isEmpty()) { + qputenv("DISPLAY", ":0"); + } +#endif + // Enables the core to make the qt created contexts current on std::threads QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); QApplication app(argc, argv); |