Advertisement
Bungeetaco

Untitled

Sep 3rd, 2024
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.36 KB | None | 0 0
  1.  
  2. ./layout/style/nsMediaFeatures.cpp.rej:
  3. --- nsMediaFeatures.cpp
  4. +++ nsMediaFeatures.cpp
  5. @@ -251,10 +255,14 @@ bool Gecko_MediaFeatures_MatchesPlatform
  6. case StylePlatform::WindowsWin10:
  7. case StylePlatform::WindowsWin7:
  8. case StylePlatform::WindowsWin8: {
  9. - if (IsWin10OrLater()) {
  10. + int overridePref =
  11. + StaticPrefs::widget_ev_native_controls_patch_override_win_version();
  12. + bool doesOverride = overridePref > 0;
  13. +
  14. + if ((!doesOverride && IsWin10OrLater()) || overridePref == 10) {
  15. return aPlatform == StylePlatform::WindowsWin10;
  16. }
  17. - if (IsWin8OrLater()) {
  18. + if ((!doesOverride && IsWin8OrLater()) || overridePref == 8) {
  19. return aPlatform == StylePlatform::WindowsWin8;
  20. }
  21. return aPlatform == StylePlatform::WindowsWin7;
  22.  
  23. ./modules/libpref/init/StaticPrefList.yaml.rej:
  24. --- StaticPrefList.yaml
  25. +++ StaticPrefList.yaml
  26. @@ -15295,13 +15295,39 @@
  27. # Prefs starting with "widget."
  28. #---------------------------------------------------------------------------
  29.  
  30. +- name: widget.ev-native-controls-patch.override-win-version
  31. + type: int32_t
  32. + value: 0
  33. + mirror: always
  34. +
  35. +- name: widget.ev-native-controls-patch.force-dwm-report-off
  36. + type: bool
  37. + value: false
  38. + mirror: always
  39. +
  40. +- name: widget.ev-native-controls-patch.force-glass-reporting
  41. + type: int32_t
  42. + value: 0
  43. + mirror: always
  44. +
  45. +- name: widget.ev-native-controls-patch.override-aero-caption-buttons-mask-width
  46. + type: int32_t
  47. + value: 0
  48. + mirror: always
  49. +
  50. +- name: widget.ev-native-controls-patch.override-aero-caption-buttons-mask-height
  51. + type: int32_t
  52. + value: 0
  53. + mirror: always
  54. +
  55. # Global user preference for disabling native theme in content processes.
  56. #
  57. # NOTE(emilio): When changing this make sure to update the non_native_theme
  58. # entry in python/mozbuild/mozbuild/mozinfo.py and test_fission_autostart.py
  59. +# ^^^ no ~ev
  60. - name: widget.non-native-theme.enabled
  61. type: RelaxedAtomicBool
  62. - value: true
  63. + value: false
  64. mirror: always
  65.  
  66. # Whether the non-native theme should always use system colors. Useful mostly
  67.  
  68. ./servo/components/style/gecko/media_features.rs.rej:
  69. --- media_features.rs
  70. +++ media_features.rs
  71. @@ -614,6 +614,10 @@ fn eval_scripting(context: &Context, que
  72. }
  73. }
  74.  
  75. +fn eval_moz_ev_native_controls_patch(context: &Context) -> bool {
  76. + true
  77. +}
  78. +
  79. fn eval_moz_windows_non_native_menus(context: &Context) -> bool {
  80. unsafe { bindings::Gecko_MediaFeatures_WindowsNonNativeMenus(context.device().document()) }
  81. }
  82. @@ -694,7 +698,7 @@ macro_rules! bool_pref_feature {
  83. /// to support new types in these entries and (2) ensuring that either
  84. /// nsPresContext::MediaFeatureValuesChanged is called when the value that
  85. /// would be returned by the evaluator function could change.
  86. -pub static MEDIA_FEATURES: [QueryFeatureDescription; 67] = [
  87. +pub static MEDIA_FEATURES: [QueryFeatureDescription; 68] = [
  88. feature!(
  89. atom!("width"),
  90. AllowsRanges::Yes,
  91.  
  92. ./widget/windows/nsLookAndFeel.cpp.rej:
  93. --- nsLookAndFeel.cpp
  94. +++ nsLookAndFeel.cpp
  95. @@ -519,6 +523,11 @@ nsresult nsLookAndFeel::NativeGetInt(Int
  96. aResult = nsUXThemeData::IsDefaultWindowTheme();
  97. break;
  98. case IntID::DWMCompositor:
  99. + if (StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()) {
  100. + aResult = 0;
  101. + break;
  102. + }
  103. +
  104. aResult = gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  105. break;
  106. case IntID::WindowsAccentColorInTitlebar: {
  107. @@ -552,11 +561,24 @@ nsresult nsLookAndFeel::NativeGetInt(Int
  108.  
  109. mDwmKey->Close();
  110. } break;
  111. - case IntID::WindowsGlass:
  112. + case IntID::WindowsGlass: {
  113. + int reportingPref =
  114. + StaticPrefs::widget_ev_native_controls_patch_force_glass_reporting();
  115. + if (reportingPref != 0) {
  116. + aResult = (reportingPref == 1) ? 1 : 0;
  117. + break;
  118. + }
  119. +
  120. + int overrideWinVer =
  121. + StaticPrefs::widget_ev_native_controls_patch_override_win_version();
  122. + bool isWin8OrLater =
  123. + (overrideWinVer == 0 && IsWin8OrLater()) || overrideWinVer >= 8;
  124. +
  125. // Aero Glass is only available prior to Windows 8 when DWM is used.
  126. aResult = (gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled() &&
  127. - !IsWin8OrLater());
  128. + isWin8OrLater);
  129. break;
  130. + }
  131. case IntID::AlertNotificationOrigin:
  132. aResult = 0;
  133. {
  134.  
  135. ./widget/windows/nsNativeThemeWin.cpp.rej:
  136. --- nsNativeThemeWin.cpp
  137. +++ nsNativeThemeWin.cpp
  138. @@ -68,8 +69,11 @@ nsNativeThemeWin::~nsNativeThemeWin() {
  139. auto nsNativeThemeWin::IsWidgetNonNative(nsIFrame* aFrame,
  140. StyleAppearance aAppearance)
  141. -> NonNative {
  142. - if (IsWidgetScrollbarPart(aAppearance) ||
  143. - aAppearance == StyleAppearance::FocusOutline) {
  144. + if (IsWidgetScrollbarPart(aAppearance)) {
  145. + return NonNative::No;
  146. + }
  147. +
  148. + if (aAppearance == StyleAppearance::FocusOutline) {
  149. return NonNative::Always;
  150. }
  151.  
  152. @@ -699,6 +703,8 @@ mozilla::Maybe<nsUXThemeClass> nsNativeT
  153. case StyleAppearance::Textfield:
  154. case StyleAppearance::Textarea:
  155. return Some(eUXEdit);
  156. + case StyleAppearance::Tooltip:
  157. + return Some(eUXTooltip);
  158. case StyleAppearance::Toolbox:
  159. return Some(eUXRebar);
  160. case StyleAppearance::MozWinMediaToolbox:
  161. @@ -718,12 +724,27 @@ mozilla::Maybe<nsUXThemeClass> nsNativeT
  162. case StyleAppearance::Tabpanel:
  163. case StyleAppearance::Tabpanels:
  164. return Some(eUXTab);
  165. + case StyleAppearance::ScrollbarVertical:
  166. + case StyleAppearance::ScrollbarHorizontal:
  167. + case StyleAppearance::ScrollbarbuttonUp:
  168. + case StyleAppearance::ScrollbarbuttonDown:
  169. + case StyleAppearance::ScrollbarbuttonLeft:
  170. + case StyleAppearance::ScrollbarbuttonRight:
  171. + case StyleAppearance::ScrollbarthumbVertical:
  172. + case StyleAppearance::ScrollbarthumbHorizontal:
  173. + case StyleAppearance::Scrollcorner:
  174. + return Some(eUXScrollbar);
  175. case StyleAppearance::Range:
  176. case StyleAppearance::RangeThumb:
  177. return Some(eUXTrackbar);
  178. case StyleAppearance::SpinnerUpbutton:
  179. case StyleAppearance::SpinnerDownbutton:
  180. return Some(eUXSpin);
  181. + case StyleAppearance::Statusbar:
  182. + case StyleAppearance::Statusbarpanel:
  183. + case StyleAppearance::Resizerpanel:
  184. + case StyleAppearance::Resizer:
  185. + return Some(eUXStatus);
  186. case StyleAppearance::Menulist:
  187. case StyleAppearance::MenulistButton:
  188. case StyleAppearance::MozMenulistArrowButton:
  189. @@ -1004,6 +1090,11 @@ nsresult nsNativeThemeWin::GetThemePartA
  190. }
  191. return NS_OK;
  192. }
  193. + case StyleAppearance::Scrollcorner: {
  194. + aState = 0;
  195. + aPart = RP_BACKGROUND;
  196. + return NS_OK;
  197. + }
  198. case StyleAppearance::SpinnerUpbutton:
  199. case StyleAppearance::SpinnerDownbutton: {
  200. aPart = (aAppearance == StyleAppearance::SpinnerUpbutton) ? SPNP_UP
  201. @@ -1021,7 +1112,8 @@ nsresult nsNativeThemeWin::GetThemePartA
  202. case StyleAppearance::Toolbox:
  203. case StyleAppearance::MozWinMediaToolbox:
  204. case StyleAppearance::MozWinCommunicationsToolbox:
  205. - case StyleAppearance::MozWinBrowsertabbarToolbox: {
  206. + case StyleAppearance::MozWinBrowsertabbarToolbox:
  207. + case StyleAppearance::Statusbar: {
  208. aState = 0;
  209. aPart = RP_BACKGROUND;
  210. return NS_OK;
  211. @@ -1042,6 +1134,26 @@ nsresult nsNativeThemeWin::GetThemePartA
  212. }
  213. return NS_OK;
  214. }
  215. + case StyleAppearance::Statusbarpanel:
  216. + case StyleAppearance::Resizerpanel:
  217. + case StyleAppearance::Resizer: {
  218. + switch (aAppearance) {
  219. + case StyleAppearance::Statusbarpanel:
  220. + aPart = 1;
  221. + break;
  222. + case StyleAppearance::Resizerpanel:
  223. + aPart = 2;
  224. + break;
  225. + case StyleAppearance::Resizer:
  226. + aPart = 3;
  227. + break;
  228. + default:
  229. + MOZ_ASSERT_UNREACHABLE("Oops, we're missing a case");
  230. + aPart = 1; // just something valid
  231. + }
  232. + aState = TS_NORMAL;
  233. + return NS_OK;
  234. + }
  235. case StyleAppearance::Treeview:
  236. case StyleAppearance::Listbox: {
  237. aPart = TREEVIEW_BODY;
  238. @@ -1366,7 +1483,7 @@ nsNativeThemeWin::DrawWidgetBackground(g
  239. aDirtyRect);
  240.  
  241. // ^^ without the right sdk, assume xp theming and fall through.
  242. - if (gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) {
  243. + if (dwmCompositionEnabled) {
  244. switch (aAppearance) {
  245. case StyleAppearance::MozWindowTitlebar:
  246. case StyleAppearance::MozWindowTitlebarMaximized:
  247. @@ -1631,7 +1748,8 @@ RENDER_AGAIN:
  248. IsFrameRTL(aFrame));
  249. }
  250. // The following widgets need to be RTL-aware
  251. - else if (aAppearance == StyleAppearance::MozMenulistArrowButton) {
  252. + else if (aAppearance == StyleAppearance::Resizer ||
  253. + aAppearance == StyleAppearance::MozMenulistArrowButton) {
  254. DrawThemeBGRTLAware(theme, hdc, part, state, &widgetRect, &clipRect,
  255. IsFrameRTL(aFrame));
  256. } else if (aAppearance == StyleAppearance::NumberInput ||
  257. @@ -1696,6 +1814,26 @@ RENDER_AGAIN:
  258. widgetRect.bottom = widgetRect.top + TB_SEPARATOR_HEIGHT;
  259. DrawThemeEdge(theme, hdc, RP_BAND, 0, &widgetRect, EDGE_ETCHED, BF_TOP,
  260. nullptr);
  261. + } else if (aAppearance == StyleAppearance::ScrollbarthumbHorizontal ||
  262. + aAppearance == StyleAppearance::ScrollbarthumbVertical) {
  263. + // Draw the decorative gripper for the scrollbar thumb button, if it fits
  264. +
  265. + SIZE gripSize;
  266. + MARGINS thumbMgns;
  267. + int gripPart = (aAppearance == StyleAppearance::ScrollbarthumbHorizontal)
  268. + ? SP_GRIPPERHOR
  269. + : SP_GRIPPERVERT;
  270. +
  271. + if (GetThemePartSize(theme, hdc, gripPart, state, nullptr, TS_TRUE,
  272. + &gripSize) == S_OK &&
  273. + GetThemeMargins(theme, hdc, part, state, TMT_CONTENTMARGINS, nullptr,
  274. + &thumbMgns) == S_OK &&
  275. + gripSize.cx + thumbMgns.cxLeftWidth + thumbMgns.cxRightWidth <=
  276. + widgetRect.right - widgetRect.left &&
  277. + gripSize.cy + thumbMgns.cyTopHeight + thumbMgns.cyBottomHeight <=
  278. + widgetRect.bottom - widgetRect.top) {
  279. + DrawThemeBackground(theme, hdc, gripPart, state, &widgetRect, &clipRect);
  280. + }
  281. }
  282.  
  283. nativeDrawing.EndNativeDrawing();
  284. @@ -1756,7 +1898,12 @@ LayoutDeviceIntMargin nsNativeThemeWin::
  285. aAppearance == StyleAppearance::MozWinMediaToolbox ||
  286. aAppearance == StyleAppearance::MozWinCommunicationsToolbox ||
  287. aAppearance == StyleAppearance::MozWinBrowsertabbarToolbox ||
  288. + aAppearance == StyleAppearance::Statusbar ||
  289. + aAppearance == StyleAppearance::Resizer ||
  290. aAppearance == StyleAppearance::Tabpanel ||
  291. + aAppearance == StyleAppearance::ScrollbarHorizontal ||
  292. + aAppearance == StyleAppearance::ScrollbarVertical ||
  293. + aAppearance == StyleAppearance::Scrollcorner ||
  294. aAppearance == StyleAppearance::Menuitem ||
  295. aAppearance == StyleAppearance::Checkmenuitem ||
  296. aAppearance == StyleAppearance::Radiomenuitem ||
  297. @@ -1814,6 +1961,16 @@ bool nsNativeThemeWin::GetWidgetPadding(
  298. nsIFrame* aFrame,
  299. StyleAppearance aAppearance,
  300. LayoutDeviceIntMargin* aResult) {
  301. + bool dwmCompositionEnabled =
  302. + StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()
  303. + ? false
  304. + : gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  305. +
  306. + int overrideWinVer =
  307. + StaticPrefs::widget_ev_native_controls_patch_override_win_version();
  308. + bool isWindows10OrLater =
  309. + (overrideWinVer == 0 && IsWin10OrLater()) || overrideWinVer >= 10;
  310. +
  311. switch (aAppearance) {
  312. // Radios and checkboxes return a fixed size in GetMinimumWidgetSize
  313. // and have a meaningful baseline, so they can't have
  314. @@ -1833,7 +1990,7 @@ bool nsNativeThemeWin::GetWidgetPadding(
  315. aResult->SizeTo(0, 0, 0, 0);
  316.  
  317. // aero glass doesn't display custom buttons
  318. - if (gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) return true;
  319. + if (dwmCompositionEnabled) return true;
  320.  
  321. // button padding for standard windows
  322. if (aAppearance == StyleAppearance::MozWindowButtonBox) {
  323. @@ -1852,7 +2009,8 @@ bool nsNativeThemeWin::GetWidgetPadding(
  324. // adding padding to the top of the window that is the size of the caption
  325. // area and then "removing" it when calculating the client area for
  326. // WM_NCCALCSIZE. See bug 618353,
  327. - if (!IsWin10OrLater() &&
  328. +
  329. + if (!isWindows10OrLater &&
  330. aAppearance == StyleAppearance::MozWindowTitlebarMaximized) {
  331. nsCOMPtr<nsIWidget> rootWidget;
  332. if (WinUtils::HasSystemMetricsForDpi()) {
  333. @@ -2006,6 +2164,11 @@ bool nsNativeThemeWin::GetWidgetOverflow
  334. LayoutDeviceIntSize nsNativeThemeWin::GetMinimumWidgetSize(
  335. nsPresContext* aPresContext, nsIFrame* aFrame,
  336. StyleAppearance aAppearance) {
  337. + bool dwmCompositionEnabled =
  338. + StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()
  339. + ? false
  340. + : gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  341. +
  342. if (IsWidgetNonNative(aFrame, aAppearance) == NonNative::Always) {
  343. return Theme::GetMinimumWidgetSize(aPresContext, aFrame, aAppearance);
  344. }
  345. @@ -2030,6 +2193,7 @@ LayoutDeviceIntSize nsNativeThemeWin::Ge
  346. case StyleAppearance::MozWinCommunicationsToolbox:
  347. case StyleAppearance::MozWinBrowsertabbarToolbox:
  348. case StyleAppearance::Toolbar:
  349. + case StyleAppearance::Statusbar:
  350. case StyleAppearance::Progresschunk:
  351. case StyleAppearance::Tabpanels:
  352. case StyleAppearance::Tabpanel:
  353. @@ -2051,6 +2215,14 @@ LayoutDeviceIntSize nsNativeThemeWin::Ge
  354. // Windows appears to always use metrics when drawing standard scrollbars)
  355. THEMESIZE sizeReq = TS_TRUE; // Best-fit size
  356. switch (aAppearance) {
  357. + case StyleAppearance::ScrollbarthumbHorizontal:
  358. + case StyleAppearance::ScrollbarthumbVertical:
  359. + case StyleAppearance::ScrollbarbuttonUp:
  360. + case StyleAppearance::ScrollbarbuttonDown:
  361. + case StyleAppearance::ScrollbarbuttonLeft:
  362. + case StyleAppearance::ScrollbarbuttonRight:
  363. + case StyleAppearance::ScrollbarHorizontal:
  364. + case StyleAppearance::ScrollbarVertical:
  365. case StyleAppearance::MozMenulistArrowButton: {
  366. auto result = ClassicGetMinimumWidgetSize(aFrame, aAppearance);
  367. ScaleForFrameDPI(&result, aFrame);
  368. @@ -2158,7 +2344,7 @@ LayoutDeviceIntSize nsNativeThemeWin::Ge
  369.  
  370. case StyleAppearance::MozWindowButtonBox:
  371. case StyleAppearance::MozWindowButtonBoxMaximized: {
  372. - if (gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) {
  373. + if (dwmCompositionEnabled) {
  374. SIZE sz = nsUXThemeData::GetCommandButtonBoxMetrics();
  375. LayoutDeviceIntSize result(sz.cx,
  376. sz.cy - GetSystemMetrics(SM_CYFRAME) -
  377. @@ -2200,7 +2386,11 @@ nsNativeThemeWin::WidgetStateChanged(nsI
  378. aAppearance == StyleAppearance::MozWinCommunicationsToolbox ||
  379. aAppearance == StyleAppearance::MozWinBrowsertabbarToolbox ||
  380. aAppearance == StyleAppearance::Toolbar ||
  381. + aAppearance == StyleAppearance::Statusbar ||
  382. + aAppearance == StyleAppearance::Statusbarpanel ||
  383. + aAppearance == StyleAppearance::Resizerpanel ||
  384. aAppearance == StyleAppearance::Progresschunk ||
  385. + aAppearance == StyleAppearance::Tooltip ||
  386. aAppearance == StyleAppearance::ProgressBar ||
  387. aAppearance == StyleAppearance::Tabpanels ||
  388. aAppearance == StyleAppearance::Tabpanel ||
  389. @@ -2278,6 +2468,8 @@ bool nsNativeThemeWin::ThemeSupportsWidg
  390. else
  391. theme = GetTheme(aAppearance);
  392.  
  393. + if (theme && aAppearance == StyleAppearance::Resizer) return true;
  394. +
  395. if (theme || ClassicThemeSupportsWidget(aFrame, aAppearance))
  396. // turn off theming for some HTML widgets styled by the page
  397. return (!IsWidgetStyled(aPresContext, aFrame, aAppearance));
  398. @@ -2346,6 +2538,14 @@ nsITheme::Transparency nsNativeThemeWin:
  399. }
  400.  
  401. switch (aAppearance) {
  402. + case StyleAppearance::Resizer: {
  403. + // The classic native resizer has an opaque grey background which doesn't
  404. + // match the usually white background of the scrollable container, so
  405. + // only support the native resizer if not in a scrollframe.
  406. + nsIFrame* parentFrame = aFrame->GetParent();
  407. + return (!parentFrame || !parentFrame->IsScrollFrame()) ? eTransparent
  408. + : eOpaque;
  409. + }
  410. case StyleAppearance::MozWinBorderlessGlass:
  411. case StyleAppearance::ProgressBar:
  412. case StyleAppearance::Progresschunk:
  413. @@ -2359,7 +2559,8 @@ nsITheme::Transparency nsNativeThemeWin:
  414. // For the classic theme we don't really have a way of knowing
  415. if (!theme) {
  416. // menu backgrounds which can't be themed are opaque
  417. - if (aAppearance == StyleAppearance::Menupopup) {
  418. + if (aAppearance == StyleAppearance::Tooltip ||
  419. + aAppearance == StyleAppearance::Menupopup) {
  420. return eOpaque;
  421. }
  422. return eUnknownTransparency;
  423. @@ -2386,6 +2587,13 @@ nsITheme::Transparency nsNativeThemeWin:
  424. bool nsNativeThemeWin::ClassicThemeSupportsWidget(nsIFrame* aFrame,
  425. StyleAppearance aAppearance) {
  426. switch (aAppearance) {
  427. + case StyleAppearance::Resizer: {
  428. + // The classic native resizer has an opaque grey background which doesn't
  429. + // match the usually white background of the scrollable container, so
  430. + // only support the native resizer if not in a scrollframe.
  431. + nsIFrame* parentFrame = aFrame->GetParent();
  432. + return !parentFrame || !parentFrame->IsScrollFrame();
  433. + }
  434. case StyleAppearance::Menubar:
  435. case StyleAppearance::Menupopup:
  436. // Classic non-flat menus are handled almost entirely through CSS.
  437. @@ -2400,6 +2608,15 @@ bool nsNativeThemeWin::ClassicThemeSuppo
  438. case StyleAppearance::Range:
  439. case StyleAppearance::RangeThumb:
  440. case StyleAppearance::Groupbox:
  441. + case StyleAppearance::ScrollbarbuttonUp:
  442. + case StyleAppearance::ScrollbarbuttonDown:
  443. + case StyleAppearance::ScrollbarbuttonLeft:
  444. + case StyleAppearance::ScrollbarbuttonRight:
  445. + case StyleAppearance::ScrollbarthumbVertical:
  446. + case StyleAppearance::ScrollbarthumbHorizontal:
  447. + case StyleAppearance::ScrollbarVertical:
  448. + case StyleAppearance::ScrollbarHorizontal:
  449. + case StyleAppearance::Scrollcorner:
  450. case StyleAppearance::Menulist:
  451. case StyleAppearance::MenulistButton:
  452. case StyleAppearance::MozMenulistArrowButton:
  453. @@ -2407,6 +2624,10 @@ bool nsNativeThemeWin::ClassicThemeSuppo
  454. case StyleAppearance::SpinnerDownbutton:
  455. case StyleAppearance::Listbox:
  456. case StyleAppearance::Treeview:
  457. + case StyleAppearance::Tooltip:
  458. + case StyleAppearance::Statusbar:
  459. + case StyleAppearance::Statusbarpanel:
  460. + case StyleAppearance::Resizerpanel:
  461. case StyleAppearance::ProgressBar:
  462. case StyleAppearance::Progresschunk:
  463. case StyleAppearance::Tab:
  464. @@ -2526,6 +2762,25 @@ LayoutDeviceIntSize nsNativeThemeWin::Cl
  465. result.width = ::GetSystemMetrics(SM_CXVSCROLL);
  466. result.height = 8; // No good metrics available for this
  467. break;
  468. + case StyleAppearance::ScrollbarbuttonUp:
  469. + case StyleAppearance::ScrollbarbuttonDown:
  470. + result.width = ::GetSystemMetrics(SM_CXVSCROLL);
  471. + result.height = ::GetSystemMetrics(SM_CYVSCROLL);
  472. + break;
  473. + case StyleAppearance::ScrollbarbuttonLeft:
  474. + case StyleAppearance::ScrollbarbuttonRight:
  475. + // For scrollbar-width:thin, we don't display the buttons.
  476. + if (!ScrollbarDrawing::IsScrollbarWidthThin(aFrame)) {
  477. + result.width = ::GetSystemMetrics(SM_CXHSCROLL);
  478. + result.height = ::GetSystemMetrics(SM_CYHSCROLL);
  479. + }
  480. + break;
  481. + case StyleAppearance::ScrollbarVertical:
  482. + case StyleAppearance::ScrollbarHorizontal:
  483. + // Sizing code needed after removal of XUL layout (around ESR 115)
  484. + result.width = ::GetSystemMetrics(SM_CYHSCROLL);
  485. + result.height = ::GetSystemMetrics(SM_CYHSCROLL);
  486. + break;
  487. case StyleAppearance::RangeThumb: {
  488. if (IsRangeHorizontal(aFrame)) {
  489. result.width = 12;
  490. @@ -2536,6 +2791,35 @@ LayoutDeviceIntSize nsNativeThemeWin::Cl
  491. }
  492. break;
  493. }
  494. + case StyleAppearance::ScrollbarthumbVertical:
  495. + result.width = ::GetSystemMetrics(SM_CXVSCROLL);
  496. + result.height = ::GetSystemMetrics(SM_CYVTHUMB);
  497. + // Without theming, divide the thumb size by two in order to look more
  498. + // native
  499. + if (!GetTheme(aAppearance)) {
  500. + result.height >>= 1;
  501. + }
  502. + // If scrollbar-width is thin, divide the thickness by two to make
  503. + // it look more compact.
  504. + if (ScrollbarDrawing::IsScrollbarWidthThin(aFrame)) {
  505. + result.width >>= 1;
  506. + }
  507. + break;
  508. + case StyleAppearance::ScrollbarthumbHorizontal:
  509. + result.width = ::GetSystemMetrics(SM_CXHTHUMB);
  510. + result.height = ::GetSystemMetrics(SM_CYHSCROLL);
  511. + // Without theming, divide the thumb size by two in order to look more
  512. + // native
  513. + if (TRUE || !GetTheme(aAppearance)) {
  514. + result.width >>= 1;
  515. + }
  516. + // If scrollbar-width is thin, divide the thickness by two to make
  517. + // it look more compact.
  518. + if (ScrollbarDrawing::IsScrollbarWidthThin(aFrame)) {
  519. + result.height >>= 1;
  520. + }
  521. +
  522. + break;
  523. case StyleAppearance::MozMenulistArrowButton:
  524. result.width = ::GetSystemMetrics(SM_CXVSCROLL);
  525. break;
  526. @@ -2550,11 +2834,21 @@ LayoutDeviceIntSize nsNativeThemeWin::Cl
  527. case StyleAppearance::Textarea:
  528. case StyleAppearance::Progresschunk:
  529. case StyleAppearance::ProgressBar:
  530. + case StyleAppearance::Tooltip:
  531. case StyleAppearance::Tab:
  532. case StyleAppearance::Tabpanel:
  533. case StyleAppearance::Tabpanels:
  534. // no minimum widget size
  535. break;
  536. + case StyleAppearance::Resizer: {
  537. + NONCLIENTMETRICS nc;
  538. + nc.cbSize = sizeof(nc);
  539. + if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(nc), &nc, 0))
  540. + result.width = result.height = abs(nc.lfStatusFont.lfHeight) + 4;
  541. + else
  542. + result.width = result.height = 15;
  543. + break;
  544. + }
  545. case StyleAppearance::Menuseparator: {
  546. result.width = 0;
  547. result.height = 10;
  548. @@ -2777,6 +3080,39 @@ nsresult nsNativeThemeWin::ClassicGetThe
  549.  
  550. return NS_OK;
  551. }
  552. + case StyleAppearance::ScrollbarbuttonUp:
  553. + case StyleAppearance::ScrollbarbuttonDown:
  554. + case StyleAppearance::ScrollbarbuttonLeft:
  555. + case StyleAppearance::ScrollbarbuttonRight: {
  556. + ElementState contentState = GetContentState(aFrame, aAppearance);
  557. +
  558. + aPart = DFC_SCROLL;
  559. + switch (aAppearance) {
  560. + case StyleAppearance::ScrollbarbuttonUp:
  561. + aState = DFCS_SCROLLUP;
  562. + break;
  563. + case StyleAppearance::ScrollbarbuttonDown:
  564. + aState = DFCS_SCROLLDOWN;
  565. + break;
  566. + case StyleAppearance::ScrollbarbuttonLeft:
  567. + aState = DFCS_SCROLLLEFT;
  568. + break;
  569. + case StyleAppearance::ScrollbarbuttonRight:
  570. + aState = DFCS_SCROLLRIGHT;
  571. + break;
  572. + default:
  573. + break;
  574. + }
  575. +
  576. + if (contentState.HasState(ElementState::DISABLED)) {
  577. + aState |= DFCS_INACTIVE;
  578. + } else if (contentState.HasAllStates(ElementState::HOVER |
  579. + ElementState::ACTIVE)) {
  580. + aState |= DFCS_PUSHED | DFCS_FLAT;
  581. + }
  582. +
  583. + return NS_OK;
  584. + }
  585. case StyleAppearance::SpinnerUpbutton:
  586. case StyleAppearance::SpinnerDownbutton: {
  587. ElementState contentState = GetContentState(aFrame, aAppearance);
  588. @@ -2803,6 +3139,11 @@ nsresult nsNativeThemeWin::ClassicGetThe
  589.  
  590. return NS_OK;
  591. }
  592. + case StyleAppearance::Resizer:
  593. + aPart = DFC_SCROLL;
  594. + aState =
  595. + (IsFrameRTL(aFrame) ? DFCS_SCROLLSIZEGRIPRIGHT : DFCS_SCROLLSIZEGRIP);
  596. + return NS_OK;
  597. case StyleAppearance::Menuseparator:
  598. aPart = 0;
  599. aState = 0;
  600. @@ -3055,9 +3396,14 @@ RENDER_AGAIN:
  601. // Draw controls supported by DrawFrameControl
  602. case StyleAppearance::Checkbox:
  603. case StyleAppearance::Radio:
  604. + case StyleAppearance::ScrollbarbuttonUp:
  605. + case StyleAppearance::ScrollbarbuttonDown:
  606. + case StyleAppearance::ScrollbarbuttonLeft:
  607. + case StyleAppearance::ScrollbarbuttonRight:
  608. case StyleAppearance::SpinnerUpbutton:
  609. case StyleAppearance::SpinnerDownbutton:
  610. - case StyleAppearance::MozMenulistArrowButton: {
  611. + case StyleAppearance::MozMenulistArrowButton:
  612. + case StyleAppearance::Resizer: {
  613. int32_t oldTA;
  614. // setup DC to make DrawFrameControl draw correctly
  615. oldTA = ::SetTextAlign(hdc, TA_TOP | TA_LEFT | TA_NOUPDATECP);
  616. @@ -3096,6 +3442,13 @@ RENDER_AGAIN:
  617.  
  618. break;
  619. }
  620. + // Draw ToolTip background
  621. + case StyleAppearance::Tooltip:
  622. + ::FrameRect(hdc, &widgetRect, ::GetSysColorBrush(COLOR_WINDOWFRAME));
  623. + InflateRect(&widgetRect, -1, -1);
  624. + ::FillRect(hdc, &widgetRect, ::GetSysColorBrush(COLOR_INFOBK));
  625. +
  626. + break;
  627. case StyleAppearance::Groupbox:
  628. ::DrawEdge(hdc, &widgetRect, EDGE_ETCHED, BF_RECT | BF_ADJUST);
  629. ::FillRect(hdc, &widgetRect, (HBRUSH)(COLOR_BTNFACE + 1));
  630.  
  631. ./widget/windows/nsUXThemeData.cpp.rej:
  632. --- nsUXThemeData.cpp
  633. +++ nsUXThemeData.cpp
  634. @@ -86,6 +90,8 @@ const wchar_t* nsUXThemeData::GetClassNa
  635. return L"Button";
  636. case eUXEdit:
  637. return L"Edit";
  638. + case eUXTooltip:
  639. + return L"Tooltip";
  640. case eUXRebar:
  641. return L"Rebar";
  642. case eUXMediaRebar:
  643. @@ -94,6 +100,8 @@ const wchar_t* nsUXThemeData::GetClassNa
  644. return L"Communications::Rebar";
  645. case eUXBrowserTabBarRebar:
  646. return L"BrowserTabBar::Rebar";
  647. + case eUXScrollbar:
  648. + return L"Scrollbar";
  649. case eUXToolbar:
  650. return L"Toolbar";
  651. case eUXMediaToolbar:
  652. @@ -108,6 +116,8 @@ const wchar_t* nsUXThemeData::GetClassNa
  653. return L"Trackbar";
  654. case eUXSpin:
  655. return L"Spin";
  656. + case eUXStatus:
  657. + return L"Status";
  658. case eUXCombobox:
  659. return L"Combobox";
  660. case eUXHeader:
  661. @@ -178,12 +188,26 @@ void nsUXThemeData::EnsureCommandButtonB
  662. void nsUXThemeData::UpdateTitlebarInfo(HWND aWnd) {
  663. if (!aWnd) return;
  664.  
  665. - if (!sTitlebarInfoPopulatedAero &&
  666. - gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) {
  667. + bool dwmCompositionEnabled =
  668. + StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()
  669. + ? false
  670. + : gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  671. +
  672. + if (!sTitlebarInfoPopulatedAero && dwmCompositionEnabled) {
  673. RECT captionButtons;
  674. - if (SUCCEEDED(DwmGetWindowAttribute(aWnd, DWMWA_CAPTION_BUTTON_BOUNDS,
  675. - &captionButtons,
  676. - sizeof(captionButtons)))) {
  677. + int overrideCaptionButtonsWidth = StaticPrefs::
  678. + widget_ev_native_controls_patch_override_aero_caption_buttons_mask_width();
  679. + int overrideCaptionButtonsHeight = StaticPrefs::
  680. + widget_ev_native_controls_patch_override_aero_caption_buttons_mask_height();
  681. +
  682. + if (overrideCaptionButtonsWidth && overrideCaptionButtonsHeight) {
  683. + sCommandButtonBoxMetrics.cx = overrideCaptionButtonsWidth;
  684. + sCommandButtonBoxMetrics.cy = overrideCaptionButtonsHeight;
  685. + sCommandButtonBoxMetricsInitialized = true;
  686. + sTitlebarInfoPopulatedAero = true;
  687. + } else if (SUCCEEDED(DwmGetWindowAttribute(
  688. + aWnd, DWMWA_CAPTION_BUTTON_BOUNDS, &captionButtons,
  689. + sizeof(captionButtons)))) {
  690. sCommandButtonBoxMetrics.cx =
  691. captionButtons.right - captionButtons.left - 3;
  692. sCommandButtonBoxMetrics.cy =
  693. @@ -197,7 +221,9 @@ void nsUXThemeData::UpdateTitlebarInfo(H
  694. }
  695.  
  696. // NB: sTitlebarInfoPopulatedThemed is always true pre-vista.
  697. - if (sTitlebarInfoPopulatedThemed || IsWin8OrLater()) return;
  698. + if (sTitlebarInfoPopulatedThemed ||
  699. + (IsWin8OrLater() && dwmCompositionEnabled))
  700. + return;
  701.  
  702. // Query a temporary, visible window with command buttons to get
  703. // the right metrics.
  704. @@ -227,9 +253,7 @@ void nsUXThemeData::UpdateTitlebarInfo(H
  705. // We try to avoid activating this window, but on Aero basic (aero without
  706. // compositor) and aero lite (special theme for win server 2012/2013) we may
  707. // get the wrong information if the window isn't activated, so we have to:
  708. - if (sThemeId == WindowsTheme::AeroLite ||
  709. - (sThemeId == WindowsTheme::Aero &&
  710. - !gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled())) {
  711. + if (!dwmCompositionEnabled) {
  712. showType = SW_SHOW;
  713. }
  714. ShowWindow(hWnd, showType);
  715.  
  716. ./widget/windows/nsUXThemeData.h.rej:
  717. --- nsUXThemeData.h
  718. +++ nsUXThemeData.h
  719. @@ -19,6 +19,7 @@
  720. enum nsUXThemeClass {
  721. eUXButton = 0,
  722. eUXEdit,
  723. + eUXTooltip,
  724. eUXRebar,
  725. eUXMediaRebar,
  726. eUXCommunicationsRebar,
  727. @@ -28,8 +29,10 @@ enum nsUXThemeClass {
  728. eUXCommunicationsToolbar,
  729. eUXProgress,
  730. eUXTab,
  731. + eUXScrollbar,
  732. eUXTrackbar,
  733. eUXSpin,
  734. + eUXStatus,
  735. eUXCombobox,
  736. eUXHeader,
  737. eUXListview,
  738.  
  739. ./widget/windows/nsWindow.cpp.rej:
  740. --- nsWindow.cpp
  741. +++ nsWindow.cpp
  742. @@ -1736,6 +1736,11 @@ nsWindow* nsWindow::GetParentWindowBase(
  743. **************************************************************/
  744.  
  745. void nsWindow::Show(bool bState) {
  746. + bool dwmCompositionEnabled =
  747. + StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()
  748. + ? false
  749. + : gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  750. +
  751. if (bState && mIsShowingPreXULSkeletonUI) {
  752. // The first time we decide to actually show the window is when we decide
  753. // that we've taken over the window from the skeleton UI, and we should
  754. @@ -1763,8 +1768,7 @@ void nsWindow::Show(bool bState) {
  755. return false;
  756. }
  757. if (HasBogusPopupsDropShadowOnMultiMonitor() &&
  758. - WinUtils::GetMonitorCount() > 1 &&
  759. - !gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) {
  760. + WinUtils::GetMonitorCount() > 1 && !dwmCompositionEnabled) {
  761. // See bug 603793. When we try to draw D3D9/10 windows with a drop
  762. // shadow without the DWM on a secondary monitor, windows fails to
  763. // composite our windows correctly. We therefor switch off the drop
  764. @@ -2787,7 +2791,10 @@ void nsWindow::UpdateDarkModeToolbar() {
  765. }
  766.  
  767. LayoutDeviceIntMargin nsWindow::NormalWindowNonClientOffset() const {
  768. - bool glass = gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  769. + bool glass =
  770. + StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()
  771. + ? false
  772. + : gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  773.  
  774. LayoutDeviceIntMargin nonClientOffset;
  775.  
  776. @@ -2948,7 +2960,7 @@ bool nsWindow::UpdateNonClientMargins(bo
  777. // a new issue where widget edges would sometimes appear to bleed into other
  778. // displays (bug 1614218).
  779. int verticalResize = 0;
  780. - if (IsWin10OrLater()) {
  781. + if (isWin10OrLater) {
  782. verticalResize =
  783. WinUtils::GetSystemMetricsForDpi(SM_CYFRAME, dpi) +
  784. (hasCaption ? WinUtils::GetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi)
  785. @@ -2975,7 +2987,7 @@ bool nsWindow::UpdateNonClientMargins(bo
  786. // to clear the portion of the NC region that is exposed by the
  787. // hidden taskbar. As above, we clear the bottom of the NC region
  788. // when the taskbar is at the top of the screen.
  789. - if (IsWin10OrLater()) {
  790. + if (isWin10OrLater) {
  791. UINT clearEdge = (edge == ABE_TOP) ? ABE_BOTTOM : edge;
  792. mClearNCEdge = Some(clearEdge);
  793. }
  794. @@ -3322,8 +3339,7 @@ void nsWindow::SetTransparencyMode(Trans
  795. }
  796.  
  797. if (WindowType::TopLevel == window->mWindowType &&
  798. - mTransparencyMode != aMode &&
  799. - !gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) {
  800. + mTransparencyMode != aMode && !dwmCompositionEnabled) {
  801. NS_WARNING("Cannot set transparency mode on top-level windows.");
  802. return;
  803. }
  804. @@ -3378,6 +3394,11 @@ void nsWindow::UpdateWindowDraggingRegio
  805. }
  806.  
  807. void nsWindow::UpdateGlass() {
  808. + bool dwmCompositionEnabled =
  809. + StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()
  810. + ? false
  811. + : gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  812. +
  813. MARGINS margins = mGlassMargins;
  814.  
  815. // DWMNCRP_USEWINDOWSTYLE - The non-client rendering area is
  816. @@ -3406,7 +3427,7 @@ void nsWindow::UpdateGlass() {
  817. margins.cyBottomHeight));
  818.  
  819. // Extends the window frame behind the client area
  820. - if (gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) {
  821. + if (dwmCompositionEnabled) {
  822. DwmExtendFrameIntoClientArea(mWnd, &margins);
  823. DwmSetWindowAttribute(mWnd, DWMWA_NCRENDERING_POLICY, &policy,
  824. sizeof policy);
  825. @@ -3628,10 +3649,15 @@ NS_IMPL_ISUPPORTS0(FullscreenTransitionD
  826.  
  827. /* virtual */
  828. bool nsWindow::PrepareForFullscreenTransition(nsISupports** aData) {
  829. + bool dwmCompositionEnabled =
  830. + StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()
  831. + ? false
  832. + : gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  833. +
  834. // We don't support fullscreen transition when composition is not
  835. // enabled, which could make the transition broken and annoying.
  836. // See bug 1184201.
  837. - if (!gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) {
  838. + if (!dwmCompositionEnabled) {
  839. return false;
  840. }
  841.  
  842. @@ -4326,20 +4352,27 @@ nsresult nsWindow::OnDefaultButtonLoaded
  843.  
  844. void nsWindow::UpdateThemeGeometries(
  845. const nsTArray<ThemeGeometry>& aThemeGeometries) {
  846. + bool dwmCompositionEnabled =
  847. + StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()
  848. + ? false
  849. + : gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  850. +
  851. + int winVerOverride =
  852. + StaticPrefs::widget_ev_native_controls_patch_override_win_version();
  853. +
  854. RefPtr<WebRenderLayerManager> layerManager =
  855. GetWindowRenderer() ? GetWindowRenderer()->AsWebRender() : nullptr;
  856. if (!layerManager) {
  857. return;
  858. }
  859.  
  860. - if (!HasGlass() ||
  861. - !gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) {
  862. + if (!HasGlass() || !dwmCompositionEnabled) {
  863. return;
  864. }
  865.  
  866. mWindowButtonsRect = Nothing();
  867.  
  868. - if (!IsWin10OrLater()) {
  869. + if (!((winVerOverride == 0 && IsWin10OrLater()) || winVerOverride >= 10)) {
  870. for (size_t i = 0; i < aThemeGeometries.Length(); i++) {
  871. if (aThemeGeometries[i].mType ==
  872. nsNativeThemeWin::eThemeGeometryTypeWindowButtons) {
  873. @@ -5287,11 +5330,10 @@ bool nsWindow::ProcessMessageInternal(UI
  874.  
  875. // Glass hit testing w/custom transparent margins
  876. LRESULT dwmHitResult;
  877. - if (mCustomNonClient &&
  878. - gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled() &&
  879. + if (mCustomNonClient && dwmCompositionEnabled &&
  880. /* We don't do this for win10 glass with a custom titlebar,
  881. * in order to avoid the caption buttons breaking. */
  882. - !(IsWin10OrLater() && HasGlass()) &&
  883. + !(isWin10 && HasGlass()) &&
  884. DwmDefWindowProc(mWnd, msg, wParam, lParam, &dwmHitResult)) {
  885. *aRetValue = dwmHitResult;
  886. return true;
  887. @@ -5600,9 +5642,8 @@ bool nsWindow::ProcessMessageInternal(UI
  888. * sending the message with an updated title
  889. */
  890.  
  891. - if ((mSendingSetText &&
  892. - gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) ||
  893. - !mCustomNonClient || mNonClientMargins.top == -1)
  894. + if ((mSendingSetText && dwmCompositionEnabled) || !mCustomNonClient ||
  895. + mNonClientMargins.top == -1)
  896. break;
  897.  
  898. {
  899. @@ -5641,7 +5682,7 @@ bool nsWindow::ProcessMessageInternal(UI
  900.  
  901. // There is a case that rendered result is not kept. Bug 1237617
  902. if (wParam == TRUE && !gfxEnv::MOZ_DISABLE_FORCE_PRESENT() &&
  903. - gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) {
  904. + dwmCompositionEnabled) {
  905. NS_DispatchToMainThread(NewRunnableMethod(
  906. "nsWindow::ForcePresent", this, &nsWindow::ForcePresent));
  907. }
  908. @@ -5649,7 +5690,7 @@ bool nsWindow::ProcessMessageInternal(UI
  909. // let the dwm handle nc painting on glass
  910. // Never allow native painting if we are on fullscreen
  911. if (mFrameState->GetSizeMode() != nsSizeMode_Fullscreen &&
  912. - gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled())
  913. + dwmCompositionEnabled)
  914. break;
  915.  
  916. if (wParam == TRUE) {
  917. @@ -5685,7 +5726,7 @@ bool nsWindow::ProcessMessageInternal(UI
  918. if (!mCustomNonClient) break;
  919.  
  920. // let the dwm handle nc painting on glass
  921. - if (gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled()) break;
  922. + if (dwmCompositionEnabled) break;
  923.  
  924. HRGN paintRgn = ExcludeNonClientFromPaintRegion((HRGN)wParam);
  925. LRESULT res = CallWindowProcW(GetPrevWindowProc(), mWnd, msg,
  926. @@ -6775,12 +6816,21 @@ int32_t nsWindow::ClientMarginHitTestPoi
  927.  
  928. auto pt = mCachedHitTestPoint;
  929.  
  930. + // If DWM composition is disabled, then under no circumstances do we want to
  931. + // run the following code. Doing so will only cause the caption buttons to
  932. + // flicker. It seems this was broken during a refactor sometime after
  933. + // Australis.
  934. + bool dwmCompositionEnabled =
  935. + StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()
  936. + ? false
  937. + : gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  938. +
  939. if (mWindowBtnRect[WindowButtonType::Minimize].Contains(pt)) {
  940. - testResult = HTMINBUTTON;
  941. + testResult = dwmCompositionEnabled ? HTMINBUTTON : HTCLIENT;
  942. } else if (mWindowBtnRect[WindowButtonType::Maximize].Contains(pt)) {
  943. - testResult = HTMAXBUTTON;
  944. + testResult = dwmCompositionEnabled ? HTMAXBUTTON : HTCLIENT;
  945. } else if (mWindowBtnRect[WindowButtonType::Close].Contains(pt)) {
  946. - testResult = HTCLOSE;
  947. + testResult = dwmCompositionEnabled ? HTCLOSE : HTCLIENT;
  948. } else if (!inResizeRegion) {
  949. // If we're in the resize region, avoid overriding that with either a
  950. // drag or a client result; resize takes priority over either (but not
  951. @@ -9065,7 +9115,12 @@ void nsWindow::GetCompositorWidgetInitDa
  952. }
  953.  
  954. bool nsWindow::SynchronouslyRepaintOnResize() {
  955. - return !gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  956. + bool dwmCompositionEnabled =
  957. + StaticPrefs::widget_ev_native_controls_patch_force_dwm_report_off()
  958. + ? false
  959. + : gfxWindowsPlatform::GetPlatform()->DwmCompositionEnabled();
  960. +
  961. + return !dwmCompositionEnabled;
  962. }
  963.  
  964. void nsWindow::MaybeDispatchInitialFocusEvent() {
  965.  
  966. ./xpcom/ds/StaticAtoms.py.rej:
  967. --- StaticAtoms.py
  968. +++ StaticAtoms.py
  969. @@ -2252,6 +2252,7 @@ STATIC_ATOMS = [
  970. Atom("_moz_windows_classic", "-moz-windows-classic"),
  971. Atom("_moz_windows_glass", "-moz-windows-glass"),
  972. Atom("_moz_windows_non_native_menus", "-moz-windows-non-native-menus"),
  973. + Atom("_moz_ev_native_controls_patch", "-moz-ev-native-controls-patch"),
  974. Atom("_moz_menubar_drag", "-moz-menubar-drag"),
  975. Atom("_moz_device_pixel_ratio", "-moz-device-pixel-ratio"),
  976. Atom("_moz_device_orientation", "-moz-device-orientation"),
  977.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement