forked from ImSwordQueen/firefox-native-controls
-
Notifications
You must be signed in to change notification settings - Fork 1
/
native-controls-esr-115.7.0-apply-on-top-of-previous-patch.diff
51 lines (48 loc) · 2.25 KB
/
native-controls-esr-115.7.0-apply-on-top-of-previous-patch.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# HG changeset patch
# User daylin <dcoop2004@gmail.com>
# Date 1706144999 25200
# Wed Jan 24 18:09:59 2024 -0700
# Node ID 3db86a39b5c9930d3642bfd417c2166019dd1157
# Parent 1be366378c56d2cb64171ff9f714292f50641bbe
Native Controls: Revise override caption button width/height
# This is a patch that is applied on top of the 115.6.0 R2 patch. It simply revises this custom behaviour:
diff --git a/widget/windows/nsUXThemeData.cpp b/widget/windows/nsUXThemeData.cpp
--- a/widget/windows/nsUXThemeData.cpp
+++ b/widget/windows/nsUXThemeData.cpp
@@ -200,22 +200,26 @@ void nsUXThemeData::UpdateTitlebarInfo(H
int overrideCaptionButtonsHeight = StaticPrefs::
widget_ev_native_controls_patch_override_aero_caption_buttons_mask_height();
- if (overrideCaptionButtonsWidth && overrideCaptionButtonsHeight) {
- sCommandButtonBoxMetrics.cx = overrideCaptionButtonsWidth;
- sCommandButtonBoxMetrics.cy = overrideCaptionButtonsHeight;
- sCommandButtonBoxMetricsInitialized = true;
- sTitlebarInfoPopulatedAero = true;
- } else if (SUCCEEDED(DwmGetWindowAttribute(
- aWnd, DWMWA_CAPTION_BUTTON_BOUNDS, &captionButtons,
- sizeof(captionButtons)))) {
+ if (SUCCEEDED(DwmGetWindowAttribute(aWnd, DWMWA_CAPTION_BUTTON_BOUNDS,
+ &captionButtons,
+ sizeof(captionButtons)))) {
sCommandButtonBoxMetrics.cx =
captionButtons.right - captionButtons.left - 3;
sCommandButtonBoxMetrics.cy =
(captionButtons.bottom - captionButtons.top) - 1;
+
+ if (overrideCaptionButtonsWidth > 0) {
+ sCommandButtonBoxMetrics.cx = overrideCaptionButtonsWidth;
+ }
+
+ if (overrideCaptionButtonsHeight > 0) {
+ sCommandButtonBoxMetrics.cy = overrideCaptionButtonsHeight;
+ }
+
sCommandButtonBoxMetricsInitialized = true;
- MOZ_ASSERT(
- sCommandButtonBoxMetrics.cx > 0 && sCommandButtonBoxMetrics.cy > 0,
- "We must not cache bad command button box dimensions");
+ // MOZ_ASSERT(
+ // sCommandButtonBoxMetrics.cx > 0 && sCommandButtonBoxMetrics.cy > 0,
+ // "We must not cache bad command button box dimensions");
sTitlebarInfoPopulatedAero = true;
}
}