Skip to content

Commit 6216497

Browse files
committed
Qt: Disable window rounded corners is only needed on Win32
1 parent 259cd84 commit 6216497

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/duckstation-qt/mainwindow.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ struct MainWindowLocals
129129
bool system_paused = false;
130130
bool achievements_hardcore_mode = false;
131131
bool fullscreen_ui_started = false;
132+
133+
#ifdef _WIN32
132134
bool disable_window_rounded_corners = false;
135+
#endif
133136
};
134137
} // namespace
135138

@@ -398,8 +401,10 @@ void MainWindow::createDisplayWidget(bool fullscreen, bool render_to_main)
398401
restoreDisplayWindowGeometryFromConfig();
399402
container->showNormal();
400403

404+
#ifdef _WIN32
401405
if (s_locals.disable_window_rounded_corners)
402406
PlatformMisc::SetWindowRoundedCornerState(reinterpret_cast<void*>(container->winId()), false);
407+
#endif
403408
}
404409
else
405410
{
@@ -1899,9 +1904,11 @@ void MainWindow::setupAdditionalUi()
18991904
new QShortcut(QKeySequence::ZoomOut, this, this, &MainWindow::onViewZoomOutActionTriggered);
19001905
m_shortcuts.settings = new QShortcut(QKeySequence::Preferences, this, [this] { doSettings(); });
19011906

1907+
#ifdef _WIN32
19021908
s_locals.disable_window_rounded_corners = Host::GetBaseBoolSettingValue("Main", "DisableWindowRoundedCorners", false);
19031909
if (s_locals.disable_window_rounded_corners)
19041910
PlatformMisc::SetWindowRoundedCornerState(reinterpret_cast<void*>(winId()), false);
1911+
#endif
19051912

19061913
QtUtils::StyleChildMenus(this);
19071914
}
@@ -3072,6 +3079,7 @@ void MainWindow::requestExit(bool allow_confirm /* = true */)
30723079

30733080
void MainWindow::checkForSettingChanges()
30743081
{
3082+
#ifdef _WIN32
30753083
if (const bool disable_window_rounded_corners =
30763084
Host::GetBaseBoolSettingValue("Main", "DisableWindowRoundedCorners", false);
30773085
disable_window_rounded_corners != s_locals.disable_window_rounded_corners)
@@ -3086,6 +3094,7 @@ void MainWindow::checkForSettingChanges()
30863094
!s_locals.disable_window_rounded_corners);
30873095
}
30883096
}
3097+
#endif
30893098

30903099
// don't change state if temporary unfullscreened
30913100
if (m_display_widget && !QtHost::IsSystemLocked() && !isRenderingFullscreen())
@@ -3241,8 +3250,10 @@ bool MainWindow::onCreateAuxiliaryRenderWindow(RenderAPI render_api, qint32 x, q
32413250
if (!widget)
32423251
return false;
32433252

3253+
#ifdef _WIN32
32443254
if (s_locals.disable_window_rounded_corners)
32453255
PlatformMisc::SetWindowRoundedCornerState(reinterpret_cast<void*>(widget->winId()), false);
3256+
#endif
32463257

32473258
const std::optional<WindowInfo> owi = QtUtils::GetWindowInfoForWidget(widget, render_api, error);
32483259
if (!owi.has_value())

0 commit comments

Comments
 (0)