Skip to content

Commit

Permalink
Backed out changeset 31a3362f641c (bug 1344910) for crashes in marion…
Browse files Browse the repository at this point in the history
…ette.py | application crashed
  • Loading branch information
BavarianTomcat committed Jun 21, 2017
1 parent c4e9a8b commit 617ce07
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 78 deletions.
1 change: 0 additions & 1 deletion layout/style/nsCSSKeywordList.h
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,6 @@ CSS_KEY(button-focus, button_focus)
CSS_KEY(-moz-win-media-toolbox, _moz_win_media_toolbox)
CSS_KEY(-moz-win-communications-toolbox, _moz_win_communications_toolbox)
CSS_KEY(-moz-win-browsertabbar-toolbox, _moz_win_browsertabbar_toolbox)
CSS_KEY(-moz-win-accentcolor, _moz_win_accentcolor)
CSS_KEY(-moz-win-mediatext, _moz_win_mediatext)
CSS_KEY(-moz-win-communicationstext, _moz_win_communicationstext)
CSS_KEY(-moz-win-glass, _moz_win_glass)
Expand Down
1 change: 0 additions & 1 deletion layout/style/nsCSSProps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,6 @@ const KTableEntry nsCSSProps::kColorKTable[] = {
{ eCSSKeyword__moz_oddtreerow, LookAndFeel::eColorID__moz_oddtreerow },
{ eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT },
{ eCSSKeyword_currentcolor, NS_COLOR_CURRENTCOLOR },
{ eCSSKeyword__moz_win_accentcolor, LookAndFeel::eColorID__moz_win_accentcolor },
{ eCSSKeyword__moz_win_mediatext, LookAndFeel::eColorID__moz_win_mediatext },
{ eCSSKeyword__moz_win_communicationstext, LookAndFeel::eColorID__moz_win_communicationstext },
{ eCSSKeyword__moz_nativehyperlinktext, LookAndFeel::eColorID__moz_nativehyperlinktext },
Expand Down
2 changes: 0 additions & 2 deletions widget/LookAndFeel.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ class LookAndFeel

// vista rebars

// accent color for title bar
eColorID__moz_win_accentcolor,
// media rebar text
eColorID__moz_win_mediatext,
// communications rebar text
Expand Down
3 changes: 0 additions & 3 deletions widget/nsXPLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,6 @@ nsXPLookAndFeel::GetStandinForNativeColor(ColorID aID)
result = NS_RGB(0x3F, 0x3F, 0x3F); break;
case eColorID__moz_mac_secondaryhighlight:
result = NS_RGB(0xD4, 0xD4, 0xD4); break;
case eColorID__moz_win_accentcolor:
// Seems to be the default color (hardcoded because of bug 1065998)
result = NS_RGB(0x9E, 0x9E, 0x9E); break;
case eColorID__moz_win_mediatext:
result = NS_RGB(0xFF, 0xFF, 0xFF); break;
case eColorID__moz_win_communicationstext:
Expand Down
49 changes: 0 additions & 49 deletions widget/windows/nsLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,6 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
case eColorID__moz_cellhighlight:
idx = COLOR_3DFACE;
break;
case eColorID__moz_win_accentcolor:
res = GetAccentColor(aColor);
if (NS_SUCCEEDED(res)) {
return res;
}
NS_WARNING("Using fallback for accent color - UI code failed to use the "
"-moz-windows-accent-color-applies media query properly");
// Seems to be the default color (hardcoded because of bug 1065998)
aColor = NS_RGB(158, 158, 158);
return NS_OK;
case eColorID__moz_win_mediatext:
if (IsAppThemed()) {
res = ::GetColorFromTheme(eUXMediaToolbar,
Expand Down Expand Up @@ -757,42 +747,3 @@ nsLookAndFeel::SetIntCacheImpl(const nsTArray<LookAndFeelInt>& aLookAndFeelIntCa
}
}

/* static */ nsresult
nsLookAndFeel::GetAccentColor(nscolor& aColor)
{
nsresult rv;

if (!mDwmKey) {
mDwmKey = do_CreateInstance("@mozilla.org/windows-registry-key;1", &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
}

rv = mDwmKey->Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
NS_LITERAL_STRING("SOFTWARE\\Microsoft\\Windows\\DWM"),
nsIWindowsRegKey::ACCESS_QUERY_VALUE);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}

// The ColorPrevalence value is set to 1 when the "Show color on title bar"
// setting in the Color section of Window's Personalization settings is
// turned on.
uint32_t accentColor, colorPrevalence;
if (NS_SUCCEEDED(mDwmKey->ReadIntValue(NS_LITERAL_STRING("AccentColor"), &accentColor)) &&
NS_SUCCEEDED(mDwmKey->ReadIntValue(NS_LITERAL_STRING("ColorPrevalence"), &colorPrevalence)) &&
colorPrevalence == 1) {
// The order of the color components in the DWORD stored in the registry
// happens to be the same order as we store the components in nscolor
// so we can just assign directly here.
aColor = accentColor;
rv = NS_OK;
} else {
rv = NS_ERROR_NOT_AVAILABLE;
}

mDwmKey->Close();

return rv;
}
10 changes: 0 additions & 10 deletions widget/windows/nsLookAndFeel.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "nsXPLookAndFeel.h"
#include "gfxFont.h"
#include "mozilla/RangedArray.h"
#include "nsIWindowsRegKey.h"

/*
* Gesture System Metrics
Expand Down Expand Up @@ -52,13 +51,6 @@ class nsLookAndFeel: public nsXPLookAndFeel {
void SetIntCacheImpl(const nsTArray<LookAndFeelInt>& aLookAndFeelIntCache) override;

private:
/**
* Fetches the Windows accent color from the Windows settings if
* the accent color is set to apply to the title bar, otherwise
* returns an error code.
*/
nsresult GetAccentColor(nscolor& aColor);

// Content process cached values that get shipped over from the browser
// process.
int32_t mUseAccessibilityTheme;
Expand All @@ -79,8 +71,6 @@ class nsLookAndFeel: public nsXPLookAndFeel {
mozilla::RangedArray<CachedSystemFont,
FontID_MINIMUM,
FontID_MAXIMUM + 1 - FontID_MINIMUM> mSystemFontCache;

nsCOMPtr<nsIWindowsRegKey> mDwmKey;
};

#endif
17 changes: 5 additions & 12 deletions widget/windows/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5197,19 +5197,12 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,

case WM_SETTINGCHANGE:
{
if (lParam) {
if (IsWin10OrLater() && mWindowType == eWindowType_invisible && lParam) {
auto lParamString = reinterpret_cast<const wchar_t*>(lParam);
if (!wcscmp(lParamString, L"ImmersiveColorSet")) {
// WM_SYSCOLORCHANGE is not dispatched for accent color changes
OnSysColorChanged();
break;
}
if (IsWin10OrLater() && mWindowType == eWindowType_invisible) {
if (!wcscmp(lParamString, L"UserInteractionMode")) {
nsCOMPtr<nsIWindowsUIUtils> uiUtils(do_GetService("@mozilla.org/windows-ui-utils;1"));
if (uiUtils) {
uiUtils->UpdateTabletModeState();
}
if (!wcscmp(lParamString, L"UserInteractionMode")) {
nsCOMPtr<nsIWindowsUIUtils> uiUtils(do_GetService("@mozilla.org/windows-ui-utils;1"));
if (uiUtils) {
uiUtils->UpdateTabletModeState();
}
}
}
Expand Down

0 comments on commit 617ce07

Please sign in to comment.