Update to 41.0 Build 1

This commit is contained in:
Martin Stransky 2015-09-15 11:35:53 +02:00
parent 1d5f27bb2b
commit f37041f277
10 changed files with 11 additions and 1557 deletions

2
.gitignore vendored
View File

@ -155,3 +155,5 @@ firefox-3.6.4.source.tar.bz2
/firefox-langpacks-40.0-20150811.tar.xz /firefox-langpacks-40.0-20150811.tar.xz
/firefox-40.0.3.source.tar.bz2 /firefox-40.0.3.source.tar.bz2
/firefox-langpacks-40.0.3-20150827.tar.xz /firefox-langpacks-40.0.3-20150827.tar.xz
/firefox-41.0.source.tar.xz
/firefox-langpacks-41.0-20150915.tar.xz

View File

@ -90,14 +90,14 @@
Summary: Mozilla Firefox Web browser Summary: Mozilla Firefox Web browser
Name: firefox Name: firefox
Version: 40.0.3 Version: 41.0
Release: 3%{?pre_tag}%{?dist} Release: 1%{?pre_tag}%{?dist}
URL: http://www.mozilla.org/projects/firefox/ URL: http://www.mozilla.org/projects/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+ License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet Group: Applications/Internet
Source0: ftp://ftp.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.bz2 Source0: ftp://ftp.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
%if %{build_langpacks} %if %{build_langpacks}
Source1: firefox-langpacks-%{version}%{?pre_version}-20150827.tar.xz Source1: firefox-langpacks-%{version}%{?pre_version}-20150915.tar.xz
%endif %endif
Source10: firefox-mozconfig Source10: firefox-mozconfig
Source12: firefox-redhat-default-prefs.js Source12: firefox-redhat-default-prefs.js
@ -131,15 +131,8 @@ Patch221: firefox-fedora-ua.patch
# Upstream patches # Upstream patches
# Gtk3 upstream patches # Gtk3 upstream patches
Patch419: mozilla-1144745-3.patch
Patch420: mozilla-1160154.patch Patch420: mozilla-1160154.patch
Patch421: mozilla-1169233.patch
Patch422: mozilla-1169232.patch
Patch423: mozilla-1129873-apppicker.patch
Patch424: mozilla-entry-padding.patch
Patch425: mozilla-1192243.patch Patch425: mozilla-1192243.patch
Patch426: mozilla-1127752.patch
Patch427: mozilla-1166584.patch
# Fix Skia Neon stuff on AArch64 # Fix Skia Neon stuff on AArch64
Patch500: aarch64-fix-skia.patch Patch500: aarch64-fix-skia.patch
@ -280,15 +273,8 @@ cd %{tarballdir}
# Upstream patches # Upstream patches
%if %{toolkit_gtk3} %if %{toolkit_gtk3}
%patch419 -p1 -b .1144745-3
%patch420 -p1 -b .1160154 %patch420 -p1 -b .1160154
%patch421 -p1 -b .1169233
%patch422 -p1 -b .1169232
%patch423 -p1 -b .1129873-apppicker
%patch424 -p2 -b .entry-padding
%patch425 -p1 -b .1192243 %patch425 -p1 -b .1192243
%patch426 -p2 -b .1127752
%patch427 -p1 -b .1166584
%endif %endif
%patch500 -p1 %patch500 -p1
@ -781,6 +767,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#--------------------------------------------------------------------- #---------------------------------------------------------------------
%changelog %changelog
* Tue Sep 15 2015 Martin Stransky <stransky@redhat.com> - 41.0-1
- Update to 40.0 Build 1
* Thu Sep 3 2015 Martin Stransky <stransky@redhat.com> - 40.0.3-3 * Thu Sep 3 2015 Martin Stransky <stransky@redhat.com> - 40.0.3-3
- Removed the dom.ipc.plugins.asyncInit hack, it's already in tarball - Removed the dom.ipc.plugins.asyncInit hack, it's already in tarball

View File

