FIxed mica window control buttons

This commit is contained in:
mr. M
2024-12-05 22:16:17 +01:00
parent 42f8744594
commit 1bc17b1cb1
2 changed files with 19 additions and 7 deletions

View File

@@ -110,10 +110,3 @@
margin-inline-end: 8px; margin-inline-end: 8px;
} }
} }
@media (-moz-windows-mica) {
:root[should-hide='true'] .titlebar-buttonbox {
/* We need to add a background so windows doesnt generate a default one */
background: var(--zen-branding-bg);
}
}

View File

@@ -0,0 +1,19 @@
diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp
index 00681c216c838efedbbcded9d6b843dbd8b5b0b6..e40203bc4557acbf014e7a5d16ca35fad7b57ca0 100644
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -1078,6 +1078,14 @@ nsresult nsWindow::Create(nsIWidget* aParent, const LayoutDeviceIntRect& aRect,
const DWM_SYSTEMBACKDROP_TYPE tabbedWindow = DWMSBT_TABBEDWINDOW;
DwmSetWindowAttribute(mWnd, DWMWA_SYSTEMBACKDROP_TYPE, &tabbedWindow,
sizeof tabbedWindow);
+
+ // If someone wants to make a patch to firefox, im fine with it. Im tired, boss.
+ // Windows creates some sort of control buttons under the titlebar, which is
+ // annoying for us because it wont allow us to have those hiding animations.
+ // Let's just... remove them... and hope for the best.
+ LONG_PTR style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
+ style &= ~(kTitlebarItemsWindowStyles);
+ ::SetWindowLongPtr(hwnd, GWL_STYLE, style);
}
if (mOpeningAnimationSuppressed) {