diff options
| author | 2022-12-13 13:17:19 -0500 | |
|---|---|---|
| committer | 2022-12-13 13:23:35 -0500 | |
| commit | 45fcde817e0455b2e92ee86417688e53a6742b4b (patch) | |
| tree | 11c1147413262099adbeac594566794d1ea077d2 /src | |
| parent | RenderWidget: Set WA_DontCreateNativeAncestors (diff) | |
| download | yuzu-45fcde817e0455b2e92ee86417688e53a6742b4b.tar.gz yuzu-45fcde817e0455b2e92ee86417688e53a6742b4b.tar.xz yuzu-45fcde817e0455b2e92ee86417688e53a6742b4b.zip | |
wayland: Always use exclusive fullscreen
Wayland does not allow clients to choose their own size and position
on the screen. The concept of fullscreening an application by sizing
it to the screen and removing decorations does not exist. Use
exclusive fullscreen instead.
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 13 | ||||
| -rw-r--r-- | src/yuzu/main.h | 1 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 6c204416f..885e24990 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -2915,9 +2915,14 @@ static QScreen* GuessCurrentScreen(QWidget* window) { | |||
| 2915 | }); | 2915 | }); |
| 2916 | } | 2916 | } |
| 2917 | 2917 | ||
| 2918 | bool GMainWindow::UsingExclusiveFullscreen() { | ||
| 2919 | return Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive || | ||
| 2920 | QGuiApplication::platformName() == QStringLiteral("wayland"); | ||
| 2921 | } | ||
| 2922 | |||
| 2918 | void GMainWindow::ShowFullscreen() { | 2923 | void GMainWindow::ShowFullscreen() { |
| 2919 | const auto show_fullscreen = [](QWidget* window) { | 2924 | const auto show_fullscreen = [this](QWidget* window) { |
| 2920 | if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) { | 2925 | if (UsingExclusiveFullscreen()) { |
| 2921 | window->showFullScreen(); | 2926 | window->showFullScreen(); |
| 2922 | return; | 2927 | return; |
| 2923 | } | 2928 | } |
| @@ -2945,7 +2950,7 @@ void GMainWindow::ShowFullscreen() { | |||
| 2945 | 2950 | ||
| 2946 | void GMainWindow::HideFullscreen() { | 2951 | void GMainWindow::HideFullscreen() { |
| 2947 | if (ui->action_Single_Window_Mode->isChecked()) { | 2952 | if (ui->action_Single_Window_Mode->isChecked()) { |
| 2948 | if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) { | 2953 | if (UsingExclusiveFullscreen()) { |
| 2949 | showNormal(); | 2954 | showNormal(); |
| 2950 | restoreGeometry(UISettings::values.geometry); | 2955 | restoreGeometry(UISettings::values.geometry); |
| 2951 | } else { | 2956 | } else { |
| @@ -2959,7 +2964,7 @@ void GMainWindow::HideFullscreen() { | |||
| 2959 | statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked()); | 2964 | statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked()); |
| 2960 | ui->menubar->show(); | 2965 | ui->menubar->show(); |
| 2961 | } else { | 2966 | } else { |
| 2962 | if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) { | 2967 | if (UsingExclusiveFullscreen()) { |
| 2963 | render_window->showNormal(); | 2968 | render_window->showNormal(); |
| 2964 | render_window->restoreGeometry(UISettings::values.renderwindow_geometry); | 2969 | render_window->restoreGeometry(UISettings::values.renderwindow_geometry); |
| 2965 | } else { | 2970 | } else { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 62d629973..27644fae5 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -320,6 +320,7 @@ private slots: | |||
| 320 | void OnDisplayTitleBars(bool); | 320 | void OnDisplayTitleBars(bool); |
| 321 | void InitializeHotkeys(); | 321 | void InitializeHotkeys(); |
| 322 | void ToggleFullscreen(); | 322 | void ToggleFullscreen(); |
| 323 | bool UsingExclusiveFullscreen(); | ||
| 323 | void ShowFullscreen(); | 324 | void ShowFullscreen(); |
| 324 | void HideFullscreen(); | 325 | void HideFullscreen(); |
| 325 | void ToggleWindowMode(); | 326 | void ToggleWindowMode(); |