@ -1,941 +0,0 @@
diff -up firefox-40.0/mozilla-release/gfx/2d/BorrowedContext.h.1127752 firefox-40.0/mozilla-release/gfx/2d/BorrowedContext.h
--- firefox-40.0/mozilla-release/gfx/2d/BorrowedContext.h.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/gfx/2d/BorrowedContext.h 2015-08-26 14:07:24.666087911 +0200
@@ -8,6 +8,11 @@
#include "2D.h"
+#ifdef MOZ_X11
+#include <X11/extensions/Xrender.h>
+#include <X11/Xlib.h>
+#endif
+
struct _cairo;
typedef struct _cairo cairo_t;
@@ -69,6 +74,69 @@ private:
DrawTarget *mDT;
};
+#ifdef MOZ_X11
+/* This is a helper class that let's you borrow an Xlib drawable from
+ * a DrawTarget. This is used for drawing themed widgets.
+ *
+ * Callers should check the Xlib drawable after constructing the object
+ * to see if it succeeded. The DrawTarget should not be used while
+ * the drawable is borrowed. */
+class BorrowedXlibDrawable
+{
+public:
+ BorrowedXlibDrawable()
+ : mDT(nullptr),
+ mDisplay(nullptr),
+ mDrawable(None),
+ mScreen(nullptr),
+ mVisual(nullptr),
+ mXRenderFormat(nullptr)
+ {}
+
+ explicit BorrowedXlibDrawable(DrawTarget *aDT)
+ : mDT(nullptr),
+ mDisplay(nullptr),
+ mDrawable(None),
+ mScreen(nullptr),
+ mVisual(nullptr),
+ mXRenderFormat(nullptr)
+ {
+ Init(aDT);
+ }
+
+ // We can optionally Init after construction in
+ // case we don't know what the DT will be at construction
+ // time.
+ bool Init(DrawTarget *aDT);
+
+ // The caller needs to call Finish if drawable is non-zero when
+ // they are done with the context. This is currently explicit
+ // instead of happening implicitly in the destructor to make
+ // what's happening in the caller more clear. It also
+ // let's you resume using the DrawTarget in the same scope.
+ void Finish();
+
+ ~BorrowedXlibDrawable() {
+ MOZ_ASSERT(!mDrawable);
+ }
+
+ Display *GetDisplay() const { return mDisplay; }
+ Drawable GetDrawable() const { return mDrawable; }
+ Screen *GetScreen() const { return mScreen; }
+ Visual *GetVisual() const { return mVisual; }
+
+ XRenderPictFormat* GetXRenderFormat() const { return mXRenderFormat; }
+
+private:
+ DrawTarget *mDT;
+ Display *mDisplay;
+ Drawable mDrawable;
+ Screen *mScreen;
+ Visual *mVisual;
+ XRenderPictFormat *mXRenderFormat;
+};
+#endif
+
#ifdef XP_MACOSX
/* This is a helper class that let's you borrow a CGContextRef from a
* DrawTargetCG. This is used for drawing themed widgets.
diff -up firefox-40.0/mozilla-release/gfx/2d/DrawTargetCairo.cpp.1127752 firefox-40.0/mozilla-release/gfx/2d/DrawTargetCairo.cpp
--- firefox-40.0/mozilla-release/gfx/2d/DrawTargetCairo.cpp.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/gfx/2d/DrawTargetCairo.cpp 2015-08-26 14:07:24.666087911 +0200
@@ -1714,5 +1714,50 @@ BorrowedCairoContext::ReturnCairoContext
cairoDT->mContext = aCairo;
}
+#ifdef MOZ_X11
+bool
+BorrowedXlibDrawable::Init(DrawTarget* aDT)
+{
+ MOZ_ASSERT(aDT, "Caller should check for nullptr");
+ MOZ_ASSERT(!mDT, "Can't initialize twice!");
+ mDT = aDT;
+ mDrawable = None;
+
+#ifdef CAIRO_HAS_XLIB_SURFACE
+ if (aDT->GetBackendType() != BackendType::CAIRO ||
+ aDT->IsDualDrawTarget() ||
+ aDT->IsTiledDrawTarget()) {
+ return false;
+ }
+
+ DrawTargetCairo* cairoDT = static_cast<DrawTargetCairo*>(aDT);
+ cairo_surface_t* surf = cairoDT->mSurface;
+ if (cairo_surface_get_type(surf) != CAIRO_SURFACE_TYPE_XLIB) {
+ return false;
+ }
+
+ cairoDT->WillChange();
+
+ mDisplay = cairo_xlib_surface_get_display(surf);
+ mDrawable = cairo_xlib_surface_get_drawable(surf);
+ mScreen = cairo_xlib_surface_get_screen(surf);
+ mVisual = cairo_xlib_surface_get_visual(surf);
+ mXRenderFormat = cairo_xlib_surface_get_xrender_format(surf);
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+void
+BorrowedXlibDrawable::Finish()
+{
+ if (mDrawable) {
+ mDrawable = None;
+ }
+}
+#endif
+
}
}
diff -up firefox-40.0/mozilla-release/gfx/2d/DrawTargetCairo.h.1127752 firefox-40.0/mozilla-release/gfx/2d/DrawTargetCairo.h
--- firefox-40.0/mozilla-release/gfx/2d/DrawTargetCairo.h.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/gfx/2d/DrawTargetCairo.h 2015-08-26 14:07:24.666087911 +0200
@@ -54,6 +54,7 @@ class DrawTargetCairo final : public Dra
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetCairo, override)
friend class BorrowedCairoContext;
+ friend class BorrowedXlibDrawable;
DrawTargetCairo();
virtual ~DrawTargetCairo();
diff -up firefox-40.0/mozilla-release/gfx/2d/DrawTargetSkia.cpp.1127752 firefox-40.0/mozilla-release/gfx/2d/DrawTargetSkia.cpp
--- firefox-40.0/mozilla-release/gfx/2d/DrawTargetSkia.cpp.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/gfx/2d/DrawTargetSkia.cpp 2015-08-26 14:07:24.667087889 +0200
@@ -148,6 +148,35 @@ DrawTargetSkia::Snapshot()
return snapshot.forget();
}
+bool
+DrawTargetSkia::LockBits(uint8_t** aData, IntSize* aSize,
+ int32_t* aStride, SurfaceFormat* aFormat)
+{
+ const SkBitmap &bitmap = mCanvas->getDevice()->accessBitmap(false);
+ if (!bitmap.lockPixelsAreWritable()) {
+ return false;
+ }
+
+ MarkChanged();
+
+ bitmap.lockPixels();
+ *aData = reinterpret_cast<uint8_t*>(bitmap.getPixels());
+ *aSize = IntSize(bitmap.width(), bitmap.height());
+ *aStride = int32_t(bitmap.rowBytes());
+ *aFormat = SkiaColorTypeToGfxFormat(bitmap.colorType());
+ return true;
+}
+
+void
+DrawTargetSkia::ReleaseBits(uint8_t* aData)
+{
+ const SkBitmap &bitmap = mCanvas->getDevice()->accessBitmap(false);
+ MOZ_ASSERT(bitmap.lockPixelsAreWritable());
+
+ bitmap.unlockPixels();
+ bitmap.notifyPixelsChanged();
+}
+
static void
SetPaintPattern(SkPaint& aPaint, const Pattern& aPattern, TempBitmap& aTmpBitmap,
Float aAlpha = 1.0)
@@ -688,10 +717,10 @@ DrawTargetSkia::CreateSourceSurfaceFromN
cairo_surface_t* surf = static_cast<cairo_surface_t*>(aSurface.mSurface);
return new SourceSurfaceCairo(surf, aSurface.mSize, aSurface.mFormat);
#if USE_SKIA_GPU
- } else if (aSurface.mType == NativeSurfaceType::OPENGL_TEXTURE) {
+ } else if (aSurface.mType == NativeSurfaceType::OPENGL_TEXTURE && UsingSkiaGPU()) {
RefPtr<SourceSurfaceSkia> newSurf = new SourceSurfaceSkia();
unsigned int texture = (unsigned int)((uintptr_t)aSurface.mSurface);
- if (UsingSkiaGPU() && newSurf->InitFromTexture((DrawTargetSkia*)this, texture, aSurface.mSize, aSurface.mFormat)) {
+ if (newSurf->InitFromTexture((DrawTargetSkia*)this, texture, aSurface.mSize, aSurface.mFormat)) {
return newSurf;
}
return nullptr;
diff -up firefox-40.0/mozilla-release/gfx/2d/DrawTargetSkia.h.1127752 firefox-40.0/mozilla-release/gfx/2d/DrawTargetSkia.h
--- firefox-40.0/mozilla-release/gfx/2d/DrawTargetSkia.h.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/gfx/2d/DrawTargetSkia.h 2015-08-26 14:07:24.667087889 +0200
@@ -36,6 +36,9 @@ public:
virtual BackendType GetBackendType() const override { return BackendType::SKIA; }
virtual TemporaryRef<SourceSurface> Snapshot() override;
virtual IntSize GetSize() override { return mSize; }
+ virtual bool LockBits(uint8_t** aData, IntSize* aSize,
+ int32_t* aStride, SurfaceFormat* aFormat) override;
+ virtual void ReleaseBits(uint8_t* aData) override;
virtual void Flush() override;
virtual void DrawSurface(SourceSurface *aSurface,
const Rect &aDest,
diff -up firefox-40.0/mozilla-release/gfx/2d/moz.build.1127752 firefox-40.0/mozilla-release/gfx/2d/moz.build
--- firefox-40.0/mozilla-release/gfx/2d/moz.build.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/gfx/2d/moz.build 2015-08-26 14:07:24.667087889 +0200
@@ -79,6 +79,7 @@ if CONFIG['MOZ_ENABLE_SKIA']:
'image_operations.cpp', # Uses _USE_MATH_DEFINES
]
EXPORTS.mozilla.gfx += [
+ 'HelpersCairo.h',
'HelpersSkia.h',
]
diff -up firefox-40.0/mozilla-release/gfx/layers/basic/BasicCompositor.cpp.1127752 firefox-40.0/mozilla-release/gfx/layers/basic/BasicCompositor.cpp
--- firefox-40.0/mozilla-release/gfx/layers/basic/BasicCompositor.cpp.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/gfx/layers/basic/BasicCompositor.cpp 2015-08-26 14:07:24.667087889 +0200
@@ -523,7 +523,7 @@ BasicCompositor::BeginFrame(const nsIntR
RefPtr<CompositingRenderTarget> target = CreateRenderTarget(mInvalidRect, INIT_MODE_CLEAR);
if (!target) {
if (!mTarget) {
- mWidget->EndRemoteDrawing();
+ mWidget->EndRemoteDrawingInRegion(mDrawTarget, mInvalidRegion);
}
return;
}
@@ -585,7 +585,7 @@ BasicCompositor::EndFrame()
IntPoint(r->x - offset.x, r->y - offset.y));
}
if (!mTarget) {
- mWidget->EndRemoteDrawing();
+ mWidget->EndRemoteDrawingInRegion(mDrawTarget, mInvalidRegion);
}
mDrawTarget = nullptr;
diff -up firefox-40.0/mozilla-release/gfx/src/nsRegion.h.1127752 firefox-40.0/mozilla-release/gfx/src/nsRegion.h
--- firefox-40.0/mozilla-release/gfx/src/nsRegion.h.1127752 2015-08-07 17:54:05.000000000 +0200
+++ firefox-40.0/mozilla-release/gfx/src/nsRegion.h 2015-08-26 14:07:24.667087889 +0200
@@ -715,6 +715,12 @@ public:
return This();
}
+ Derived& ScaleInverseRoundOut (float aXScale, float aYScale)
+ {
+ mImpl.ScaleInverseRoundOut(aXScale, aYScale);
+ return This();
+ }
+
Derived& Transform (const gfx3DMatrix &aTransform)
{
mImpl.Transform(aTransform);
diff -up firefox-40.0/mozilla-release/gfx/thebes/gfxContext.cpp.1127752 firefox-40.0/mozilla-release/gfx/thebes/gfxContext.cpp
--- firefox-40.0/mozilla-release/gfx/thebes/gfxContext.cpp.1127752 2015-08-07 17:54:05.000000000 +0200
+++ firefox-40.0/mozilla-release/gfx/thebes/gfxContext.cpp 2015-08-26 14:07:24.668087868 +0200
@@ -619,6 +619,23 @@ gfxContext::GetClipExtents()
}
bool
+gfxContext::HasComplexClip() const
+{
+ for (int i = mStateStack.Length() - 1; i >= 0; i--) {
+ for (unsigned int c = 0; c < mStateStack[i].pushedClips.Length(); c++) {
+ const AzureState::PushedClip &clip = mStateStack[i].pushedClips[c];
+ if (clip.path || !clip.transform.IsRectilinear()) {
+ return true;
+ }
+ }
+ if (mStateStack[i].clipWasReset) {
+ break;
+ }
+ }
+ return false;
+}
+
+bool
gfxContext::ClipContainsRect(const gfxRect& aRect)
{
unsigned int lastReset = 0;
diff -up firefox-40.0/mozilla-release/gfx/thebes/gfxContext.h.1127752 firefox-40.0/mozilla-release/gfx/thebes/gfxContext.h
--- firefox-40.0/mozilla-release/gfx/thebes/gfxContext.h.1127752 2015-08-07 17:54:05.000000000 +0200
+++ firefox-40.0/mozilla-release/gfx/thebes/gfxContext.h 2015-08-26 14:07:24.668087868 +0200
@@ -446,6 +446,11 @@ public:
gfxRect GetClipExtents();
/**
+ * Whether the current clip is not a simple rectangle.
+ */
+ bool HasComplexClip() const;
+
+ /**
* Returns true if the given rectangle is fully contained in the current clip.
* This is conservative; it may return false even when the given rectangle is
* fully contained by the current clip.
diff -up firefox-40.0/mozilla-release/widget/gtk/nsNativeThemeGTK.cpp.1127752 firefox-40.0/mozilla-release/widget/gtk/nsNativeThemeGTK.cpp
--- firefox-40.0/mozilla-release/widget/gtk/nsNativeThemeGTK.cpp.1127752 2015-08-26 14:07:24.657088105 +0200
+++ firefox-40.0/mozilla-release/widget/gtk/nsNativeThemeGTK.cpp 2015-08-26 14:07:24.669087846 +0200
@@ -33,6 +33,18 @@
#include "gfxContext.h"
#include "gfxPlatformGtk.h"
#include "gfxGdkNativeRenderer.h"
+#include "mozilla/gfx/BorrowedContext.h"
+#include "mozilla/gfx/HelpersCairo.h"
+
+#ifdef MOZ_X11
+# ifdef CAIRO_HAS_XLIB_SURFACE
+# include "cairo-xlib.h"
+# endif
+# ifdef CAIRO_HAS_XLIB_XRENDER_SURFACE
+# include "cairo-xlib-xrender.h"
+# endif
+#endif
+
#include <algorithm>
#include <dlfcn.h>
@@ -706,6 +718,158 @@ ThemeRenderer::DrawWithGDK(GdkDrawable *
return NS_OK;
}
+#else
+static void
+DrawThemeWithCairo(gfxContext* aContext, DrawTarget* aDrawTarget,
+ GtkWidgetState aState, GtkThemeWidgetType aGTKWidgetType,
+ gint aFlags, GtkTextDirection aDirection, gint aScaleFactor,
+ bool aSnapped, const Point& aDrawOrigin, const nsIntSize& aDrawSize,
+ GdkRectangle& aGDKRect, nsITheme::Transparency aTransparency)
+{
+#ifndef MOZ_TREE_CAIRO
+ // Directly use the Cairo draw target to render the widget if using system Cairo everywhere.
+ BorrowedCairoContext borrow(aDrawTarget);
+ if (borrow.mCairo) {
+ if (aSnapped) {
+ cairo_identity_matrix(borrow.mCairo);
+ }
+ if (aDrawOrigin != Point(0, 0)) {
+ cairo_translate(borrow.mCairo, aDrawOrigin.x, aDrawOrigin.y);
+ }
+ if (aScaleFactor != 1) {
+ cairo_scale(borrow.mCairo, aScaleFactor, aScaleFactor);
+ }
+
+ moz_gtk_widget_paint(aGTKWidgetType, borrow.mCairo, &aGDKRect, &aState, aFlags, aDirection);
+
+ borrow.Finish();
+ return;
+ }
+#endif
+
+ // A direct Cairo draw target is not available, so we need to create a temporary one.
+ bool needClip = !aSnapped || aContext->HasComplexClip();
+#if defined(MOZ_X11) && defined(CAIRO_HAS_XLIB_SURFACE)
+ if (!needClip) {
+ // If using a Cairo xlib surface, then try to reuse it.
+ BorrowedXlibDrawable borrow(aDrawTarget);
+ if (borrow.GetDrawable()) {
+ nsIntSize size = aDrawTarget->GetSize();
+ cairo_surface_t* surf = nullptr;
+ // Check if the surface is using XRender.
+#ifdef CAIRO_HAS_XLIB_XRENDER_SURFACE
+ if (borrow.GetXRenderFormat()) {
+ surf = cairo_xlib_surface_create_with_xrender_format(
+ borrow.GetDisplay(), borrow.GetDrawable(), borrow.GetScreen(),
+ borrow.GetXRenderFormat(), size.width, size.height);
+ } else {
+#else
+ if (! borrow.GetXRenderFormat()) {
+#endif
+ surf = cairo_xlib_surface_create(
+ borrow.GetDisplay(), borrow.GetDrawable(), borrow.GetVisual(),
+ size.width, size.height);
+ }
+ if (!NS_WARN_IF(!surf)) {
+ cairo_t* cr = cairo_create(surf);
+ if (!NS_WARN_IF(!cr)) {
+ cairo_new_path(cr);
+ cairo_rectangle(cr, aDrawOrigin.x, aDrawOrigin.y, aDrawSize.width, aDrawSize.height);
+ cairo_clip(cr);
+ if (aDrawOrigin != Point(0, 0)) {
+ cairo_translate(cr, aDrawOrigin.x, aDrawOrigin.y);
+ }
+ if (aScaleFactor != 1) {
+ cairo_scale(cr, aScaleFactor, aScaleFactor);
+ }
+
+ moz_gtk_widget_paint(aGTKWidgetType, cr, &aGDKRect, &aState, aFlags, aDirection);
+
+ cairo_destroy(cr);
+ }
+ cairo_surface_destroy(surf);
+ }
+ borrow.Finish();
+ return;
+ }
+ }
+#endif
+
+ // Check if the widget requires complex masking that must be composited.
+ // Try to directly write to the draw target's pixels if possible.
+ uint8_t* data;
+ nsIntSize size;
+ int32_t stride;
+ SurfaceFormat format;
+ if (!needClip && aDrawTarget->LockBits(&data, &size, &stride, &format)) {
+ // Create a Cairo image surface context the device rectangle.
+ cairo_surface_t* surf =
+ cairo_image_surface_create_for_data(
+ data + int32_t(aDrawOrigin.y) * stride + int32_t(aDrawOrigin.x) * BytesPerPixel(format),
+ GfxFormatToCairoFormat(format), aDrawSize.width, aDrawSize.height, stride);
+ if (!NS_WARN_IF(!surf)) {
+ cairo_t* cr = cairo_create(surf);
+ if (!NS_WARN_IF(!cr)) {
+ if (aScaleFactor != 1) {
+ cairo_scale(cr, aScaleFactor, aScaleFactor);
+ }
+
+ moz_gtk_widget_paint(aGTKWidgetType, cr, &aGDKRect, &aState, aFlags, aDirection);
+
+ cairo_destroy(cr);
+ }
+ cairo_surface_destroy(surf);
+ }
+ aDrawTarget->ReleaseBits(data);
+ } else {
+ // If the widget has any transparency, make sure to choose an alpha format.
+ format = aTransparency != nsITheme::eOpaque ? SurfaceFormat::B8G8R8A8 : aDrawTarget->GetFormat();
+ // Create a temporary data surface to render the widget into.
+ RefPtr<DataSourceSurface> dataSurface =
+ Factory::CreateDataSourceSurface(aDrawSize, format, aTransparency != nsITheme::eOpaque);
+ DataSourceSurface::MappedSurface map;
+ if (!NS_WARN_IF(!(dataSurface && dataSurface->Map(DataSourceSurface::MapType::WRITE, &map)))) {
+ // Create a Cairo image surface wrapping the data surface.
+ cairo_surface_t* surf =
+ cairo_image_surface_create_for_data(map.mData, GfxFormatToCairoFormat(format),
+ aDrawSize.width, aDrawSize.height, map.mStride);
+ cairo_t* cr = nullptr;
+ if (!NS_WARN_IF(!surf)) {
+ cr = cairo_create(surf);
+ if (!NS_WARN_IF(!cr)) {
+ if (aScaleFactor != 1) {
+ cairo_scale(cr, aScaleFactor, aScaleFactor);
+ }
+
+ moz_gtk_widget_paint(aGTKWidgetType, cr, &aGDKRect, &aState, aFlags, aDirection);
+ }
+ }
+
+ // Unmap the surface before using it as a source
+ dataSurface->Unmap();
+
+ if (cr) {
+ if (needClip || aTransparency != nsITheme::eOpaque) {
+ // The widget either needs to be masked or has transparency, so use the slower drawing path.
+ aDrawTarget->DrawSurface(dataSurface,
+ Rect(aDrawOrigin, Size(aDrawSize)),
+ Rect(0, 0, aDrawSize.width, aDrawSize.height));
+ } else {
+ // The widget is a simple opaque rectangle, so just copy it out.
+ aDrawTarget->CopySurface(dataSurface,
+ IntRect(0, 0, aDrawSize.width, aDrawSize.height),
+ TruncatedToInt(aDrawOrigin));
+ }
+
+ cairo_destroy(cr);
+ }
+
+ if (surf) {
+ cairo_surface_destroy(surf);
+ }
+ }
+ }
+}
#endif
bool
@@ -800,10 +964,6 @@ nsNativeThemeGTK::DrawWidgetBackground(n
const nsRect& aRect,
const nsRect& aDirtyRect)
{
-#if (MOZ_WIDGET_GTK != 2)
- DrawTarget& aDrawTarget = *aContext->GetDrawTarget();
-#endif
-
GtkWidgetState state;
GtkThemeWidgetType gtkWidgetType;
GtkTextDirection direction = GetTextDirection(aFrame);
@@ -823,8 +983,8 @@ nsNativeThemeGTK::DrawWidgetBackground(n
// to provide crisper and faster drawing.
// Don't snap if it's a non-unit scale factor. We're going to have to take
// slow paths then in any case.
- bool snapXY = ctx->UserToDevicePixelSnapped(rect);
- if (snapXY) {
+ bool snapped = ctx->UserToDevicePixelSnapped(rect);
+ if (snapped) {
// Leave rect in device coords but make dirtyRect consistent.
dirtyRect = ctx->UserToDevice(dirtyRect);
}
@@ -853,23 +1013,6 @@ nsNativeThemeGTK::DrawWidgetBackground(n
|| !drawingRect.IntersectRect(overflowRect, drawingRect))
return NS_OK;
- // gdk rectangles are wrt the drawing rect.
-
- GdkRectangle gdk_rect = {-drawingRect.x/scaleFactor,
- -drawingRect.y/scaleFactor,
- widgetRect.width/scaleFactor,
- widgetRect.height/scaleFactor};
-
- // translate everything so (0,0) is the top left of the drawingRect
- gfxContextAutoSaveRestore autoSR(ctx);
- gfxMatrix tm;
- if (!snapXY) { // else rects are in device coords
- tm = ctx->CurrentMatrix();
- }
- tm.Translate(rect.TopLeft() + gfxPoint(drawingRect.x, drawingRect.y));
- tm.Scale(scaleFactor, scaleFactor); // Draw in GDK coords
- ctx->SetMatrix(tm);
-
NS_ASSERTION(!IsWidgetTypeDisabled(mDisabledWidgetTypes, aWidgetType),
"Trying to render an unsafe widget!");
@@ -879,7 +1022,27 @@ nsNativeThemeGTK::DrawWidgetBackground(n
gdk_error_trap_push ();
}
+ Transparency transparency = GetWidgetTransparency(aFrame, aWidgetType);
+
+ // gdk rectangles are wrt the drawing rect.
+ GdkRectangle gdk_rect = {-drawingRect.x/scaleFactor,
+ -drawingRect.y/scaleFactor,
+ widgetRect.width/scaleFactor,
+ widgetRect.height/scaleFactor};
+
+ // translate everything so (0,0) is the top left of the drawingRect
+ gfxPoint origin = rect.TopLeft() + drawingRect.TopLeft();
+
#if (MOZ_WIDGET_GTK == 2)
+ gfxContextAutoSaveRestore autoSR(ctx);
+ gfxMatrix matrix;
+ if (!snapped) { // else rects are in device coords
+ matrix = ctx->CurrentMatrix();
+ }
+ matrix.Translate(origin);
+ matrix.Scale(scaleFactor, scaleFactor); // Draw in GDK coords
+ ctx->SetMatrix(matrix);
+
// The gdk_clip is just advisory here, meaning "you don't
// need to draw outside this rect if you don't feel like it!"
GdkRectangle gdk_clip = {0, 0, drawingRect.width, drawingRect.height};
@@ -891,7 +1054,7 @@ nsNativeThemeGTK::DrawWidgetBackground(n
// clip rect we provide, so we cannot advertise support for clipping within
// the widget bounds.
uint32_t rendererFlags = 0;
- if (GetWidgetTransparency(aFrame, aWidgetType) == eOpaque) {
+ if (transparency == eOpaque) {
rendererFlags |= gfxGdkNativeRenderer::DRAW_IS_OPAQUE;
}
@@ -901,11 +1064,10 @@ nsNativeThemeGTK::DrawWidgetBackground(n
renderer.Draw(ctx, drawingRect.Size(), rendererFlags, colormap);
#else
- cairo_t *cairo_ctx =
- (cairo_t*)aDrawTarget.GetNativeSurface(NativeSurfaceType::CAIRO_CONTEXT);
- MOZ_ASSERT(cairo_ctx);
- moz_gtk_widget_paint(gtkWidgetType, cairo_ctx, &gdk_rect,
- &state, flags, direction);
+ DrawThemeWithCairo(ctx, aContext->GetDrawTarget(),
+ state, gtkWidgetType, flags, direction, scaleFactor,
+ snapped, ToPoint(origin), drawingRect.Size(),
+ gdk_rect, transparency);
#endif
if (!safeState) {
diff -up firefox-40.0/mozilla-release/widget/gtk/nsScreenGtk.cpp.1127752 firefox-40.0/mozilla-release/widget/gtk/nsScreenGtk.cpp
--- firefox-40.0/mozilla-release/widget/gtk/nsScreenGtk.cpp.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/widget/gtk/nsScreenGtk.cpp 2015-08-26 14:07:24.669087846 +0200
@@ -12,6 +12,7 @@
#endif
#include <gtk/gtk.h>
#include <dlfcn.h>
+#include "gfxPlatformGtk.h"
static uint32_t sScreenId = 0;
diff -up firefox-40.0/mozilla-release/widget/gtk/nsWindow.cpp.1127752 firefox-40.0/mozilla-release/widget/gtk/nsWindow.cpp
--- firefox-40.0/mozilla-release/widget/gtk/nsWindow.cpp.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/widget/gtk/nsWindow.cpp 2015-08-26 14:07:24.670087825 +0200
@@ -2050,71 +2050,52 @@ gdk_window_flash(GdkWindow * aGdkWind
#endif // DEBUG
#endif
-struct ExposeRegion
-{
- nsIntRegion mRegion;
-
#if (MOZ_WIDGET_GTK == 2)
- GdkRectangle *mRects;
- GdkRectangle *mRectsEnd;
-
- ExposeRegion() : mRects(nullptr)
- {
- }
- ~ExposeRegion()
- {
- g_free(mRects);
- }
- bool Init(GdkEventExpose *aEvent)
- {
- gint nrects;
- gdk_region_get_rectangles(aEvent->region, &mRects, &nrects);
-
- if (nrects > MAX_RECTS_IN_REGION) {
- // Just use the bounding box
- mRects[0] = aEvent->area;
- nrects = 1;
- }
+static bool
+ExtractExposeRegion(nsIntRegion& aRegion, GdkEventExpose* aEvent)
+{
+ GdkRectangle* rects;
+ gint nrects;
+ gdk_region_get_rectangles(aEvent->region, &rects, &nrects);
+
+ if (nrects > MAX_RECTS_IN_REGION) {
+ // Just use the bounding box
+ rects[0] = aEvent->area;
+ nrects = 1;
+ }
- mRectsEnd = mRects + nrects;
+ for (GdkRectangle* r = rects; r < rects + nrects; r++) {
+ aRegion.Or(aRegion, nsIntRect(r->x, r->y, r->width, r->height));
+ LOGDRAW(("\t%d %d %d %d\n", r->x, r->y, r->width, r->height));
+ }
- for (GdkRectangle *r = mRects; r < mRectsEnd; r++) {
- mRegion.Or(mRegion, nsIntRect(r->x, r->y, r->width, r->height));
- LOGDRAW(("\t%d %d %d %d\n", r->x, r->y, r->width, r->height));
- }
- return true;
- }
+ g_free(rects);
+ return true;
+}
#else
# ifdef cairo_copy_clip_rectangle_list
# error "Looks like we're including Mozilla's cairo instead of system cairo"
# endif
- cairo_rectangle_list_t *mRects;
+static bool
+ExtractExposeRegion(nsIntRegion& aRegion, cairo_t* cr)
+{
+ cairo_rectangle_list_t* rects = cairo_copy_clip_rectangle_list(cr);
+ if (rects->status != CAIRO_STATUS_SUCCESS) {
+ NS_WARNING("Failed to obtain cairo rectangle list.");
+ return false;
+ }
- ExposeRegion() : mRects(nullptr)
- {
- }
- ~ExposeRegion()
- {
- cairo_rectangle_list_destroy(mRects);
- }
- bool Init(cairo_t* cr)
- {
- mRects = cairo_copy_clip_rectangle_list(cr);
- if (mRects->status != CAIRO_STATUS_SUCCESS) {
- NS_WARNING("Failed to obtain cairo rectangle list.");
- return false;
- }
+ for (int i = 0; i < rects->num_rectangles; i++) {
+ const cairo_rectangle_t& r = rects->rectangles[i];
+ aRegion.Or(aRegion, nsIntRect(r.x, r.y, r.width, r.height));
+ LOGDRAW(("\t%d %d %d %d\n", r.x, r.y, r.width, r.height));
+ }
- for (int i = 0; i < mRects->num_rectangles; i++) {
- const cairo_rectangle_t& r = mRects->rectangles[i];
- mRegion.Or(mRegion, nsIntRect(r.x, r.y, r.width, r.height));
- LOGDRAW(("\t%d %d %d %d\n", r.x, r.y, r.width, r.height));
- }
- return true;
- }
+ cairo_rectangle_list_destroy(rects);
+ return true;
+}
#endif
-};
#if (MOZ_WIDGET_GTK == 2)
gboolean
@@ -2137,17 +2118,17 @@ nsWindow::OnExposeEvent(cairo_t *cr)
if (!listener)
return FALSE;
- ExposeRegion exposeRegion;
+ nsIntRegion exposeRegion;
#if (MOZ_WIDGET_GTK == 2)
- if (!exposeRegion.Init(aEvent)) {
+ if (!ExtractExposeRegion(exposeRegion, aEvent)) {
#else
- if (!exposeRegion.Init(cr)) {
+ if (!ExtractExposeRegion(exposeRegion, cr)) {
#endif
return FALSE;
}
gint scale = GdkScaleFactor();
- nsIntRegion& region = exposeRegion.mRegion;
+ nsIntRegion region = exposeRegion;
region.ScaleRoundOut(scale, scale);
ClientLayerManager *clientLayers =
@@ -2240,33 +2221,11 @@ nsWindow::OnExposeEvent(cairo_t *cr)
return TRUE;
}
- gfxASurface* surf;
-#if (MOZ_WIDGET_GTK == 2)
- surf = GetThebesSurface();
-#else
- surf = GetThebesSurface(cr);
-#endif
-
- nsRefPtr<gfxContext> ctx;
- if (gfxPlatform::GetPlatform()->
- SupportsAzureContentForType(BackendType::CAIRO)) {
- IntSize intSize(surf->GetSize().width, surf->GetSize().height);
- RefPtr<DrawTarget> dt =
- gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surf, intSize);
- ctx = new gfxContext(dt);
- } else if (gfxPlatform::GetPlatform()->
- SupportsAzureContentForType(BackendType::SKIA) &&
- surf->GetType() == gfxSurfaceType::Image) {
- gfxImageSurface* imgSurf = static_cast<gfxImageSurface*>(surf);
- SurfaceFormat format = ImageFormatToSurfaceFormat(imgSurf->Format());
- IntSize intSize(surf->GetSize().width, surf->GetSize().height);
- RefPtr<DrawTarget> dt =
- gfxPlatform::GetPlatform()->CreateDrawTargetForData(
- imgSurf->Data(), intSize, imgSurf->Stride(), format);
- ctx = new gfxContext(dt);
- } else {
- MOZ_CRASH("Unexpected content type");
+ RefPtr<DrawTarget> dt = StartRemoteDrawing();
+ if(!dt) {
+ return FALSE;
}
+ nsRefPtr<gfxContext> ctx = new gfxContext(dt);
#ifdef MOZ_X11
nsIntRect boundsRect; // for shaped only
@@ -2341,11 +2300,7 @@ nsWindow::OnExposeEvent(cairo_t *cr)
}
# ifdef MOZ_HAVE_SHMIMAGE
if (mShmImage && MOZ_LIKELY(!mIsDestroyed)) {
-#if (MOZ_WIDGET_GTK == 2)
- mShmImage->Put(mGdkWindow, exposeRegion.mRects, exposeRegion.mRectsEnd);
-#else
- mShmImage->Put(mGdkWindow, exposeRegion.mRects);
-#endif
+ mShmImage->Put(mGdkWindow, exposeRegion);
}
# endif // MOZ_HAVE_SHMIMAGE
#endif // MOZ_X11
@@ -6262,24 +6217,49 @@ nsWindow::StartRemoteDrawing()
return nullptr;
}
- IntSize size(surf->GetSize().width, surf->GetSize().height);
+ nsIntSize size = surf->GetSize();
if (size.width <= 0 || size.height <= 0) {
return nullptr;
}
- return gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surf, size);
+ gfxPlatform *platform = gfxPlatform::GetPlatform();
+ if (platform->SupportsAzureContentForType(BackendType::CAIRO) ||
+ surf->GetType() == gfxSurfaceType::Xlib) {
+ return platform->CreateDrawTargetForSurface(surf, size);
+ } else if (platform->SupportsAzureContentForType(BackendType::SKIA) &&
+ surf->GetType() == gfxSurfaceType::Image) {
+ gfxImageSurface* imgSurf = static_cast<gfxImageSurface*>(surf);
+ SurfaceFormat format = ImageFormatToSurfaceFormat(imgSurf->Format());
+ return platform->CreateDrawTargetForData(
+ imgSurf->Data(), size, imgSurf->Stride(), format);
+ } else {
+ return nullptr;
+ }
}
-// return the gfxASurface for rendering to this widget
-gfxASurface*
-nsWindow::GetThebesSurface()
-#if (MOZ_WIDGET_GTK == 3)
+void
+nsWindow::EndRemoteDrawingInRegion(DrawTarget* aDrawTarget, nsIntRegion& aInvalidRegion)
{
- return GetThebesSurface(nullptr);
+#ifdef MOZ_X11
+# ifdef MOZ_HAVE_SHMIMAGE
+ if (!mGdkWindow || mIsFullyObscured || !mHasMappedToplevel || mIsDestroyed ||
+ !mShmImage)
+ return;
+
+ gint scale = GdkScaleFactor();
+ if (scale != 1) {
+ aInvalidRegion.ScaleInverseRoundOut(scale, scale);
+ }
+
+ mShmImage->Put(mGdkWindow, aInvalidRegion);
+
+# endif // MOZ_HAVE_SHMIMAGE
+#endif // MOZ_X11
}
+
+// return the gfxASurface for rendering to this widget
gfxASurface*
-nsWindow::GetThebesSurface(cairo_t *cr)
-#endif
+nsWindow::GetThebesSurface()
{
if (!mGdkWindow)
return nullptr;
diff -up firefox-40.0/mozilla-release/widget/gtk/nsWindow.h.1127752 firefox-40.0/mozilla-release/widget/gtk/nsWindow.h
--- firefox-40.0/mozilla-release/widget/gtk/nsWindow.h.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/widget/gtk/nsWindow.h 2015-08-26 14:07:24.671087803 +0200
@@ -194,7 +194,10 @@ public:
guint aTime,
gpointer aData);
- mozilla::TemporaryRef<mozilla::gfx::DrawTarget> StartRemoteDrawing() override;
+ virtual mozilla::TemporaryRef<mozilla::gfx::DrawTarget>
+ StartRemoteDrawing() override;
+ virtual void EndRemoteDrawingInRegion(mozilla::gfx::DrawTarget* aDrawTarget,
+ nsIntRegion& aInvalidRegion) override;
private:
void UpdateAlpha(gfxPattern* aPattern, nsIntRect aBoundsRect);
@@ -467,9 +470,6 @@ private:
LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
bool* aAllowRetaining = nullptr) override;
-#if (MOZ_WIDGET_GTK == 3)
- gfxASurface* GetThebesSurface(cairo_t *cr);
-#endif
void CleanLayerManagerRecursive();
diff -up firefox-40.0/mozilla-release/widget/nsIWidget.h.1127752 firefox-40.0/mozilla-release/widget/nsIWidget.h
--- firefox-40.0/mozilla-release/widget/nsIWidget.h.1127752 2015-08-26 14:07:24.671087803 +0200
+++ firefox-40.0/mozilla-release/widget/nsIWidget.h 2015-08-26 14:07:59.529337002 +0200
@@ -1657,6 +1657,9 @@ class nsIWidget : public nsISupports {
* after each composition.
*/
virtual void EndRemoteDrawing() = 0;
+ virtual void EndRemoteDrawingInRegion(mozilla::gfx::DrawTarget* aDrawTarget, nsIntRegion& aInvalidRegion) {
+ EndRemoteDrawing();
+ }
/**
* A hook for the widget to prepare a Compositor, during the latter's initialization.
diff -up firefox-40.0/mozilla-release/widget/nsShmImage.cpp.1127752 firefox-40.0/mozilla-release/widget/nsShmImage.cpp
--- firefox-40.0/mozilla-release/widget/nsShmImage.cpp.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/widget/nsShmImage.cpp 2015-08-26 14:07:24.672087781 +0200
@@ -121,7 +121,7 @@ nsShmImage::AsSurface()
#if (MOZ_WIDGET_GTK == 2)
void
-nsShmImage::Put(GdkWindow* aWindow, GdkRectangle* aRects, GdkRectangle* aEnd)
+nsShmImage::Put(GdkWindow* aWindow, const nsIntRegion& aRegion)
{
GdkDrawable* gd;
gint dx, dy;
@@ -131,7 +131,8 @@ nsShmImage::Put(GdkWindow* aWindow, GdkR
Drawable d = GDK_DRAWABLE_XID(gd);
GC gc = XCreateGC(dpy, d, 0, nullptr);
- for (GdkRectangle* r = aRects; r < aEnd; r++) {
+ nsIntRegionRectIterator iter(aRegion);
+ for (const nsIntRect *r = iter.Next(); r; r = iter.Next()) {
XShmPutImage(dpy, d, gc, mImage,
r->x, r->y,
r->x - dx, r->y - dy,
@@ -151,20 +152,19 @@ nsShmImage::Put(GdkWindow* aWindow, GdkR
#elif (MOZ_WIDGET_GTK == 3)
void
-nsShmImage::Put(GdkWindow* aWindow, cairo_rectangle_list_t* aRects)
+nsShmImage::Put(GdkWindow* aWindow, const nsIntRegion& aRegion)
{
Display* dpy = gdk_x11_get_default_xdisplay();
Drawable d = GDK_WINDOW_XID(aWindow);
int dx = 0, dy = 0;
GC gc = XCreateGC(dpy, d, 0, nullptr);
- cairo_rectangle_t r;
- for (int i = 0; i < aRects->num_rectangles; i++) {
- r = aRects->rectangles[i];
+ nsIntRegionRectIterator iter(aRegion);
+ for (const nsIntRect *r = iter.Next(); r; r = iter.Next()) {
XShmPutImage(dpy, d, gc, mImage,
- r.x, r.y,
- r.x - dx, r.y - dy,
- r.width, r.height,
+ r->x, r->y,
+ r->x - dx, r->y - dy,
+ r->width, r->height,
False);
}
diff -up firefox-40.0/mozilla-release/widget/nsShmImage.h.1127752 firefox-40.0/mozilla-release/widget/nsShmImage.h
--- firefox-40.0/mozilla-release/widget/nsShmImage.h.1127752 2015-08-07 17:54:22.000000000 +0200
+++ firefox-40.0/mozilla-release/widget/nsShmImage.h 2015-08-26 14:07:24.672087781 +0200
@@ -63,10 +63,8 @@ private:
public:
already_AddRefed<gfxASurface> AsSurface();
-#if (MOZ_WIDGET_GTK == 2)
- void Put(GdkWindow* aWindow, GdkRectangle* aRects, GdkRectangle* aEnd);
-#elif (MOZ_WIDGET_GTK == 3)
- void Put(GdkWindow* aWindow, cairo_rectangle_list_t* aRects);
+#ifdef MOZ_WIDGET_GTK
+ void Put(GdkWindow* aWindow, const nsIntRegion& aRegion);
#elif defined(MOZ_WIDGET_QT)
void Put(QWindow* aWindow, QRect& aRect);
#endif

View File

@ -1,423 +0,0 @@
diff -up mozilla-release/toolkit/mozapps/downloads/nsHelperAppDlg.js.1129873-apppicker mozilla-release/toolkit/mozapps/downloads/nsHelperAppDlg.js
--- mozilla-release/toolkit/mozapps/downloads/nsHelperAppDlg.js.1129873-apppicker 2015-05-25 23:28:55.000000000 +0200
+++ mozilla-release/toolkit/mozapps/downloads/nsHelperAppDlg.js 2015-06-09 09:37:35.313305562 +0200
@@ -1004,6 +1004,34 @@ nsUnknownContentTypeDialog.prototype = {
return file.leafName;
},
+ finishChooseApp: function() {
+ if (this.chosenApp) {
+ // Show the "handler" menulist since we have a (user-specified)
+ // application now.
+ this.dialogElement("modeDeck").setAttribute("selectedIndex", "0");
+
+ // Update dialog.
+ var otherHandler = this.dialogElement("otherHandler");
+ otherHandler.removeAttribute("hidden");
+ otherHandler.setAttribute("path", this.getPath(this.chosenApp.executable));
+#ifdef XP_WIN
+ otherHandler.label = this.getFileDisplayName(this.chosenApp.executable);
+#else
+ otherHandler.label = this.chosenApp.name;
+#endif
+ this.dialogElement("openHandler").selectedIndex = 1;
+ this.dialogElement("openHandler").setAttribute("lastSelectedItemID", "otherHandler");
+
+ this.dialogElement("mode").selectedItem = this.dialogElement("open");
+ }
+ else {
+ var openHandler = this.dialogElement("openHandler");
+ var lastSelectedID = openHandler.getAttribute("lastSelectedItemID");
+ if (!lastSelectedID)
+ lastSelectedID = "defaultHandler";
+ openHandler.selectedItem = this.dialogElement(lastSelectedID);
+ }
+ },
// chooseApp: Open file picker and prompt user for application.
chooseApp: function() {
#ifdef XP_WIN
@@ -1047,7 +1075,23 @@ nsUnknownContentTypeDialog.prototype = {
params.handlerApp.executable.isFile()) {
// Remember the file they chose to run.
this.chosenApp = params.handlerApp;
-
+ }
+#else
+#if MOZ_WIDGET_GTK == 3
+ var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser;
+ var appChooser = Components.classes["@mozilla.org/applicationchooser;1"]
+ .createInstance(nsIApplicationChooser);
+ appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle"));
+ var contentTypeDialogObj = this;
+ let appChooserCallback = function appChooserCallback_done(aResult) {
+ if (aResult) {
+ contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp);
+ }
+ contentTypeDialogObj.finishChooseApp();
+ };
+ appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
+ // The finishChooseApp is called from appChooserCallback
+ return;
#else
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"]
@@ -1065,29 +1109,11 @@ nsUnknownContentTypeDialog.prototype = {
createInstance(Components.interfaces.nsILocalHandlerApp);
localHandlerApp.executable = fp.file;
this.chosenApp = localHandlerApp;
-#endif
-
- // Show the "handler" menulist since we have a (user-specified)
- // application now.
- this.dialogElement("modeDeck").setAttribute("selectedIndex", "0");
-
- // Update dialog.
- var otherHandler = this.dialogElement("otherHandler");
- otherHandler.removeAttribute("hidden");
- otherHandler.setAttribute("path", this.getPath(this.chosenApp.executable));
- otherHandler.label = this.getFileDisplayName(this.chosenApp.executable);
- this.dialogElement("openHandler").selectedIndex = 1;
- this.dialogElement("openHandler").setAttribute("lastSelectedItemID", "otherHandler");
-
- this.dialogElement("mode").selectedItem = this.dialogElement("open");
- }
- else {
- var openHandler = this.dialogElement("openHandler");
- var lastSelectedID = openHandler.getAttribute("lastSelectedItemID");
- if (!lastSelectedID)
- lastSelectedID = "defaultHandler";
- openHandler.selectedItem = this.dialogElement(lastSelectedID);
}
+#endif // MOZ_WIDGET_GTK3
+
+#endif // XP_WIN
+ this.finishChooseApp();
},
// Turn this on to get debugging messages.
diff -up mozilla-release/widget/gtk/moz.build.1129873-apppicker mozilla-release/widget/gtk/moz.build
--- mozilla-release/widget/gtk/moz.build.1129873-apppicker 2015-05-25 23:28:56.000000000 +0200
+++ mozilla-release/widget/gtk/moz.build 2015-06-09 09:37:35.313305562 +0200
@@ -74,6 +74,7 @@ if CONFIG['MOZ_ENABLE_GTK2']:
else:
UNIFIED_SOURCES += [
'gtk3drawing.c',
+ 'nsApplicationChooser.cpp',
]
include('/ipc/chromium/chromium-config.mozbuild')
diff -up mozilla-release/widget/gtk/mozgtk/mozgtk.c.1129873-apppicker mozilla-release/widget/gtk/mozgtk/mozgtk.c
--- mozilla-release/widget/gtk/mozgtk/mozgtk.c.1129873-apppicker 2015-05-25 23:28:56.000000000 +0200
+++ mozilla-release/widget/gtk/mozgtk/mozgtk.c 2015-06-09 09:37:35.313305562 +0200
@@ -533,6 +533,11 @@ STUB(gtk_widget_get_style_context)
STUB(gtk_widget_path_append_type)
STUB(gtk_widget_path_new)
STUB(gtk_widget_set_visual)
+STUB(gtk_app_chooser_dialog_new_for_content_type)
+STUB(gtk_app_chooser_get_type)
+STUB(gtk_app_chooser_get_app_info)
+STUB(gtk_app_chooser_dialog_get_type)
+STUB(gtk_app_chooser_dialog_set_heading)
#endif
#ifdef GTK2_SYMBOLS
diff -up mozilla-release/widget/gtk/nsApplicationChooser.cpp.1129873-apppicker mozilla-release/widget/gtk/nsApplicationChooser.cpp
--- mozilla-release/widget/gtk/nsApplicationChooser.cpp.1129873-apppicker 2015-06-09 09:37:35.314305558 +0200
+++ mozilla-release/widget/gtk/nsApplicationChooser.cpp 2015-06-09 09:37:35.313305562 +0200
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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/. */
+
+#include "mozilla/Types.h"
+
+#include <gtk/gtk.h>
+
+#include "nsApplicationChooser.h"
+#include "WidgetUtils.h"
+#include "nsIMIMEInfo.h"
+#include "nsCExternalHandlerService.h"
+#include "nsGtkUtils.h"
+
+using namespace mozilla;
+
+NS_IMPL_ISUPPORTS(nsApplicationChooser, nsIApplicationChooser)
+
+nsApplicationChooser::nsApplicationChooser()
+{
+}
+
+nsApplicationChooser::~nsApplicationChooser()
+{
+}
+
+NS_IMETHODIMP
+nsApplicationChooser::Init(nsIDOMWindow* aParent, const nsACString& aTitle)
+{
+ NS_ENSURE_TRUE(aParent, NS_ERROR_FAILURE);
+ mParentWidget = widget::WidgetUtils::DOMWindowToWidget(aParent);
+ mWindowTitle.Assign(aTitle);
+ return NS_OK;
+}
+
+NS_IMETHODIMP
+nsApplicationChooser::Open(const nsACString& aContentType, nsIApplicationChooserFinishedCallback *aCallback)
+{
+ MOZ_ASSERT(aCallback);
+ if (mCallback) {
+ NS_WARNING("Chooser is already in progress.");
+ return NS_ERROR_ALREADY_INITIALIZED;
+ }
+ mCallback = aCallback;
+ NS_ENSURE_TRUE(mParentWidget, NS_ERROR_FAILURE);
+ GtkWindow *parent_widget =
+ GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
+
+ GtkWidget* chooser =
+ gtk_app_chooser_dialog_new_for_content_type(parent_widget,
+ (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
+ PromiseFlatCString(aContentType).get());
+ gtk_app_chooser_dialog_set_heading(GTK_APP_CHOOSER_DIALOG(chooser), mWindowTitle.BeginReading());
+ NS_ADDREF_THIS();
+ g_signal_connect(chooser, "response", G_CALLBACK(OnResponse), this);
+ g_signal_connect(chooser, "destroy", G_CALLBACK(OnDestroy), this);
+ gtk_widget_show(chooser);
+ return NS_OK;
+}
+
+/* static */ void
+nsApplicationChooser::OnResponse(GtkWidget* chooser, gint response_id, gpointer user_data)
+{
+ static_cast<nsApplicationChooser*>(user_data)->Done(chooser, response_id);
+}
+
+/* static */ void
+nsApplicationChooser::OnDestroy(GtkWidget *chooser, gpointer user_data)
+{
+ static_cast<nsApplicationChooser*>(user_data)->Done(chooser, GTK_RESPONSE_CANCEL);
+}
+
+void nsApplicationChooser::Done(GtkWidget* chooser, gint response)
+{
+ nsCOMPtr<nsILocalHandlerApp> localHandler;
+ nsresult rv;
+ switch (response) {
+ case GTK_RESPONSE_OK:
+ case GTK_RESPONSE_ACCEPT:
+ {
+ localHandler = do_CreateInstance(NS_LOCALHANDLERAPP_CONTRACTID, &rv);
+ if (NS_FAILED(rv)) {
+ NS_WARNING("Out of memory.");
+ break;
+ }
+ GAppInfo *app_info = gtk_app_chooser_get_app_info(GTK_APP_CHOOSER(chooser));
+
+ nsCOMPtr<nsIFile> localExecutable;
+ gchar *fileWithFullPath = g_find_program_in_path(g_app_info_get_executable(app_info));
+ rv = NS_NewNativeLocalFile(nsDependentCString(fileWithFullPath), false, getter_AddRefs(localExecutable));
+ g_free(fileWithFullPath);
+ if (NS_FAILED(rv)) {
+ NS_WARNING("Cannot create local filename.");
+ localHandler = nullptr;
+ } else {
+ localHandler->SetExecutable(localExecutable);
+ localHandler->SetName(NS_ConvertUTF8toUTF16(g_app_info_get_display_name(app_info)));
+ }
+ g_object_unref(app_info);
+ }
+
+ break;
+ case GTK_RESPONSE_CANCEL:
+ case GTK_RESPONSE_CLOSE:
+ case GTK_RESPONSE_DELETE_EVENT:
+ break;
+ default:
+ NS_WARNING("Unexpected response");
+ break;
+ }
+
+ // A "response" signal won't be sent again but "destroy" will be.
+ g_signal_handlers_disconnect_by_func(chooser, FuncToGpointer(OnDestroy), this);
+ gtk_widget_destroy(chooser);
+
+ if (mCallback) {
+ mCallback->Done(localHandler);
+ mCallback = nullptr;
+ }
+ NS_RELEASE_THIS();
+}
+
diff -up mozilla-release/widget/gtk/nsApplicationChooser.h.1129873-apppicker mozilla-release/widget/gtk/nsApplicationChooser.h
--- mozilla-release/widget/gtk/nsApplicationChooser.h.1129873-apppicker 2015-06-09 09:37:35.314305558 +0200
+++ mozilla-release/widget/gtk/nsApplicationChooser.h 2015-06-09 09:37:35.314305558 +0200
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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/. */
+
+#ifndef nsApplicationChooser_h__
+#define nsApplicationChooser_h__
+
+#include <gtk/gtk.h>
+#include "nsIApplicationChooser.h"
+
+class nsApplicationChooser : public nsIApplicationChooser
+{
+public:
+ nsApplicationChooser();
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSIAPPLICATIONCHOOSER
+ void Done(GtkWidget* chooser, gint response);
+
+private:
+ ~nsApplicationChooser();
+ nsCOMPtr<nsIWidget> mParentWidget;
+ nsCString mWindowTitle;
+ nsCOMPtr<nsIApplicationChooserFinishedCallback> mCallback;
+ static void OnResponse(GtkWidget* chooser, gint response_id, gpointer user_data);
+ static void OnDestroy(GtkWidget* chooser, gpointer user_data);
+};
+#endif
diff -up mozilla-release/widget/gtk/nsWidgetFactory.cpp.1129873-apppicker mozilla-release/widget/gtk/nsWidgetFactory.cpp
--- mozilla-release/widget/gtk/nsWidgetFactory.cpp.1129873-apppicker 2015-05-25 23:28:56.000000000 +0200
+++ mozilla-release/widget/gtk/nsWidgetFactory.cpp 2015-06-09 09:37:35.314305558 +0200
@@ -21,6 +21,9 @@
#include "nsClipboard.h"
#include "nsDragService.h"
#endif
+#if (MOZ_WIDGET_GTK == 3)
+#include "nsApplicationChooser.h"
+#endif
#include "nsColorPicker.h"
#include "nsFilePicker.h"
#include "nsSound.h"
@@ -152,6 +155,25 @@ nsFilePickerConstructor(nsISupports *aOu
return picker->QueryInterface(aIID, aResult);
}
+#if (MOZ_WIDGET_GTK == 3)
+static nsresult
+nsApplicationChooserConstructor(nsISupports *aOuter, REFNSIID aIID,
+ void **aResult)
+{
+ *aResult = nullptr;
+ if (aOuter != nullptr) {
+ return NS_ERROR_NO_AGGREGATION;
+ }
+ nsCOMPtr<nsIApplicationChooser> chooser = new nsApplicationChooser;
+
+ if (!chooser) {
+ return NS_ERROR_OUT_OF_MEMORY;
+ }
+
+ return chooser->QueryInterface(aIID, aResult);
+}
+#endif
+
static nsresult
nsColorPickerConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult)
@@ -175,6 +197,9 @@ NS_DEFINE_NAMED_CID(NS_CHILD_CID);
NS_DEFINE_NAMED_CID(NS_APPSHELL_CID);
NS_DEFINE_NAMED_CID(NS_COLORPICKER_CID);
NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
+#if (MOZ_WIDGET_GTK == 3)
+NS_DEFINE_NAMED_CID(NS_APPLICATIONCHOOSER_CID);
+#endif
NS_DEFINE_NAMED_CID(NS_SOUND_CID);
NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID);
#ifdef MOZ_X11
@@ -206,6 +231,9 @@ static const mozilla::Module::CIDEntry k
{ &kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor },
{ &kNS_COLORPICKER_CID, false, nullptr, nsColorPickerConstructor, Module::MAIN_PROCESS_ONLY },
{ &kNS_FILEPICKER_CID, false, nullptr, nsFilePickerConstructor, Module::MAIN_PROCESS_ONLY },
+#if (MOZ_WIDGET_GTK == 3)
+ { &kNS_APPLICATIONCHOOSER_CID, false, nullptr, nsApplicationChooserConstructor, Module::MAIN_PROCESS_ONLY },
+#endif
{ &kNS_SOUND_CID, false, nullptr, nsSoundConstructor, Module::MAIN_PROCESS_ONLY },
{ &kNS_TRANSFERABLE_CID, false, nullptr, nsTransferableConstructor },
#ifdef MOZ_X11
@@ -239,6 +267,9 @@ static const mozilla::Module::ContractID
{ "@mozilla.org/widget/appshell/gtk;1", &kNS_APPSHELL_CID },
{ "@mozilla.org/colorpicker;1", &kNS_COLORPICKER_CID, Module::MAIN_PROCESS_ONLY },
{ "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID, Module::MAIN_PROCESS_ONLY },
+#if (MOZ_WIDGET_GTK == 3)
+ { "@mozilla.org/applicationchooser;1", &kNS_APPLICATIONCHOOSER_CID, Module::MAIN_PROCESS_ONLY },
+#endif
{ "@mozilla.org/sound;1", &kNS_SOUND_CID, Module::MAIN_PROCESS_ONLY },
{ "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
#ifdef MOZ_X11
diff -up mozilla-release/widget/moz.build.1129873-apppicker mozilla-release/widget/moz.build
--- mozilla-release/widget/moz.build.1129873-apppicker 2015-05-25 23:28:56.000000000 +0200
+++ mozilla-release/widget/moz.build 2015-06-09 09:36:01.000000000 +0200
@@ -207,6 +207,10 @@ if toolkit in ('qt', 'gtk2', 'gtk3', 'wi
UNIFIED_SOURCES += [
'nsNativeTheme.cpp',
]
+if toolkit == 'gtk3':
+ XPIDL_SOURCES += [
+ 'nsIApplicationChooser.idl',
+ ]
if not CONFIG['MOZ_B2G']:
DEFINES['MOZ_CROSS_PROCESS_IME'] = True
diff -up mozilla-release/widget/nsIApplicationChooser.idl.1129873-apppicker mozilla-release/widget/nsIApplicationChooser.idl
--- mozilla-release/widget/nsIApplicationChooser.idl.1129873-apppicker 2015-06-09 09:37:35.314305558 +0200
+++ mozilla-release/widget/nsIApplicationChooser.idl 2015-06-09 09:37:35.314305558 +0200
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * 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/. */
+
+#include "nsISupports.idl"
+#include "nsIMIMEInfo.idl"
+interface nsIDOMWindow;
+
+[scriptable, function, uuid(8144404d-e6c7-4861-bcca-47de912ee811)]
+interface nsIApplicationChooserFinishedCallback : nsISupports
+{
+ void done(in nsIHandlerApp handlerApp);
+};
+
+[scriptable, uuid(8413fc42-d6c4-4d78-bf70-64cd78ebcc5c)]
+interface nsIApplicationChooser : nsISupports
+{
+ /**
+ * Initialize the application chooser picker widget. The application chooser
+ * is not valid until this method is called.
+ *
+ * @param parent nsIDOMWindow parent. This dialog will be dependent
+ * on this parent. parent must be non-null.
+ * @param title The title for the file widget
+ *
+ */
+ void init(in nsIDOMWindow parent, in ACString title);
+
+ /**
+ * Open application chooser dialog.
+ *
+ * @param contentType content type of file to open
+ * @param applicationChooserFinishedCallback callback fuction to run when dialog is closed
+ */
+ void open(in ACString contentType, in nsIApplicationChooserFinishedCallback applicationChooserFinishedCallback);
+};
+
diff -up mozilla-release/widget/nsWidgetsCID.h.1129873-apppicker mozilla-release/widget/nsWidgetsCID.h
--- mozilla-release/widget/nsWidgetsCID.h.1129873-apppicker 2015-05-25 23:28:56.000000000 +0200
+++ mozilla-release/widget/nsWidgetsCID.h 2015-06-09 09:37:35.315305554 +0200
@@ -24,6 +24,11 @@
{ 0xbd57cee8, 0x1dd1, 0x11b2, \
{0x9f, 0xe7, 0x95, 0xcf, 0x47, 0x09, 0xae, 0xa3} }
+/* e221df9b-3d66-4045-9a66-5720949f8d10 */
+#define NS_APPLICATIONCHOOSER_CID \
+{ 0xe221df9b, 0x3d66, 0x4045, \
+ {0x9a, 0x66, 0x57, 0x20, 0x94, 0x9f, 0x8d, 0x10} }
+
/* 0f872c8c-3ee6-46bd-92a2-69652c6b474e */
#define NS_COLORPICKER_CID \
{ 0x0f872c8c, 0x3ee6, 0x46bd, \

View File

@ -1,31 +0,0 @@
# HG changeset patch
# User Martin Stransky <stransky@redhat.com>
# Parent e0299ad29b855f798ee5db8257cbb459894c1b29
Bug 1144745 - scale border returned by GetWidgetBorder(), r=?karlt
diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp
--- a/widget/gtk/nsNativeThemeGTK.cpp
+++ b/widget/gtk/nsNativeThemeGTK.cpp
@@ -990,16 +990,22 @@ nsNativeThemeGTK::GetWidgetBorder(nsDevi
if (GetGtkWidgetAndState(aWidgetType, aFrame, gtkWidgetType, nullptr,
nullptr)) {
moz_gtk_get_widget_border(gtkWidgetType, &aResult->left, &aResult->top,
&aResult->right, &aResult->bottom, direction,
IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XHTML));
}
}
}
+
+ gint scale = nsScreenGtk::GetGtkMonitorScaleFactor();
+ aResult->top *= scale;
+ aResult->right *= scale;
+ aResult->bottom *= scale;
+ aResult->left *= scale;
return NS_OK;
}
bool
nsNativeThemeGTK::GetWidgetPadding(nsDeviceContext* aContext,
nsIFrame* aFrame, uint8_t aWidgetType,
nsIntMargin* aResult)
{

View File

@ -1,27 +0,0 @@
# HG changeset patch
# User Lee Salzman <lsalzman@mozilla.com>
# Date 1432140511 14400
# Wed May 20 12:48:31 2015 -0400
# Node ID 283e513fa1c3b2300efb359a8da1d5519c3f74f5
# Parent 4fb7ff694bf5944b76c20b2240fb3abdc55f9a4e
always export HelpersCairo.h
diff -r 4fb7ff694bf5 -r 283e513fa1c3 gfx/2d/moz.build
--- a/gfx/2d/moz.build Tue May 19 11:58:45 2015 +0200
+++ b/gfx/2d/moz.build Wed May 20 12:48:31 2015 -0400
@@ -24,6 +24,7 @@
'DrawTargetTiled.h',
'Filters.h',
'Helpers.h',
+ 'HelpersCairo.h',
'Logging.h',
'Matrix.h',
'NumericTools.h',
@@ -79,7 +80,6 @@
'image_operations.cpp', # Uses _USE_MATH_DEFINES
]
EXPORTS.mozilla.gfx += [
- 'HelpersCairo.h',
'HelpersSkia.h',
]

View File

@ -1,27 +0,0 @@
# HG changeset patch
# User Martin Stransky <stransky@redhat.com>
# Parent f8d21278244bc0531513131f85a45e5736207ae1
Bug 1169232 - [gtk3] add background class to tooltip window
to get correct background color. r=?karlt
diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp
--- a/widget/gtk/nsLookAndFeel.cpp
+++ b/widget/gtk/nsLookAndFeel.cpp
@@ -1004,16 +1004,17 @@ nsLookAndFeel::Init()
gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
sMozWindowBackground = GDK_RGBA_TO_NS_RGBA(color);
gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
sMozWindowText = GDK_RGBA_TO_NS_RGBA(color);
gtk_style_context_restore(style);
// tooltip foreground and background
gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP);
+ gtk_style_context_add_class(style, GTK_STYLE_CLASS_BACKGROUND);
gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
sInfoBackground = GDK_RGBA_TO_NS_RGBA(color);
gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
sInfoText = GDK_RGBA_TO_NS_RGBA(color);
g_object_unref(style);
// menu foreground & menu background
GtkWidget *accel_label = gtk_accel_label_new("M");

