Skip to content

Commit 4e410ac

Browse files
committed
Fix caption buttons
1 parent 8409751 commit 4e410ac

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

widget/windows/nsWindow.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4232,19 +4232,18 @@ void nsWindow::UpdateThemeGeometries(
42324232
return;
42334233
}
42344234

4235-
if (StaticPrefs::widget_windows_style_modern()) {
4236-
mWindowButtonsRect = Nothing();
4237-
for (size_t i = 0; i < aThemeGeometries.Length(); i++) {
4238-
if (aThemeGeometries[i].mType ==
4239-
nsNativeThemeWin::eThemeGeometryTypeWindowButtons) {
4240-
LayoutDeviceIntRect bounds = aThemeGeometries[i].mRect;
4241-
// Extend the bounds by one pixel to the right, because that's how much
4242-
// the actual window button shape extends past the client area of the
4243-
// window (and overlaps the right window frame).
4244-
bounds.SetWidth(bounds.Width() + 1);
4245-
if (!mWindowButtonsRect) {
4246-
mWindowButtonsRect = Some(bounds);
4247-
}
4235+
mWindowButtonsRect = Nothing();
4236+
4237+
for (size_t i = 0; i < aThemeGeometries.Length(); i++) {
4238+
if (aThemeGeometries[i].mType ==
4239+
nsNativeThemeWin::eThemeGeometryTypeWindowButtons) {
4240+
LayoutDeviceIntRect bounds = aThemeGeometries[i].mRect;
4241+
// Extend the bounds by one pixel to the right, because that's how much
4242+
// the actual window button shape extends past the client area of the
4243+
// window (and overlaps the right window frame).
4244+
bounds.SetWidth(bounds.Width() + 1);
4245+
if (!mWindowButtonsRect) {
4246+
mWindowButtonsRect = Some(bounds);
42484247
}
42494248
}
42504249
}
@@ -5119,7 +5118,6 @@ bool nsWindow::ProcessMessageInternal(UINT msg, WPARAM& wParam, LPARAM& lParam,
51195118
if (mCustomNonClient && dwmCompositionEnabled &&
51205119
/* We don't do this for win10 glass with a custom titlebar,
51215120
* in order to avoid the caption buttons breaking. */
5122-
!(StaticPrefs::widget_windows_style_modern() && HasGlass()) &&
51235121
DwmDefWindowProc(mWnd, msg, wParam, lParam, &dwmHitResult)) {
51245122
*aRetValue = dwmHitResult;
51255123
return true;

0 commit comments

Comments
 (0)