summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Stransky <stransky@redhat.com>2018-04-30 12:07:49 +0200
committerMartin Stransky <stransky@redhat.com>2018-04-30 12:07:49 +0200
commit14c907c37561e8bf362f740137dfbe1b2ff6eeff (patch)
tree6ee94024372d3f83e84e7a9b52337e6042c2a710
parentUpdate to 60.0 Beta 16 (diff)
downloadlibrewolf-fedora-ff-14c907c37561e8bf362f740137dfbe1b2ff6eeff.tar.gz
librewolf-fedora-ff-14c907c37561e8bf362f740137dfbe1b2ff6eeff.tar.bz2
librewolf-fedora-ff-14c907c37561e8bf362f740137dfbe1b2ff6eeff.zip
Added patches for correct popups position at CSD mode (mozilla-1457691)
-rw-r--r--complete-csd-window-offset-mozilla-1457691.patch212
-rw-r--r--firefox.spec9
-rw-r--r--mozilla-1424422.patch188
3 files changed, 408 insertions, 1 deletions
diff --git a/complete-csd-window-offset-mozilla-1457691.patch b/complete-csd-window-offset-mozilla-1457691.patch
new file mode 100644
index 0000000..85cb981
--- /dev/null
+++ b/complete-csd-window-offset-mozilla-1457691.patch
@@ -0,0 +1,212 @@
+diff -up firefox-60.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-60.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium
+diff -up firefox-60.0/media/webrtc/trunk/Makefile.old firefox-60.0/media/webrtc/trunk/Makefile
+diff -up firefox-60.0/widget/gtk/gtk3drawing.cpp.old firefox-60.0/widget/gtk/gtk3drawing.cpp
+--- firefox-60.0/widget/gtk/gtk3drawing.cpp.old 2018-04-26 22:07:36.000000000 +0200
++++ firefox-60.0/widget/gtk/gtk3drawing.cpp 2018-04-30 11:59:06.750866104 +0200
+@@ -38,6 +38,16 @@ static ToolbarGTKMetrics sToolbarMetrics
+ #define GTK_STATE_FLAG_CHECKED (1 << 11)
+ #endif
+
++static GtkBorder
++operator+=(GtkBorder& first, const GtkBorder& second)
++{
++ first.left += second.left;
++ first.right += second.right;
++ first.top += second.top;
++ first.bottom += second.bottom;
++ return first;
++}
++
+ static gint
+ moz_gtk_get_tab_thickness(GtkStyleContext *style);
+
+@@ -3056,6 +3066,76 @@ GetScrollbarMetrics(GtkOrientation aOrie
+ return metrics;
+ }
+
++/*
++ * get_shadow_width() from gtkwindow.c is not public so we need
++ * to implement it.
++ */
++bool
++GetCSDDecorationSize(GtkWindow *aGtkWindow, GtkBorder* aDecorationSize)
++{
++ GtkStyleContext* context = gtk_widget_get_style_context(GTK_WIDGET(aGtkWindow));
++ bool solidDecorations = gtk_style_context_has_class(context, "solid-csd");
++ context = GetStyleContext(solidDecorations ?
++ MOZ_GTK_WINDOW_DECORATION_SOLID :
++ MOZ_GTK_WINDOW_DECORATION);
++
++ /* Always sum border + padding */
++ GtkBorder padding;
++ GtkStateFlags state = gtk_style_context_get_state(context);
++ gtk_style_context_get_border(context, state, aDecorationSize);
++ gtk_style_context_get_padding(context, state, &padding);
++ *aDecorationSize += padding;
++
++ // Available on GTK 3.20+.
++ static auto sGtkRenderBackgroundGetClip =
++ (void (*)(GtkStyleContext*, gdouble, gdouble, gdouble, gdouble, GdkRectangle*))
++ dlsym(RTLD_DEFAULT, "gtk_render_background_get_clip");
++
++ GtkBorder margin;
++ gtk_style_context_get_margin(context, state, &margin);
++
++ GtkBorder extents = {0, 0, 0, 0};
++ if (sGtkRenderBackgroundGetClip) {
++ /* Get shadow extents but combine with style margin; use the bigger value.
++ */
++ GdkRectangle clip;
++ sGtkRenderBackgroundGetClip(context, 0, 0, 0, 0, &clip);
++
++ extents.top = -clip.y;
++ extents.right = clip.width + clip.x;
++ extents.bottom = clip.height + clip.y;
++ extents.left = -clip.x;
++
++ // Margin is used for resize grip size - it's not present on
++ // popup windows.
++ if (gtk_window_get_window_type(aGtkWindow) != GTK_WINDOW_POPUP) {
++ extents.top = MAX(extents.top, margin.top);
++ extents.right = MAX(extents.right, margin.right);
++ extents.bottom = MAX(extents.bottom, margin.bottom);
++ extents.left = MAX(extents.left, margin.left);
++ }
++ } else {
++ /* If we can't get shadow extents use decoration-resize-handle instead
++ * as a workaround. This is inspired by update_border_windows()
++ * from gtkwindow.c although this is not 100% accurate as we emulate
++ * the extents here.
++ */
++ gint handle;
++ gtk_widget_style_get(GetWidget(MOZ_GTK_WINDOW),
++ "decoration-resize-handle", &handle,
++ NULL);
++
++ extents.top = handle + margin.top;
++ extents.right = handle + margin.right;
++ extents.bottom = handle + margin.bottom;
++ extents.left = handle + margin.left;
++ }
++
++ *aDecorationSize += extents;
++
++ return (sGtkRenderBackgroundGetClip != nullptr);
++}
++
+ /* cairo_t *cr argument has to be a system-cairo. */
+ gint
+ moz_gtk_widget_paint(WidgetNodeType widget, cairo_t *cr,
+diff -up firefox-60.0/widget/gtk/gtkdrawing.h.old firefox-60.0/widget/gtk/gtkdrawing.h
+--- firefox-60.0/widget/gtk/gtkdrawing.h.old 2018-04-26 22:07:35.000000000 +0200
++++ firefox-60.0/widget/gtk/gtkdrawing.h 2018-04-30 11:59:06.750866104 +0200
+@@ -334,6 +334,10 @@ typedef enum {
+ */
+ MOZ_GTK_HEADER_BAR_BUTTON_MAXIMIZE_RESTORE,
+
++ /* Client-side window decoration node. Available on GTK 3.20+. */
++ MOZ_GTK_WINDOW_DECORATION,
++ MOZ_GTK_WINDOW_DECORATION_SOLID,
++
+ MOZ_GTK_WIDGET_NODE_COUNT
+ } WidgetNodeType;
+
+@@ -606,4 +610,17 @@ GetToolbarButtonMetrics(WidgetNodeType a
+ int
+ GetGtkHeaderBarButtonLayout(WidgetNodeType* aButtonLayout, int aMaxButtonNums);
+
++/**
++ * Get size of CSD window extents of given GtkWindow.
++ *
++ * aGtkWindow [IN] Decorated window.
++ * aDecorationSize [OUT] Returns calculated (or estimated) decoration
++ * size of given aGtkWindow.
++ *
++ * returns: True if we have extract decoration size (for GTK 3.20+)
++ * False if we have only an estimation (for GTK+ before 3.20+)
++ */
++bool
++GetCSDDecorationSize(GtkWindow *aGtkWindow, GtkBorder* aDecorationSize);
++
+ #endif
+diff -up firefox-60.0/widget/gtk/nsWindow.cpp.old firefox-60.0/widget/gtk/nsWindow.cpp
+--- firefox-60.0/widget/gtk/nsWindow.cpp.old 2018-04-30 12:01:38.788343254 +0200
++++ firefox-60.0/widget/gtk/nsWindow.cpp 2018-04-30 12:00:01.012679502 +0200
+@@ -127,6 +127,7 @@ using namespace mozilla::widget;
+ #endif
+
+ #include "nsShmImage.h"
++#include "gtkdrawing.h"
+
+ #include "nsIDOMWheelEvent.h"
+
+@@ -3360,6 +3361,10 @@ nsWindow::OnWindowStateEvent(GtkWidget *
+ aEvent->new_window_state & GDK_WINDOW_STATE_FULLSCREEN);
+ }
+ }
++
++ if (mDrawInTitlebar && mCSDSupportLevel == CSD_SUPPORT_CLIENT) {
++ UpdateClientOffsetForCSDWindow();
++ }
+ }
+
+ void
+@@ -6556,6 +6561,32 @@ nsWindow::ClearCachedResources()
+ }
+ }
+
++/* nsWindow::UpdateClientOffsetForCSDWindow() is designed to be called from
++ * paint code to update mClientOffset any time. It also propagates
++ * the mClientOffset to child tabs.
++ *
++ * It works only for CSD decorated GtkWindow.
++ */
++void
++nsWindow::UpdateClientOffsetForCSDWindow()
++{
++ // _NET_FRAME_EXTENTS is not set on client decorated windows,
++ // so we need to read offset between mContainer and toplevel mShell
++ // window.
++ if (mSizeState == nsSizeMode_Normal) {
++ GtkBorder decorationSize;
++ GetCSDDecorationSize(GTK_WINDOW(mShell), &decorationSize);
++ mClientOffset = nsIntPoint(decorationSize.left, decorationSize.top);
++ } else {
++ mClientOffset = nsIntPoint(0, 0);
++ }
++
++ // Send a WindowMoved notification. This ensures that TabParent
++ // picks up the new client offset and sends it to the child process
++ // if appropriate.
++ NotifyWindowMoved(mBounds.x, mBounds.y);
++}
++
+ nsresult
+ nsWindow::SetNonClientMargins(LayoutDeviceIntMargin &aMargins)
+ {
+@@ -6628,6 +6659,13 @@ nsWindow::SetDrawsInTitlebar(bool aState
+ mNeedsShow = true;
+ NativeResize();
+
++ // When we use system titlebar setup managed by Gtk+ we also get
++ // _NET_FRAME_EXTENTS property for our toplevel window so we can't
++ // update the client offset it here.
++ if (aState) {
++ UpdateClientOffsetForCSDWindow();
++ }
++
+ gtk_widget_destroy(tmpWindow);
+ }
+ }
+diff -up firefox-60.0/widget/gtk/nsWindow.h.old firefox-60.0/widget/gtk/nsWindow.h
+--- firefox-60.0/widget/gtk/nsWindow.h.old 2018-04-26 22:07:35.000000000 +0200
++++ firefox-60.0/widget/gtk/nsWindow.h 2018-04-30 11:57:33.656146337 +0200
+@@ -456,6 +456,8 @@ private:
+ nsIWidgetListener* GetListener();
+ bool IsComposited() const;
+
++ void UpdateClientOffsetForCSDWindow();
++
+ GtkWidget *mShell;
+ MozContainer *mContainer;
+ GdkWindow *mGdkWindow;
diff --git a/firefox.spec b/firefox.spec
index f776f6b..01d81a9 100644
--- a/firefox.spec
+++ b/firefox.spec
@@ -96,7 +96,7 @@
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 60.0
-Release: 0.2%{?pre_tag}%{?dist}
+Release: 0.3%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://hg.mozilla.org/releases/mozilla-release/archive/firefox-%{version}%{?pre_version}.source.tar.xz
@@ -153,6 +153,8 @@ Patch412: mozilla-1337988.patch
Patch413: mozilla-1353817.patch
Patch414: mozilla-1435212-ffmpeg-4.0.patch
Patch415: Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch
+Patch416: mozilla-1424422.patch
+Patch417: complete-csd-window-offset-mozilla-1457691.patch
# Debian patches
Patch500: mozilla-440908.patch
@@ -321,6 +323,8 @@ This package contains results of tests executed during build.
%ifarch %{arm}
%patch415 -p1 -b .mozilla-1238661
%endif
+%patch416 -p1 -b .1424422
+%patch417 -p1 -b .complete-csd-1457691
# Patch for big endian platforms only
%if 0%{?big_endian}
@@ -846,6 +850,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#---------------------------------------------------------------------
%changelog
+* Mon Apr 30 2018 Martin Stransky <stransky@redhat.com> - 60.0-0.3
+- Added patches for correct popups position at CSD mode (mozilla-1457691).
+
* Fri Apr 27 2018 Martin Stransky <stransky@redhat.com> - 60.0-0.2
- Update to 60.0 Beta 16
diff --git a/mozilla-1424422.patch b/mozilla-1424422.patch
new file mode 100644
index 0000000..cc8b31f
--- /dev/null
+++ b/mozilla-1424422.patch
@@ -0,0 +1,188 @@
+diff -up firefox-60.0/browser/base/content/browser.js.1424422 firefox-60.0/browser/base/content/browser.js
+--- firefox-60.0/browser/base/content/browser.js.1424422 2018-04-26 22:07:20.000000000 +0200
++++ firefox-60.0/browser/base/content/browser.js 2018-04-30 11:49:51.609458857 +0200
+@@ -1259,6 +1259,9 @@ var gBrowserInit = {
+
+ if (AppConstants.CAN_DRAW_IN_TITLEBAR) {
+ gDragSpaceObserver.init();
++ if (AppConstants.platform == "linux") {
++ gLightThemeObserver.init();
++ }
+ }
+
+ BrowserSearch.initPlaceHolder();
+@@ -1826,6 +1829,9 @@ var gBrowserInit = {
+
+ if (AppConstants.CAN_DRAW_IN_TITLEBAR) {
+ gDragSpaceObserver.uninit();
++ if (AppConstants.platform == "linux") {
++ gLightThemeObserver.uninit();
++ }
+ }
+
+ TabsInTitlebar.uninit();
+@@ -5781,6 +5787,24 @@ var gDragSpaceObserver = {
+ },
+ };
+
++var gLightThemeObserver = {
++ init() {
++ Services.obs.addObserver(this, "lightweight-theme-styling-update");
++ },
++
++ uninit() {
++ Services.obs.removeObserver(this, "lightweight-theme-styling-update");
++ },
++
++ observe(aSubject, aTopic, aData) {
++ switch (aTopic) {
++ case "lightweight-theme-styling-update":
++ TabsInTitlebar.updateAppearance(true);
++ break;
++ }
++ },
++};
++
+ // Updates the UI density (for touch and compact mode) based on the uidensity pref.
+ var gUIDensity = {
+ MODE_NORMAL: 0,
+diff -up firefox-60.0/browser/themes/linux/browser.css.1424422 firefox-60.0/browser/themes/linux/browser.css
+--- firefox-60.0/browser/themes/linux/browser.css.1424422 2018-04-26 22:07:21.000000000 +0200
++++ firefox-60.0/browser/themes/linux/browser.css 2018-04-30 11:45:40.388172492 +0200
+@@ -691,12 +691,34 @@ notification[value="translation"] menuli
+ padding-bottom: 2px;
+ }
+
++ /* When default theme is used render titlebar command buttons
++ * according to system config.
++ *
++ * When -moz-lwtheme is enabled use similar approach as on Windows platform.
++ */
++ .titlebar-button:-moz-lwtheme {
++ border: none;
++ margin: 0 !important;
++ padding: 8px 17px;
++ }
++ .titlebar-button:-moz-lwtheme > .toolbarbutton-icon {
++ width: 12px;
++ height: 12px;
++ }
++ .titlebar-button:hover:-moz-lwtheme {
++ background-color: Highlight;
++ }
++
+ /* Render titlebar command buttons according to system config.
+ * Use full scale icons here as the Gtk+ does.
+ */
+ @media (-moz-gtk-csd-minimize-button) {
+- #titlebar-min {
+- -moz-appearance: -moz-window-button-minimize;
++ #titlebar-min:not(:-moz-lwtheme) {
++ -moz-appearance: -moz-window-button-minimize;
++ }
++ #titlebar-min:-moz-lwtheme {
++ -moz-appearance: none !important;
++ list-style-image: url(chrome://browser/skin/window-controls/minimize-themes.svg);
+ }
+ }
+ @media (-moz-gtk-csd-minimize-button: 0) {
+@@ -706,12 +728,20 @@ notification[value="translation"] menuli
+ }
+
+ @media (-moz-gtk-csd-maximize-button) {
+- #titlebar-max {
++ #titlebar-max:not(:-moz-lwtheme) {
+ -moz-appearance: -moz-window-button-maximize;
+ }
+- :root[sizemode="maximized"] #titlebar-max {
++ #titlebar-max:-moz-lwtheme {
++ -moz-appearance: none !important;
++ list-style-image: url(chrome://browser/skin/window-controls/maximize-themes.svg);
++ }
++ :root[sizemode="maximized"] #titlebar-max:not(:-moz-lwtheme) {
+ -moz-appearance: -moz-window-button-restore;
+ }
++ :root[sizemode="maximized"] #titlebar-max:-moz-lwtheme {
++ -moz-appearance: none !important;
++ list-style-image: url(chrome://browser/skin/window-controls/restore-themes.svg);
++ }
+ }
+ @media (-moz-gtk-csd-maximize-button: 0) {
+ #titlebar-max {
+@@ -720,9 +750,13 @@ notification[value="translation"] menuli
+ }
+
+ @media (-moz-gtk-csd-close-button) {
+- #titlebar-close {
++ #titlebar-close:not(:-moz-lwtheme) {
+ -moz-appearance: -moz-window-button-close;
+ }
++ #titlebar-close:-moz-lwtheme {
++ -moz-appearance: none !important;
++ list-style-image: url(chrome://browser/skin/window-controls/close-themes.svg);
++ }
+ }
+ @media (-moz-gtk-csd-close-button: 0) {
+ #titlebar-close {
+diff -up firefox-60.0/browser/themes/linux/jar.mn.1424422 firefox-60.0/browser/themes/linux/jar.mn
+--- firefox-60.0/browser/themes/linux/jar.mn.1424422 2018-04-26 22:07:20.000000000 +0200
++++ firefox-60.0/browser/themes/linux/jar.mn 2018-04-30 11:45:40.388172492 +0200
+@@ -49,9 +49,12 @@ browser.jar:
+ * skin/classic/browser/preferences/in-content/dialog.css (preferences/in-content/dialog.css)
+ skin/classic/browser/preferences/applications.css (preferences/applications.css)
+ skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
+-
+ skin/classic/browser/sync-desktopIcon.svg (../shared/sync-desktopIcon.svg)
+ skin/classic/browser/sync-mobileIcon.svg (../shared/sync-mobileIcon.svg)
++ skin/classic/browser/window-controls/close-themes.svg (window-controls/close-themes.svg)
++ skin/classic/browser/window-controls/maximize-themes.svg (window-controls/maximize-themes.svg)
++ skin/classic/browser/window-controls/minimize-themes.svg (window-controls/minimize-themes.svg)
++ skin/classic/browser/window-controls/restore-themes.svg (window-controls/restore-themes.svg)
+ skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
+
+ [extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar:
+diff -up firefox-60.0/browser/themes/linux/window-controls/close-themes.svg.1424422 firefox-60.0/browser/themes/linux/window-controls/close-themes.svg
+--- firefox-60.0/browser/themes/linux/window-controls/close-themes.svg.1424422 2018-04-30 11:45:40.388172492 +0200
++++ firefox-60.0/browser/themes/linux/window-controls/close-themes.svg 2018-04-30 11:45:40.388172492 +0200
+@@ -0,0 +1,7 @@
++<!-- This Source Code Form is subject to the terms of the Mozilla Public
++ - License, v. 2.0. If a copy of the MPL was not distributed with this
++ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
++<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg">
++ <path stroke="black" stroke-width="3.6" stroke-opacity=".75" d="M1,1 l 10,10 M1,11 l 10,-10"/>
++ <path stroke="white" stroke-width="1.9" d="M1.75,1.75 l 8.5,8.5 M1.75,10.25 l 8.5,-8.5"/>
++</svg>
+diff -up firefox-60.0/browser/themes/linux/window-controls/maximize-themes.svg.1424422 firefox-60.0/browser/themes/linux/window-controls/maximize-themes.svg
+--- firefox-60.0/browser/themes/linux/window-controls/maximize-themes.svg.1424422 2018-04-30 11:45:40.388172492 +0200
++++ firefox-60.0/browser/themes/linux/window-controls/maximize-themes.svg 2018-04-30 11:45:40.388172492 +0200
+@@ -0,0 +1,7 @@
++<!-- This Source Code Form is subject to the terms of the Mozilla Public
++ - License, v. 2.0. If a copy of the MPL was not distributed with this
++ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
++<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges" fill="none">
++ <rect stroke="black" stroke-width="3.6" stroke-opacity=".75" x="2" y="2" width="8" height="8"/>
++ <rect stroke="white" stroke-width="1.9" x="2" y="2" width="8" height="8"/>
++</svg>
+diff -up firefox-60.0/browser/themes/linux/window-controls/minimize-themes.svg.1424422 firefox-60.0/browser/themes/linux/window-controls/minimize-themes.svg
+--- firefox-60.0/browser/themes/linux/window-controls/minimize-themes.svg.1424422 2018-04-30 11:45:40.388172492 +0200
++++ firefox-60.0/browser/themes/linux/window-controls/minimize-themes.svg 2018-04-30 11:45:40.388172492 +0200
+@@ -0,0 +1,7 @@
++<!-- This Source Code Form is subject to the terms of the Mozilla Public
++ - License, v. 2.0. If a copy of the MPL was not distributed with this
++ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
++<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges">
++ <line stroke="black" stroke-width="3.6" stroke-opacity=".75" x1="0" y1="6" x2="12" y2="6"/>
++ <line stroke="white" stroke-width="1.9" x1="1" y1="6" x2="11" y2="6"/>
++</svg>
+diff -up firefox-60.0/browser/themes/linux/window-controls/restore-themes.svg.1424422 firefox-60.0/browser/themes/linux/window-controls/restore-themes.svg
+--- firefox-60.0/browser/themes/linux/window-controls/restore-themes.svg.1424422 2018-04-30 11:45:40.388172492 +0200
++++ firefox-60.0/browser/themes/linux/window-controls/restore-themes.svg 2018-04-30 11:45:40.388172492 +0200
+@@ -0,0 +1,8 @@
++<!-- This Source Code Form is subject to the terms of the Mozilla Public
++ - License, v. 2.0. If a copy of the MPL was not distributed with this
++ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
++<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges" fill="none" stroke="white">
++ <path stroke="black" stroke-width="3.6" stroke-opacity=".75" d="M2,4 l 6,0 l 0,6 l -6,0z M2.5,1.5 l 8,0 l 0,8"/>
++ <rect stroke-width="1.9" x="2" y="4" width="6" height="6"/>
++ <polyline stroke-width=".9" points="3.5,1.5 10.5,1.5 10.5,8.5"/>
++</svg>
bgstack15