View File

@ -1,71 +0,0 @@
# HG changeset patch
# User Martin Stransky <stransky@redhat.com>
# Parent f986e55c4e0b41c6b50bd74d287614b564d7895f
Bug 1169233 - Get grey (inactive) text color from menu labels, r=?karlt
diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp
--- a/widget/gtk/nsLookAndFeel.cpp
+++ b/widget/gtk/nsLookAndFeel.cpp
@@ -237,20 +237,18 @@ nsLookAndFeel::NativeGetColor(ColorID aI
case eColorID_inactiveborder:
// inactive window border
gtk_style_context_get_border_color(mBackgroundStyle,
GTK_STATE_FLAG_INSENSITIVE,
&gdk_color);
aColor = GDK_RGBA_TO_NS_RGBA(gdk_color);
break;
case eColorID_graytext: // disabled text in windows, menus, etc.
- case eColorID_inactivecaptiontext: // text in inactive window caption
- gtk_style_context_get_color(mBackgroundStyle,
- GTK_STATE_FLAG_INSENSITIVE, &gdk_color);
- aColor = GDK_RGBA_TO_NS_RGBA(gdk_color);
+ case eColorID_inactivecaptiontext: // text in inactive window caption
+ aColor = sMenuTextInactive;
break;
case eColorID_inactivecaption:
// inactive window caption
gtk_style_context_get_background_color(mBackgroundStyle,
GTK_STATE_FLAG_INSENSITIVE,
&gdk_color);
aColor = GDK_RGBA_TO_NS_RGBA(gdk_color);
break;
@@ -1023,16 +1021,18 @@ nsLookAndFeel::Init()
g_object_ref_sink(menu);
gtk_container_add(GTK_CONTAINER(menuitem), accel_label);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
style = gtk_widget_get_style_context(accel_label);
gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
sMenuText = GDK_RGBA_TO_NS_RGBA(color);
+ gtk_style_context_get_color(style, GTK_STATE_FLAG_INSENSITIVE, &color);
+ sMenuTextInactive = GDK_RGBA_TO_NS_RGBA(color);
style = gtk_widget_get_style_context(menu);
gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
sMenuBackground = GDK_RGBA_TO_NS_RGBA(color);
style = gtk_widget_get_style_context(menuitem);
gtk_style_context_get_background_color(style, GTK_STATE_FLAG_PRELIGHT, &color);
sMenuHover = GDK_RGBA_TO_NS_RGBA(color);
diff --git a/widget/gtk/nsLookAndFeel.h b/widget/gtk/nsLookAndFeel.h
--- a/widget/gtk/nsLookAndFeel.h
+++ b/widget/gtk/nsLookAndFeel.h
@@ -54,16 +54,17 @@ protected:
// Cached colors
nscolor sInfoBackground;
nscolor sInfoText;
nscolor sMenuBackground;
nscolor sMenuBarText;
nscolor sMenuBarHoverText;
nscolor sMenuText;
+ nscolor sMenuTextInactive;
nscolor sMenuHover;
nscolor sMenuHoverText;
nscolor sButtonText;
nscolor sButtonHoverText;
nscolor sButtonBackground;
nscolor sFrameOuterLightBorder;
nscolor sFrameInnerDarkBorder;
nscolor sOddCellBackground;

View File

@ -1,17 +0,0 @@
diff -up firefox-40.0/mozilla-release/widget/gtk/gtk3drawing.c.old firefox-40.0/mozilla-release/widget/gtk/gtk3drawing.c
--- firefox-40.0/mozilla-release/widget/gtk/gtk3drawing.c.old 2015-08-07 13:50:18.000000000 +0200
+++ firefox-40.0/mozilla-release/widget/gtk/gtk3drawing.c 2015-08-07 13:53:05.920824588 +0200
@@ -2643,13 +2643,6 @@ moz_gtk_get_widget_border(GtkThemeWidget
ensure_entry_widget();
style = gtk_widget_get_style_context(gEntryWidget);
moz_gtk_add_style_border(style, left, top, right, bottom);
-
- /* Use the document padding in HTML
- and GTK style padding in XUL. */
- if (!inhtml) {
- moz_gtk_add_style_padding(style, left, top, right, bottom);
- }
-
return MOZ_GTK_SUCCESS;
}
case MOZ_GTK_TREEVIEW:

View File

@ -1,2 +1,2 @@
26a64a80cbd5b77d3b0d9734bff5bbad firefox-40.0.3.source.tar.bz2 07a5ca853de78278a8bc13bcd3dcf063 firefox-41.0.source.tar.xz
d3c2c9b65aba9b3d159466ea6df522e0 firefox-langpacks-40.0.3-20150827.tar.xz 0795572ee46b57a9b1e51de9cede3021 firefox-langpacks-41.0-20150915.tar.xz