From e68483c0326d8c84a900951c8dea29e63d0a32fe Mon Sep 17 00:00:00 2001 From: sagitter Date: Apr 15 2017 12:02:14 +0000 Subject: Update to 52.0.2 --- diff --git a/.gitignore b/.gitignore index fb8587c..f5699d5 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ /icecat-45.7.0-gnu1.tar.bz2 /icecat-45.7.0-langpacks.tar.gz /icecat-52.0.1-gnu1.tar.bz2 +/icecat-52.0.2-gnu1.tar.bz2 diff --git a/icecat.spec b/icecat.spec index e9688ee..fb04b97 100644 --- a/icecat.spec +++ b/icecat.spec @@ -70,8 +70,8 @@ # Name: icecat -Version: 52.0.1 -Release: 5%{?dist} +Version: 52.0.2 +Release: 1%{?dist} Summary: GNU version of Firefox browser Group: Applications/Internet @@ -147,6 +147,8 @@ Patch406: mozilla-256180.patch # fix various rendering problems Patch407: widget-rebase.patch Patch409: mozilla-1158076.patch +Patch411: mozilla-1158076-1.patch +Patch412: mozilla-1158076-2.patch # Debian patches Patch500: mozilla-440908.patch @@ -315,7 +317,9 @@ tar -xf %{SOURCE5} # Rebase Gtk3 widget code to latest trunk to # fix various rendering problems %patch407 -p1 -b .widget-rebase -%patch409 -p1 -b .1158076 +#%%patch409 -p1 -b .1158076 +%patch411 -p1 -b .1158076-1 +%patch412 -p1 -b .1158076-2 # Debian extension patch %patch500 -p1 -b .440908 @@ -748,6 +752,10 @@ appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/appdata/*.appda %exclude %{_includedir}/%{icecat_ver}/ %changelog +* Fri Apr 14 2017 Antonio Trande 52.0.1-2 +- Update to 52.0.2 +- Add patch for mozbz#1158076 - enable dark theme by pref + * Sun Mar 26 2017 Antonio Trande 52.0.1-5 - Skia support disabled on ARM/ix86 builds (failed for memory exhausted) diff --git a/mozilla-1158076-1.patch b/mozilla-1158076-1.patch new file mode 100644 index 0000000..e409386 --- /dev/null +++ b/mozilla-1158076-1.patch @@ -0,0 +1,51 @@ +diff -up firefox-52.0.2/modules/libpref/init/all.js.1158076-1 firefox-52.0.2/modules/libpref/init/all.js +--- firefox-52.0.2/modules/libpref/init/all.js.1158076-1 2017-03-31 09:44:28.377647329 +0200 ++++ firefox-52.0.2/modules/libpref/init/all.js 2017-03-31 09:46:02.847234586 +0200 +@@ -4646,6 +4646,8 @@ pref("gfx.apitrace.enabled",false); + pref("gfx.content.use-native-pushlayer", true); + #ifdef MOZ_WIDGET_GTK + pref("gfx.xrender.enabled",false); ++pref("widget.chrome.allow-gtk-dark-theme", false); ++pref("widget.content.allow-gtk-dark-theme", false); + #endif + #endif + +diff -up firefox-52.0.2/widget/gtk/nsLookAndFeel.cpp.1158076-1 firefox-52.0.2/widget/gtk/nsLookAndFeel.cpp +--- firefox-52.0.2/widget/gtk/nsLookAndFeel.cpp.1158076-1 2017-03-31 09:44:28.374647342 +0200 ++++ firefox-52.0.2/widget/gtk/nsLookAndFeel.cpp 2017-03-31 09:44:35.125617758 +0200 +@@ -1134,16 +1134,27 @@ nsLookAndFeel::Init() + // with wrong color theme, see Bug 972382 + GtkSettings *settings = gtk_settings_get_for_screen(gdk_screen_get_default()); + +- // Disable dark theme because it interacts poorly with widget styling in +- // web content (see bug 1216658). +- // To avoid triggering reload of theme settings unnecessarily, only set the +- // setting when necessary. + const gchar* dark_setting = "gtk-application-prefer-dark-theme"; +- gboolean dark; +- g_object_get(settings, dark_setting, &dark, nullptr); ++ gboolean darkThemeDefault; ++ g_object_get(settings, dark_setting, &darkThemeDefault, nullptr); + +- if (dark && !PR_GetEnv("MOZ_ALLOW_GTK_DARK_THEME")) { +- g_object_set(settings, dark_setting, FALSE, nullptr); ++ // Dark themes interacts poorly with widget styling (see bug 1216658). ++ // We disable dark themes by default for all processes (chrome, web content) ++ // but allow user to overide it by prefs. ++ if (darkThemeDefault) { ++ bool allowDarkTheme; ++ if (XRE_IsContentProcess()) { ++ allowDarkTheme = ++ mozilla::Preferences::GetBool("widget.content.allow-gtk-dark-theme", ++ false); ++ } else { ++ allowDarkTheme = (PR_GetEnv("MOZ_ALLOW_GTK_DARK_THEME") != nullptr) || ++ mozilla::Preferences::GetBool("widget.chrome.allow-gtk-dark-theme", ++ false); ++ } ++ if (!allowDarkTheme) { ++ g_object_set(settings, dark_setting, FALSE, nullptr); ++ } + } + + // Scrollbar colors diff --git a/mozilla-1158076-2.patch b/mozilla-1158076-2.patch new file mode 100644 index 0000000..16079b3 --- /dev/null +++ b/mozilla-1158076-2.patch @@ -0,0 +1,184 @@ +diff --git a/widget/gtk/nsLookAndFeel.h b/widget/gtk/nsLookAndFeel.h +--- a/widget/gtk/nsLookAndFeel.h ++++ b/widget/gtk/nsLookAndFeel.h +@@ -76,13 +76,14 @@ protected: + nscolor sTextSelectedBackground; + nscolor sMozScrollbar; + #if (MOZ_WIDGET_GTK == 3) + nscolor sInfoBarText; + #endif + char16_t sInvisibleCharacter; + float sCaretRatio; + bool sMenuSupportsDrag; ++ bool mInitialized; + +- void Init(); ++ void EnsureInit(); + }; + + #endif + +diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp +--- a/widget/gtk/nsLookAndFeel.cpp ++++ b/widget/gtk/nsLookAndFeel.cpp +@@ -45,19 +45,19 @@ using mozilla::LookAndFeel; + (int)((c).blue*255), (int)((c).alpha*255))) + + nsLookAndFeel::nsLookAndFeel() + : nsXPLookAndFeel(), + #if (MOZ_WIDGET_GTK == 2) + mStyle(nullptr), + #endif + mDefaultFontCached(false), mButtonFontCached(false), +- mFieldFontCached(false), mMenuFontCached(false) ++ mFieldFontCached(false), mMenuFontCached(false), ++ mInitialized(false) + { +- Init(); + } + + nsLookAndFeel::~nsLookAndFeel() + { + #if (MOZ_WIDGET_GTK == 2) + g_object_unref(mStyle); + #endif + } +@@ -219,16 +219,18 @@ GetBorderColors(GtkStyleContext* aContex + *aDarkColor = GDK_RGBA_TO_NS_RGBA(darkColor); + return ret; + } + #endif + + nsresult + nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) + { ++ EnsureInit(); ++ + #if (MOZ_WIDGET_GTK == 3) + GdkRGBA gdk_color; + #endif + nsresult res = NS_OK; + + switch (aID) { + // These colors don't seem to be used for anything anymore in Mozilla + // (except here at least TextSelectBackground and TextSelectForeground) +@@ -670,16 +672,21 @@ nsLookAndFeel::GetIntImpl(IntID aID, int + break; + } + + res = nsXPLookAndFeel::GetIntImpl(aID, aResult); + if (NS_SUCCEEDED(res)) + return res; + res = NS_OK; + ++ // We use delayed initialization by EnsureInit() here ++ // to make sure mozilla::Preferences is available (Bug 115807). ++ // eIntID_UseAccessibilityTheme is requested before user preferences ++ // are read, and so EnsureInit(), which depends on preference values, ++ // is deliberately delayed until required. + switch (aID) { + case eIntID_CaretBlinkTime: + { + GtkSettings *settings; + gint blink_time; + gboolean blink; + + settings = gtk_settings_get_default (); +@@ -832,16 +839,17 @@ nsLookAndFeel::GetIntImpl(IntID aID, int + case eIntID_IMESelectedRawTextUnderlineStyle: + case eIntID_IMESelectedConvertedTextUnderline: + aResult = NS_STYLE_TEXT_DECORATION_STYLE_NONE; + break; + case eIntID_SpellCheckerUnderlineStyle: + aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY; + break; + case eIntID_MenuBarDrag: ++ EnsureInit(); + aResult = sMenuSupportsDrag; + break; + case eIntID_ScrollbarButtonAutoRepeatBehavior: + aResult = 1; + break; + case eIntID_SwipeAnimationEnabled: + aResult = 0; + break; +@@ -872,16 +880,17 @@ nsLookAndFeel::GetFloatImpl(FloatID aID, + switch (aID) { + case eFloatID_IMEUnderlineRelativeSize: + aResult = 1.0f; + break; + case eFloatID_SpellCheckerUnderlineRelativeSize: + aResult = 1.0f; + break; + case eFloatID_CaretAspectRatio: ++ EnsureInit(); + aResult = sCaretRatio; + break; + default: + aResult = -1.0; + res = NS_ERROR_FAILURE; + } + return res; + } +@@ -1052,21 +1061,25 @@ nsLookAndFeel::GetFontImpl(FontID aID, n + } + + aFontName = *cachedFontName; + aFontStyle = *cachedFontStyle; + return true; + } + + void +-nsLookAndFeel::Init() ++nsLookAndFeel::EnsureInit() + { + GdkColor colorValue; + GdkColor *colorValuePtr; + ++ if (mInitialized) ++ return; ++ mInitialized = true; ++ + #if (MOZ_WIDGET_GTK == 2) + NS_ASSERTION(!mStyle, "already initialized"); + // GtkInvisibles come with a refcount that is not floating + // (since their initialization code calls g_object_ref_sink) and + // their destroy code releases that reference (which means they + // have to be explicitly destroyed, since calling unref enough + // to cause destruction would lead to *another* unref). + // However, this combination means that it's actually still ok +@@ -1445,16 +1458,17 @@ nsLookAndFeel::Init() + + gtk_widget_destroy(window); + } + + // virtual + char16_t + nsLookAndFeel::GetPasswordCharacterImpl() + { ++ EnsureInit(); + return sInvisibleCharacter; + } + + void + nsLookAndFeel::RefreshImpl() + { + nsXPLookAndFeel::RefreshImpl(); + +@@ -1463,15 +1477,15 @@ nsLookAndFeel::RefreshImpl() + mFieldFontCached = false; + mMenuFontCached = false; + + #if (MOZ_WIDGET_GTK == 2) + g_object_unref(mStyle); + mStyle = nullptr; + #endif + +- Init(); ++ mInitialized = false; + } + + bool + nsLookAndFeel::GetEchoPasswordImpl() { + return false; + } diff --git a/sources b/sources index 10fae17..71fab6b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (icecat-52.0.1-gnu1.tar.bz2) = 334efcd2983eced9b17c61846748aa51919845bab06b922294f1d9cd55f59f3cc3fc2f8a8a88bdda4aca3e6204ff97c868c05c2d4c5850757863bc5ff75b56e4 +SHA512 (icecat-52.0.2-gnu1.tar.bz2) = 35794e009f937b5df78afee6389a6b0eeafc2b0d22115495faba85de59eaf3511fe02802db8d19d27507abbcc5048cdf637890a00afd3c8bec4ad86a80203dc0 SHA512 (icecat-COPYING-licensefiles.tar.gz) = ed541845170f1d209e322b0def3248d571e0c42c4a17c74e83197e743bd8a128a1475f5312d905c8e70d047eddeac17e604373892eb6d5f1720c5c361849c42c