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.
This commit is contained in:
parent
29fbce9fe6
commit
45fcde817e
@ -2915,9 +2915,14 @@ static QScreen* GuessCurrentScreen(QWidget* window) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GMainWindow::UsingExclusiveFullscreen() {
|
||||||
|
return Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive ||
|
||||||
|
QGuiApplication::platformName() == QStringLiteral("wayland");
|
||||||
|
}
|
||||||
|
|
||||||
void GMainWindow::ShowFullscreen() {
|
void GMainWindow::ShowFullscreen() {
|
||||||
const auto show_fullscreen = [](QWidget* window) {
|
const auto show_fullscreen = [this](QWidget* window) {
|
||||||
if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) {
|
if (UsingExclusiveFullscreen()) {
|
||||||
window->showFullScreen();
|
window->showFullScreen();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2945,7 +2950,7 @@ void GMainWindow::ShowFullscreen() {
|
|||||||
|
|
||||||
void GMainWindow::HideFullscreen() {
|
void GMainWindow::HideFullscreen() {
|
||||||
if (ui->action_Single_Window_Mode->isChecked()) {
|
if (ui->action_Single_Window_Mode->isChecked()) {
|
||||||
if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) {
|
if (UsingExclusiveFullscreen()) {
|
||||||
showNormal();
|
showNormal();
|
||||||
restoreGeometry(UISettings::values.geometry);
|
restoreGeometry(UISettings::values.geometry);
|
||||||
} else {
|
} else {
|
||||||
@ -2959,7 +2964,7 @@ void GMainWindow::HideFullscreen() {
|
|||||||
statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked());
|
statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked());
|
||||||
ui->menubar->show();
|
ui->menubar->show();
|
||||||
} else {
|
} else {
|
||||||
if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) {
|
if (UsingExclusiveFullscreen()) {
|
||||||
render_window->showNormal();
|
render_window->showNormal();
|
||||||
render_window->restoreGeometry(UISettings::values.renderwindow_geometry);
|
render_window->restoreGeometry(UISettings::values.renderwindow_geometry);
|
||||||
} else {
|
} else {
|
||||||
|
@ -320,6 +320,7 @@ private slots:
|
|||||||
void OnDisplayTitleBars(bool);
|
void OnDisplayTitleBars(bool);
|
||||||
void InitializeHotkeys();
|
void InitializeHotkeys();
|
||||||
void ToggleFullscreen();
|
void ToggleFullscreen();
|
||||||
|
bool UsingExclusiveFullscreen();
|
||||||
void ShowFullscreen();
|
void ShowFullscreen();
|
||||||
void HideFullscreen();
|
void HideFullscreen();
|
||||||
void ToggleWindowMode();
|
void ToggleWindowMode();
|
||||||
|
Loading…
Reference in New Issue
Block a user