1
0

- update to Thunderbird 52.0

* Optionally remove corresponding data files when removing an account
  * Possibility to copy message filter
  * Calendar: Event can now be created and edited in a tab
  * Calendar: Processing of received invitation counter proposals
  * Chat: Support Twitter Direct Messages
  * Chat: Liking and favoriting in Twitter
  * Chat: Removed Yahoo! Messenger support
  * serveral bugfixes
- removed obsolete patches
  * mozilla-aarch64-48bit-va.patch
  * mozilla-binutils-visibility.patch
  * mozilla-flex_buffer_overrun.patch
  * mozilla-gcc6.patch
- added generic mozilla patches
  * mozilla-aarch64-startup-crash.patch
- require newer versions of NSPR and NSS

OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaThunderbird?expand=0&rev=358
This commit is contained in:
Wolfgang Rosenauer
2017-03-18 21:27:55 +00:00
committed by Git OBS Bridge
parent 693127b057
commit d6fa566d17
16 changed files with 511 additions and 634 deletions

View File

@@ -1,3 +1,24 @@
-------------------------------------------------------------------
Sat Mar 18 21:06:01 UTC 2017 - wr@rosenauer.org
- update to Thunderbird 52.0
* Optionally remove corresponding data files when removing an account
* Possibility to copy message filter
* Calendar: Event can now be created and edited in a tab
* Calendar: Processing of received invitation counter proposals
* Chat: Support Twitter Direct Messages
* Chat: Liking and favoriting in Twitter
* Chat: Removed Yahoo! Messenger support
* serveral bugfixes
- removed obsolete patches
* mozilla-aarch64-48bit-va.patch
* mozilla-binutils-visibility.patch
* mozilla-flex_buffer_overrun.patch
* mozilla-gcc6.patch
- added generic mozilla patches
* mozilla-aarch64-startup-crash.patch
- require newer versions of NSPR and NSS
-------------------------------------------------------------------
Tue Mar 7 15:08:23 UTC 2017 - wr@rosenauer.org

View File

@@ -17,21 +17,18 @@
#
%define mainversion 45.8.0
%define mainversion 52.0
%define update_channel release
%define releasedate 2017030300
%if %suse_version > 1310
%define gstreamer_ver 1.0
%define gstreamer 1
%else
%define gstreamer_ver 0.10
%endif
%define releasedate 201703180000
%bcond_without mozilla_tb_kde4
%bcond_with mozilla_tb_valgrind
%bcond_without mozilla_tb_optimize_for_size
%if 0%{?suse_version} > 1320
%define mozilla_use_gtk3 1
%endif
Name: MozillaThunderbird
BuildRequires: Mesa-devel
BuildRequires: autoconf213
@@ -44,8 +41,8 @@ BuildRequires: libcurl-devel
BuildRequires: libgnomeui-devel
BuildRequires: libidl-devel
BuildRequires: libnotify-devel
BuildRequires: mozilla-nspr-devel >= 4.12
BuildRequires: mozilla-nss-devel >= 3.21.3
BuildRequires: mozilla-nspr-devel >= 4.13.1
BuildRequires: mozilla-nss-devel >= 3.28.3
BuildRequires: python
BuildRequires: startup-notification-devel
BuildRequires: unzip
@@ -58,18 +55,17 @@ BuildRequires: pkgconfig(libpulse)
%if %{with mozilla_tb_valgrind}
BuildRequires: pkgconfig(valgrind)
%endif
BuildRequires: pkgconfig(gstreamer-%gstreamer_ver)
BuildRequires: pkgconfig(gstreamer-app-%gstreamer_ver)
BuildRequires: pkgconfig(gstreamer-plugins-base-%gstreamer_ver)
%if 0%{?gstreamer} == 1
Requires: libgstreamer-1_0-0
Recommends: gstreamer-fluendo-mp3
Recommends: gstreamer-plugin-libav
%else
Requires: libgstreamer-0_10-0
Recommends: gstreamer-0_10-fluendo-mp3
Recommends: gstreamer-0_10-plugins-ffmpeg
%if 0%{?mozilla_use_gtk3}
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(gtk+-3.0) >= 3.4.0
BuildRequires: pkgconfig(gtk+-unix-print-3.0)
%endif
# libavcodec is required for H.264 support but the
# openSUSE version is currently not able to play H.264
# therefore the Packman version is required
# minimum version of libavcodec is 53
Recommends: libavcodec-full >= 0.10.16
Version: %{mainversion}
Release: 0
Provides: thunderbird = %{version}
@@ -103,16 +99,13 @@ Patch2: mozilla-nongnome-proxies.patch
Patch3: mozilla-kde.patch
Patch4: mozilla-develdirs.patch
Patch5: mozilla-no-stdcxx-check.patch
Patch6: mozilla-gcc6.patch
Patch8: mozilla-aarch64-48bit-va.patch
Patch9: mozilla-binutils-visibility.patch
Patch6: mozilla-aarch64-startup-crash.patch
# Thunderbird/mail
Patch20: tb-ssldap.patch
# hotfix
Patch150: mozilla-flex_buffer_overrun.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: coreutils fileutils textutils /bin/sh
Recommends: libcanberra0
Recommends: libpulse0
### build options
%ifarch aarch64 ppc ppc64 ppc64le s390 s390x ia64 %arm
%define crashreporter 0
@@ -132,11 +125,7 @@ Conflicts: thunderbird-esr
%define progname thunderbird
%define progdir %{_prefix}/%_lib/thunderbird
%define libgssapi libgssapi_krb5.so.2
%if %suse_version > 1130
%define desktop_file_name thunderbird
%else
%define desktop_file_name %{name}
%endif
%description
Mozilla Thunderbird is a redesign of the Mozilla Mail component. It is
@@ -204,9 +193,6 @@ pushd mozilla
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch8 -p1
%patch9 -p1
%patch150 -p1
popd
# comm-central patches
%patch20 -p1
@@ -273,6 +259,11 @@ ac_add_options --includedir=%{_includedir}
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --enable-optimize
%if 0%{?mozilla_use_gtk3}
ac_add_options --enable-default-toolkit=cairo-gtk3
%else
ac_add_options --enable-default-toolkit=cairo-gtk2
%endif
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-jpeg
@@ -281,15 +272,10 @@ ac_add_options --with-l10n-base=$RPM_BUILD_DIR/l10n
ac_add_options --disable-updater
#ac_add_options --with-system-png # no apng support
ac_add_options --enable-system-hunspell
ac_add_options --disable-installer
ac_add_options --disable-mochitest
ac_add_options --enable-startup-notification
ac_add_options --enable-official-branding
ac_add_options --disable-necko-wifi
ac_add_options --enable-update-channel=%{update_channel}
%if 0%{?gstreamer} == 1
ac_add_options --enable-gstreamer=1.0
%endif
%if %has_system_cairo
ac_add_options --enable-system-cairo
%endif
@@ -476,7 +462,10 @@ exit 0
%dir %{progdir}
%{progdir}/application.ini
%{progdir}/blocklist.xml
%{progdir}/chrome.manifest
%{progdir}/dependentlibs.list
%{progdir}/fonts/
%{progdir}/icudt58l.dat
%{progdir}/*.so
%{progdir}/omni.ja
%{progdir}/platform.ini

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6469fc90ac155189cc9fa2b1fb209d2997de2c45d8a05e7e1d6c09ae015d3171
size 28372
oid sha256:0b97ad0de96c991d5706e3fb193098c0a5efc38184e2b266899aaa0142c6a5c7
size 28380

View File

@@ -1,9 +1,9 @@
#!/bin/bash
CHANNEL="esr45"
CHANNEL="esr52"
BRANCH="releases/comm-$CHANNEL"
RELEASE_TAG="THUNDERBIRD_45_8_0_RELEASE"
VERSION="45.8.0"
RELEASE_TAG="be61b0b74793df0a2ae8c940516bcab4beef60da"
VERSION="52.0"
echo "cloning $BRANCH..."
hg clone http://hg.mozilla.org/$BRANCH thunderbird

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:76a50bb992378a93c0e39072edc1d9f5f5899d398d8fe8df668c7c98b18af72e
size 24497668

3
l10n-52.0.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a5026fe4a0f2c5608cf029ab53c8e6eee0a7da93ea73c83caf7c40618ef95e87
size 26058896

View File

@@ -1,170 +0,0 @@
# HG changeset patch
# User Zheng Xu <zheng.xu@linaro.org>
# Date 1464657720 -7200
# Node ID dfaafbaaa2919a033c4c0abdd5830f4ea413bed6
# Parent 499f16ca85ec48d1896a1633730715f32bd62140
Bug 1143022 - Manually mmap on arm64 to ensure high 17 bits are clear. r=ehoogeveen
There might be 48-bit VA on arm64 depending on kernel configuration.
Manually mmap heap memory to align with the assumption made by JS engine.
diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp
--- a/js/src/gc/Memory.cpp
+++ b/js/src/gc/Memory.cpp
@@ -430,17 +430,17 @@ InitMemorySubsystem()
if (pageSize == 0)
pageSize = allocGranularity = size_t(sysconf(_SC_PAGESIZE));
}
static inline void*
MapMemoryAt(void* desired, size_t length, int prot = PROT_READ | PROT_WRITE,
int flags = MAP_PRIVATE | MAP_ANON, int fd = -1, off_t offset = 0)
{
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__))
+#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__)
MOZ_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0);
#endif
void* region = mmap(desired, length, prot, flags, fd, offset);
if (region == MAP_FAILED)
return nullptr;
/*
* mmap treats the given address as a hint unless the MAP_FIXED flag is
* used (which isn't usually what you want, as this overrides existing
@@ -480,16 +480,51 @@ MapMemory(size_t length, int prot = PROT
* as out of memory.
*/
if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
if (munmap(region, length))
MOZ_ASSERT(errno == ENOMEM);
return nullptr;
}
return region;
+#elif defined(__aarch64__)
+ /*
+ * There might be similar virtual address issue on arm64 which depends on
+ * hardware and kernel configurations. But the work around is slightly
+ * different due to the different mmap behavior.
+ *
+ * TODO: Merge with the above code block if this implementation works for
+ * ia64 and sparc64.
+ */
+ const uintptr_t start = UINT64_C(0x0000070000000000);
+ const uintptr_t end = UINT64_C(0x0000800000000000);
+ const uintptr_t step = ChunkSize;
+ /*
+ * Optimization options if there are too many retries in practice:
+ * 1. Examine /proc/self/maps to find an available address. This file is
+ * not always available, however. In addition, even if we examine
+ * /proc/self/maps, we may still need to retry several times due to
+ * racing with other threads.
+ * 2. Use a global/static variable with lock to track the addresses we have
+ * allocated or tried.
+ */
+ uintptr_t hint;
+ void* region = MAP_FAILED;
+ for (hint = start; region == MAP_FAILED && hint + length <= end; hint += step) {
+ region = mmap((void*)hint, length, prot, flags, fd, offset);
+ if (region != MAP_FAILED) {
+ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
+ if (munmap(region, length)) {
+ MOZ_ASSERT(errno == ENOMEM);
+ }
+ region = MAP_FAILED;
+ }
+ }
+ }
+ return region == MAP_FAILED ? nullptr : region;
#else
void* region = MozTaggedAnonymousMmap(nullptr, length, prot, flags, fd, offset, "js-gc-heap");
if (region == MAP_FAILED)
return nullptr;
return region;
#endif
}
diff --git a/js/src/jsapi-tests/testGCAllocator.cpp b/js/src/jsapi-tests/testGCAllocator.cpp
--- a/js/src/jsapi-tests/testGCAllocator.cpp
+++ b/js/src/jsapi-tests/testGCAllocator.cpp
@@ -307,48 +307,72 @@ void* mapMemoryAt(void* desired, size_t
void* mapMemory(size_t length) { return nullptr; }
void unmapPages(void* p, size_t size) { }
#elif defined(XP_UNIX)
void*
mapMemoryAt(void* desired, size_t length)
{
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__))
+#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__)
MOZ_RELEASE_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0);
#endif
void* region = mmap(desired, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
if (region == MAP_FAILED)
return nullptr;
if (region != desired) {
if (munmap(region, length))
MOZ_RELEASE_ASSERT(errno == ENOMEM);
return nullptr;
}
return region;
}
void*
mapMemory(size_t length)
{
- void* hint = nullptr;
+ int prot = PROT_READ | PROT_WRITE;
+ int flags = MAP_PRIVATE | MAP_ANON;
+ int fd = -1;
+ off_t offset = 0;
+ // The test code must be aligned with the implementation in gc/Memory.cpp.
#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__))
- hint = (void*)0x0000070000000000ULL;
-#endif
- void* region = mmap(hint, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
+ void* region = mmap((void*)0x0000070000000000, length, prot, flags, fd, offset);
if (region == MAP_FAILED)
return nullptr;
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__))
- if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000ULL) {
+ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
if (munmap(region, length))
MOZ_RELEASE_ASSERT(errno == ENOMEM);
return nullptr;
}
+ return region;
+#elif defined(__aarch64__)
+ const uintptr_t start = UINT64_C(0x0000070000000000);
+ const uintptr_t end = UINT64_C(0x0000800000000000);
+ const uintptr_t step = ChunkSize;
+ uintptr_t hint;
+ void* region = MAP_FAILED;
+ for (hint = start; region == MAP_FAILED && hint + length <= end; hint += step) {
+ region = mmap((void*)hint, length, prot, flags, fd, offset);
+ if (region != MAP_FAILED) {
+ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
+ if (munmap(region, length)) {
+ MOZ_RELEASE_ASSERT(errno == ENOMEM);
+ }
+ region = MAP_FAILED;
+ }
+ }
+ }
+ return region == MAP_FAILED ? nullptr : region;
+#else
+ void* region = mmap(nullptr, length, prot, flags, fd, offset);
+ if (region == MAP_FAILED)
+ return nullptr;
+ return region;
#endif
- return region;
}
void
unmapPages(void* p, size_t size)
{
if (munmap(p, size))
MOZ_RELEASE_ASSERT(errno == ENOMEM);
}

View File

@@ -0,0 +1,31 @@
# HG changeset patch
# Parent a5cfa3aa11a9d3391df49de6fc5a0e5232c12c10
Bug 991344 - Rpi3: Firefox crashes after a few seconds of usage
diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -830,17 +830,23 @@ nsIOService::NewChannelFromURIWithProxyF
consoleService->LogStringMessage(NS_LITERAL_STRING(
"Http channel implementation doesn't support nsIUploadChannel2. An extension has supplied a non-functional http protocol handler. This will break behavior and in future releases not work at all."
).get());
}
gHasWarnedUploadChannel2 = true;
}
}
+#if defined(__aarch64__)
+ if (result) {
+ channel.forget(result);
+ }
+#else
channel.forget(result);
+#endif
return NS_OK;
}
NS_IMETHODIMP
nsIOService::NewChannelFromURIWithProxyFlags2(nsIURI* aURI,
nsIURI* aProxyURI,
uint32_t aProxyFlags,
nsIDOMNode* aLoadingNode,

View File

@@ -1,30 +0,0 @@
# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
# Parent 83bc32d997c714b607db1ffa71f02b30e1484a75
From: NetBSD
Subject: Workaround for gcc/binutils combination in Leap 42.2
References:
https://bugzilla.opensuse.org/show_bug.cgi?id=984637
diff --git a/xpcom/components/Module.h b/xpcom/components/Module.h
--- a/xpcom/components/Module.h
+++ b/xpcom/components/Module.h
@@ -120,17 +120,17 @@ struct Module
#if defined(MOZILLA_INTERNAL_API)
# define NSMODULE_NAME(_name) _name##_NSModule
# if defined(_MSC_VER)
# pragma section(".kPStaticModules$M", read)
# pragma comment(linker, "/merge:.kPStaticModules=.rdata")
# define NSMODULE_SECTION __declspec(allocate(".kPStaticModules$M"), dllexport)
# elif defined(__GNUC__)
# if defined(__ELF__)
-# define NSMODULE_SECTION __attribute__((section(".kPStaticModules"), visibility("protected")))
+# define NSMODULE_SECTION __attribute__((section(".kPStaticModules"), visibility("default")))
# elif defined(__MACH__)
# define NSMODULE_SECTION __attribute__((section("__DATA, .kPStaticModules"), visibility("default")))
# elif defined (_WIN32)
# define NSMODULE_SECTION __attribute__((section(".kPStaticModules"), dllexport))
# endif
# endif
# if !defined(NSMODULE_SECTION)
# error Do not know how to define sections.

View File

@@ -19,6 +19,6 @@ diff --git a/config/baseconfig.mk b/config/baseconfig.mk
else
DIST = $(DEPTH)/dist
endif
ABS_DIST = $(topobjdir)/dist
# We do magic with OBJ_SUFFIX in config.mk, the following ensures we don't
# manually use it before config.mk inclusion

View File

@@ -1,76 +0,0 @@
# HG changeset patch
# Parent c8e8364b303892fdb5a574b96411d2d8f699a15e
Patch lexical parser files generated by flex which may be potentially
exploitable in a buffer overrun. These seem to come from an upstream projects
(CMU Sphinx and ANGLE) so it should be fixed there in the first place.
CVE-2016-6354
https://bugzilla.suse.com/show_bug.cgi?id=990856
diff --git a/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp b/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
--- a/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
@@ -1375,17 +1375,17 @@ static int yy_get_next_buffer (yyscan_t
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
else
{
- yy_size_t num_to_read =
+ int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
diff --git a/gfx/angle/src/compiler/translator/glslang_lex.cpp b/gfx/angle/src/compiler/translator/glslang_lex.cpp
--- a/gfx/angle/src/compiler/translator/glslang_lex.cpp
+++ b/gfx/angle/src/compiler/translator/glslang_lex.cpp
@@ -2269,17 +2269,17 @@ static int yy_get_next_buffer (yyscan_t
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
else
{
- yy_size_t num_to_read =
+ int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
diff --git a/media/sphinxbase/src/libsphinxbase/lm/jsgf_scanner.c b/media/sphinxbase/src/libsphinxbase/lm/jsgf_scanner.c
--- a/media/sphinxbase/src/libsphinxbase/lm/jsgf_scanner.c
+++ b/media/sphinxbase/src/libsphinxbase/lm/jsgf_scanner.c
@@ -1242,17 +1242,17 @@ static int yy_get_next_buffer (yyscan_t
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
else
{
- yy_size_t num_to_read =
+ int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;

View File

@@ -1,27 +0,0 @@
diff -up firefox-44.0/nsprpub/config/make-system-wrappers.pl.back firefox-44.0/nsprpub/config/make-system-wrappers.pl
--- firefox-44.0/nsprpub/config/make-system-wrappers.pl.back 2016-01-24 00:23:49.000000000 +0100
+++ firefox-44.0/nsprpub/config/make-system-wrappers.pl 2016-02-02 14:58:45.064112655 +0100
@@ -19,7 +19,9 @@ while (<STDIN>) {
open OUT, ">$output_dir/$_";
print OUT "#pragma GCC system_header\n"; # suppress include_next warning
print OUT "#pragma GCC visibility push(default)\n";
+ print OUT "#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS\n";
print OUT "#include_next \<$_\>\n";
+ print OUT "#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS\n";
print OUT "#pragma GCC visibility pop\n";
close OUT;
}
diff -up firefox-44.0/mozglue/build/arm.cpp.old firefox-44.0/mozglue/build/arm.cpp
--- firefox-44.0/mozglue/build/arm.cpp.old 2016-02-03 10:07:29.879526500 +0100
+++ firefox-44.0/mozglue/build/arm.cpp 2016-02-03 10:08:11.062697517 +0100
@@ -104,7 +104,9 @@ check_neon(void)
# elif defined(__linux__) || defined(ANDROID)
# include <stdio.h>
+#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
# include <stdlib.h>
+#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
# include <string.h>
enum{

View File

@@ -1,5 +1,5 @@
# HG changeset patch
# Parent 797d5f17b080f54439602f107ecaf6b09a0ef5c1
# Parent 5c8ae59424f5318bf7a387257771bf95d3893063
Description: Add KDE integration to Firefox (toolkit parts)
Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
Author: Lubos Lunak <lunak@suse.com>
@@ -9,7 +9,7 @@ Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -30,16 +30,17 @@
@@ -31,16 +31,17 @@
#include "nsIZipReader.h"
#include "nsPrefBranch.h"
#include "nsXPIDLString.h"
@@ -27,7 +27,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
#include "prefread.h"
#include "prefapi_private_data.h"
@@ -1136,16 +1137,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
@@ -1174,16 +1175,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
static nsresult pref_LoadPrefsInDirList(const char *listId)
{
@@ -62,7 +62,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
return NS_OK;
bool hasMore;
@@ -1161,17 +1180,17 @@ static nsresult pref_LoadPrefsInDirList(
@@ -1199,17 +1218,17 @@ static nsresult pref_LoadPrefsInDirList(
nsAutoCString leaf;
path->GetNativeLeafName(leaf);
@@ -81,7 +81,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
{
nsZipItemPtr<char> manifest(jarReader, name, true);
NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
@@ -1265,26 +1284,38 @@ static nsresult pref_InitInitialObjects(
@@ -1303,24 +1322,36 @@ static nsresult pref_InitInitialObjects(
/* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
static const char* specialFiles[] = {
#if defined(XP_MACOSX)
@@ -91,9 +91,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
#elif defined(XP_UNIX)
"unix.js"
+ , "" // placeholder for KDE (empty is otherwise harmless)
#if defined(VMS)
, "openvms.js"
#elif defined(_AIX)
#if defined(_AIX)
, "aix.js"
#endif
#elif defined(XP_BEOS)
@@ -143,7 +141,7 @@ diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
if CONFIG['GNU_CXX']:
FINAL_TARGET_PP_FILES += [
diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
--- a/python/mozbuild/mozpack/chrome/flags.py
+++ b/python/mozbuild/mozpack/chrome/flags.py
@@ -189,8 +187,7 @@ diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpac
diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
--- a/toolkit/components/downloads/moz.build
+++ b/toolkit/components/downloads/moz.build
@@ -65,15 +65,16 @@ if not CONFIG['MOZ_SUITE']:
'nsDownloadManagerUI.js',
@@ -57,16 +57,17 @@ if not CONFIG['MOZ_SUITE']:
'nsDownloadManagerUI.manifest',
]
@@ -198,19 +195,20 @@ diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloa
LOCAL_INCLUDES += [
'../protobuf',
- '/ipc/chromium/src'
+ '/ipc/chromium/src',
+ '/toolkit/xre'
'/ipc/chromium/src',
+ '/toolkit/xre',
'chromium'
]
DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
CXXFLAGS += CONFIG['TK_CFLAGS']
diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -51,16 +51,20 @@
@@ -52,16 +52,20 @@
#ifdef XP_WIN
#include <shlobj.h>
#include "nsWindowsHelpers.h"
@@ -228,10 +226,10 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
#endif
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#include "FennecJNIWrappers.h"
#endif
@@ -2719,16 +2723,25 @@ nsDownload::SetState(DownloadState aStat
@@ -2723,16 +2727,25 @@ nsDownload::SetState(DownloadState aStat
nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
// Master pref to control this function.
@@ -257,12 +255,12 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
int64_t goat = PR_Now() - mStartTime;
showTaskbarAlert = goat > alertIntervalUSec;
@@ -2759,16 +2772,17 @@ nsDownload::SetState(DownloadState aStat
NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
@@ -2764,16 +2777,17 @@ nsDownload::SetState(DownloadState aStat
message, !removeWhenDone,
mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"),
EmptyString(), EmptyString(), nullptr, mPrivate);
EmptyString(), EmptyString(), nullptr, mPrivate,
false /* requireInteraction */);
}
}
}
@@ -278,31 +276,31 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -64,29 +64,33 @@ toolkit.jar:
content/global/viewZoomOverlay.js
*+ content/global/bindings/autocomplete.xml (widgets/autocomplete.xml)
content/global/bindings/browser.xml (widgets/browser.xml)
@@ -71,29 +71,33 @@ toolkit.jar:
content/global/bindings/button.xml (widgets/button.xml)
content/global/bindings/checkbox.xml (widgets/checkbox.xml)
content/global/bindings/colorpicker.xml (widgets/colorpicker.xml)
content/global/bindings/datetimepicker.xml (widgets/datetimepicker.xml)
*+ content/global/bindings/dialog.xml (widgets/dialog.xml)
+*+ content/global/bindings/dialog-kde.xml (widgets/dialog-kde.xml)
content/global/bindings/datetimepopup.xml (widgets/datetimepopup.xml)
content/global/bindings/datetimebox.xml (widgets/datetimebox.xml)
content/global/bindings/datetimebox.css (widgets/datetimebox.css)
* content/global/bindings/dialog.xml (widgets/dialog.xml)
+* content/global/bindings/dialog-kde.xml (widgets/dialog-kde.xml)
+% override chrome://global/content/bindings/dialog.xml chrome://global/content/bindings/dialog-kde.xml desktop=kde
content/global/bindings/editor.xml (widgets/editor.xml)
content/global/bindings/expander.xml (widgets/expander.xml)
* content/global/bindings/filefield.xml (widgets/filefield.xml)
*+ content/global/bindings/findbar.xml (widgets/findbar.xml)
content/global/bindings/filefield.xml (widgets/filefield.xml)
* content/global/bindings/findbar.xml (widgets/findbar.xml)
content/global/bindings/general.xml (widgets/general.xml)
content/global/bindings/groupbox.xml (widgets/groupbox.xml)
*+ content/global/bindings/listbox.xml (widgets/listbox.xml)
content/global/bindings/listbox.xml (widgets/listbox.xml)
content/global/bindings/menu.xml (widgets/menu.xml)
content/global/bindings/menulist.xml (widgets/menulist.xml)
content/global/bindings/notification.xml (widgets/notification.xml)
content/global/bindings/numberbox.xml (widgets/numberbox.xml)
content/global/bindings/popup.xml (widgets/popup.xml)
*+ content/global/bindings/preferences.xml (widgets/preferences.xml)
+*+ content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml)
* content/global/bindings/preferences.xml (widgets/preferences.xml)
+* content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml)
+% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde
content/global/bindings/progressmeter.xml (widgets/progressmeter.xml)
content/global/bindings/radio.xml (widgets/radio.xml)
@@ -312,11 +310,23 @@ diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
content/global/bindings/scale.xml (widgets/scale.xml)
content/global/bindings/scrollbar.xml (widgets/scrollbar.xml)
content/global/bindings/scrollbox.xml (widgets/scrollbox.xml)
@@ -113,9 +117,9 @@ toolkit.jar:
content/global/bindings/videocontrols.css (widgets/videocontrols.css)
* content/global/bindings/wizard.xml (widgets/wizard.xml)
#ifdef XP_MACOSX
content/global/macWindowMenu.js
#endif
content/global/svg/svgBindings.xml (/layout/svg/resources/content/svgBindings.xml)
content/global/gmp-sources/eme-adobe.json (gmp-sources/eme-adobe.json)
content/global/gmp-sources/openh264.json (gmp-sources/openh264.json)
- content/global/gmp-sources/widevinecdm.json (gmp-sources/widevinecdm.json)
\ No newline at end of file
+ content/global/gmp-sources/widevinecdm.json (gmp-sources/widevinecdm.json)
diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/dialog-kde.xml
new file mode 100644
--- /dev/null
+++ b/toolkit/content/widgets/dialog-kde.xml
@@ -0,0 +1,460 @@
@@ -0,0 +1,457 @@
+<?xml version="1.0"?>
+<!-- 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
@@ -350,13 +360,13 @@ new file mode 100644
+ <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
+#elif XP_UNIX
+ >
+ <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
+ <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
+ <xul:spacer anonid="spacer" flex="1"/>
+ <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
+ <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
+ <xul:button dlgtype="cancel" class="dialog-button"/>
+ <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
+ <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
+ <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
+ <xul:spacer anonid="spacer" flex="1"/>
+ <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
+ <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
+ <xul:button dlgtype="cancel" class="dialog-button"/>
+ <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
+#else
+ pack="end">
+ <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
@@ -386,8 +396,7 @@ new file mode 100644
+ <![CDATA[
+ if (this.hasAttribute("defaultButton"))
+ return this.getAttribute("defaultButton");
+ else // default to the accept button
+ return "accept";
+ return "accept"; // default to the accept button
+ ]]>
+ </getter>
+ <setter>
@@ -463,7 +472,7 @@ new file mode 100644
+ <body>
+ <![CDATA[
+ var xOffset = screen.availWidth/2 - window.outerWidth/2;
+ var yOffset = screen.availHeight/2 - window.outerHeight/2; //(opener.outerHeight *2)/10;
+ var yOffset = screen.availHeight/2 - window.outerHeight/2;
+
+ xOffset = xOffset > 0 ? xOffset : 0;
+ yOffset = yOffset > 0 ? yOffset : 0;
@@ -516,11 +525,10 @@ new file mode 100644
+ initialFocusedElt.focus();
+ }
+ }
+#ifndef XP_MACOSX
+ else if (focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {
+ else if (!/Mac/.test(navigator.platform) &&
+ focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {
+ defaultButton.focus();
+ }
+#endif
+ }
+ }
+
@@ -602,16 +610,16 @@ new file mode 100644
+ else
+ switch (dlgtype) {
+ case "accept":
+ button.setAttribute("icon","accept");
+ button.setAttribute("icon", "accept");
+ break;
+ case "cancel":
+ button.setAttribute("icon","cancel");
+ button.setAttribute("icon", "cancel");
+ break;
+ case "disclosure":
+ button.setAttribute("icon","properties");
+ button.setAttribute("icon", "properties");
+ break;
+ case "help":
+ button.setAttribute("icon","help");
+ button.setAttribute("icon", "help");
+ break;
+ default:
+ break;
@@ -637,13 +645,12 @@ new file mode 100644
+ for (dlgtype in buttons)
+ buttons[dlgtype].hidden = !shown[dlgtype];
+
+#ifdef XP_WIN
+# show the spacer on Windows only when the extra2 button is present
+ var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
+ spacer.removeAttribute("hidden");
+ spacer.setAttribute("flex", shown["extra2"]?"1":"0");
+#endif
+
+ // show the spacer on Windows only when the extra2 button is present
+ if (/Win/.test(navigator.platform)) {
+ var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
+ spacer.removeAttribute("hidden");
+ spacer.setAttribute("flex", shown["extra2"]?"1":"0");
+ }
+ }
+ ]]>
+ </body>
@@ -781,7 +788,7 @@ diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widge
new file mode 100644
--- /dev/null
+++ b/toolkit/content/widgets/preferences-kde.xml
@@ -0,0 +1,1403 @@
@@ -0,0 +1,1411 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE bindings [
@@ -951,6 +958,8 @@ new file mode 100644
+ <field name="_constructed">false</field>
+ <property name="instantApply">
+ <getter>
+ if (this.getAttribute("instantApply") == "false")
+ return false;
+ return this.getAttribute("instantApply") == "true" || this.preferences.instantApply;
+ </getter>
+ </property>
@@ -1227,7 +1236,9 @@ new file mode 100644
+ Components.utils.reportError(e);
+ }
+ }
+ var val = rv !== undefined ? rv : (this.instantApply ? this.valueFromPreferences : this.value);
+ var val = rv;
+ if (val === undefined)
+ val = this.instantApply ? this.valueFromPreferences : this.value;
+ // if the preference is marked for reset, show default value in UI
+ if (val === undefined)
+ val = this.defaultValue;
@@ -1415,19 +1426,19 @@ new file mode 100644
+ var acceptButton = docElt.getButton("accept");
+ acceptButton.hidden = true;
+ var cancelButton = docElt.getButton("cancel");
+#ifdef XP_MACOSX
+ // no buttons on Mac except Help
+ cancelButton.hidden = true;
+ // Move Help button to the end
+ document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;
+ // Also, don't fire onDialogAccept on enter
+ acceptButton.disabled = true;
+#else
+ // morph the Cancel button into the Close button
+ cancelButton.setAttribute ("icon", "close");
+ cancelButton.label = docElt.getAttribute("closebuttonlabel");
+ cancelButton.accesskey = docElt.getAttribute("closebuttonaccesskey");
+#endif
+ if (/Mac/.test(navigator.platform)) {
+ // no buttons on Mac except Help
+ cancelButton.hidden = true;
+ // Move Help button to the end
+ document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;
+ // Also, don't fire onDialogAccept on enter
+ acceptButton.disabled = true;
+ } else {
+ // morph the Cancel button into the Close button
+ cancelButton.setAttribute ("icon", "close");
+ cancelButton.label = docElt.getAttribute("closebuttonlabel");
+ cancelButton.accesskey = docElt.getAttribute("closebuttonaccesskey");
+ }
+ }
+ }
+ this.setAttribute("animated", this._shouldAnimate ? "true" : "false");
@@ -1597,11 +1608,11 @@ new file mode 100644
+ <parameter name="aPaneElement"/>
+ <body>
+ <![CDATA[
+#ifdef XP_MACOSX
+ var paneTitle = aPaneElement.label;
+ if (paneTitle != "")
+ document.title = paneTitle;
+#endif
+ if (/Mac/.test(navigator.platform)) {
+ var paneTitle = aPaneElement.label;
+ if (paneTitle != "")
+ document.title = paneTitle;
+ }
+ var helpButton = document.documentElement.getButton("help");
+ if (aPaneElement.helpTopic)
+ helpButton.hidden = false;
@@ -1673,11 +1684,7 @@ new file mode 100644
+ <![CDATA[
+ var psvc = Components.classes["@mozilla.org/preferences-service;1"]
+ .getService(Components.interfaces.nsIPrefBranch);
+#ifdef XP_MACOSX
+ var animate = true;
+#else
+ var animate = false;
+#endif
+ var animate = /Mac/.test(navigator.platform);
+ try {
+ animate = psvc.getBoolPref("browser.preferences.animateFadeIn");
+ }
@@ -1844,7 +1851,7 @@ new file mode 100644
+ <handlers>
+ <handler event="dialogaccept">
+ <![CDATA[
+ if (!this._fireEvent("beforeaccept", this)){
+ if (!this._fireEvent("beforeaccept", this)) {
+ return false;
+ }
+
@@ -1852,12 +1859,12 @@ new file mode 100644
+ .getService(Components.interfaces.nsIScriptSecurityManager);
+ if (this.type == "child" && window.opener &&
+ secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
+ var psvc = Components.classes["@mozilla.org/preferences-service;1"]
+ let psvc = Components.classes["@mozilla.org/preferences-service;1"]
+ .getService(Components.interfaces.nsIPrefBranch);
+ var pdocEl = window.opener.document.documentElement;
+ if (pdocEl.instantApply) {
+ var panes = this.preferencePanes;
+ for (var i = 0; i < panes.length; ++i)
+ let panes = this.preferencePanes;
+ for (let i = 0; i < panes.length; ++i)
+ panes[i].writePreferences(true);
+ }
+ else {
@@ -1869,12 +1876,12 @@ new file mode 100644
+ var id = window.location.href + "#childprefs";
+ var childPrefs = pdoc.getElementById(id);
+ if (!childPrefs) {
+ var childPrefs = pdoc.createElement("preferences");
+ childPrefs = pdoc.createElement("preferences");
+ currentPane.appendChild(childPrefs);
+ childPrefs.id = id;
+ }
+ var panes = this.preferencePanes;
+ for (var i = 0; i < panes.length; ++i) {
+ let panes = this.preferencePanes;
+ for (let i = 0; i < panes.length; ++i) {
+ var preferences = panes[i].preferences;
+ for (var j = 0; j < preferences.length; ++j) {
+ // Try to find a preference element for the same preference.
@@ -1905,11 +1912,11 @@ new file mode 100644
+ }
+ }
+ else {
+ var panes = this.preferencePanes;
+ let panes = this.preferencePanes;
+ for (var i = 0; i < panes.length; ++i)
+ panes[i].writePreferences(false);
+
+ var psvc = Components.classes["@mozilla.org/preferences-service;1"]
+ let psvc = Components.classes["@mozilla.org/preferences-service;1"]
+ .getService(Components.interfaces.nsIPrefService);
+ psvc.savePrefFile(null);
+ }
@@ -2047,11 +2054,19 @@ new file mode 100644
+ </body>
+ </method>
+
+ <field name="DeferredTask" readonly="true">
+ let targetObj = {};
+ Components.utils.import("resource://gre/modules/DeferredTask.jsm", targetObj);
+ targetObj.DeferredTask;
+ </field>
+ <property name="DeferredTask" readonly="true">
+ <getter><![CDATA[
+ let module = {};
+ Components.utils.import("resource://gre/modules/DeferredTask.jsm", module);
+ Object.defineProperty(this, "DeferredTask", {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ value: module.DeferredTask
+ });
+ return module.DeferredTask;
+ ]]></getter>
+ </property>
+ <method name="_deferredValueUpdate">
+ <parameter name="aElement"/>
+ <body>
@@ -2185,6 +2200,117 @@ new file mode 100644
+# PrefWindow II (???)
+# PrefWindow I (June 4, 1999)
+#
diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js
--- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
+++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
@@ -627,17 +627,17 @@ nsUnknownContentTypeDialog.prototype = {
else
typeString = mimeInfo.MIMEType;
}
// When the length is unknown, contentLength would be -1
if (this.mLauncher.contentLength >= 0) {
let [size, unit] = DownloadUtils.
convertByteUnits(this.mLauncher.contentLength);
type.value = this.dialogElement("strings")
- .getFormattedString("orderedFileSizeWithType",
+ .getFormattedString("orderedFileSizeWithType",
[typeString, size, unit]);
}
else {
type.value = typeString;
}
},
// Returns true if opening the default application makes sense.
@@ -801,17 +801,17 @@ nsUnknownContentTypeDialog.prototype = {
switch (this.dialogElement("openHandler").selectedIndex) {
case 0:
// No app need be specified in this case.
ok = true;
break;
case 1:
// only enable the OK button if we have a default app to use or if
// the user chose an app....
- ok = this.chosenApp || /\S/.test(this.dialogElement("otherHandler").getAttribute("path"));
+ ok = this.chosenApp || /\S/.test(this.dialogElement("otherHandler").getAttribute("path"));
break;
}
}
// Enable Ok button if ok to press.
this.mDialog.document.documentElement.getButton("accept").disabled = !ok;
},
@@ -1068,30 +1068,56 @@ nsUnknownContentTypeDialog.prototype = {
params.handlerApp.executable &&
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);
+ // handle the KDE case which is implemented in the filepicker
+ // therefore falling back to Gtk2 like behaviour if KDE is running
+ // FIXME this should be better handled in the nsIApplicationChooser interface
+ var env = Components.classes["@mozilla.org/process/environment;1"]
+ .getService(Components.interfaces.nsIEnvironment);
+ if (env.get('KDE_FULL_SESSION') == "true")
+ {
+ var nsIFilePicker = Components.interfaces.nsIFilePicker;
+ var fp = Components.classes["@mozilla.org/filepicker;1"]
+ .createInstance(nsIFilePicker);
+ fp.init(this.mDialog,
+ this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
+ nsIFilePicker.modeOpen);
+
+ fp.appendFilters(nsIFilePicker.filterApps);
+
+ if (fp.show() == nsIFilePicker.returnOK && fp.file) {
+ // Remember the file they chose to run.
+ var localHandlerApp =
+ Components.classes["@mozilla.org/uriloader/local-handler-app;1"].
+ createInstance(Components.interfaces.nsILocalHandlerApp);
+ localHandlerApp.executable = fp.file;
+ this.chosenApp = localHandlerApp;
}
- contentTypeDialogObj.finishChooseApp();
- };
- appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
- // The finishChooseApp is called from appChooserCallback
- return;
+ } else {
+ 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"]
.createInstance(nsIFilePicker);
fp.init(this.mDialog,
this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
nsIFilePicker.modeOpen);
diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
@@ -2282,15 +2408,15 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -48,17 +48,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'ui
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
EXPORTS += ['nsQAppInstance.h']
SOURCES += [
'!moc_nsNativeAppSupportQt.cpp',
'nsNativeAppSupportQt.cpp',
'nsQAppInstance.cpp',
@@ -40,17 +40,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
'updaterfileutils_osx.mm',
]
elif CONFIG['MOZ_ENABLE_GTK']:
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
UNIFIED_SOURCES += [
'nsNativeAppSupportDefault.cpp',
'UIKitDirProvider.mm',
]
elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+ EXPORTS += ['nsKDEUtils.h']
UNIFIED_SOURCES += [
+ 'nsKDEUtils.cpp',
@@ -2306,7 +2432,7 @@ diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
new file mode 100644
--- /dev/null
+++ b/toolkit/xre/nsKDEUtils.cpp
@@ -0,0 +1,339 @@
@@ -0,0 +1,344 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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
@@ -2327,6 +2453,11 @@ new file mode 100644
+#include <sys/resource.h>
+#include <unistd.h>
+#include <X11/Xlib.h>
+// copied from X11/X.h as a hack since for an unknown
+// reason it's not picked up from X11/X.h
+#ifndef None
+#define None 0L /* universal null resource or null atom */
+#endif
+
+//#define DEBUG_KDE
+#ifdef DEBUG_KDE
@@ -2702,14 +2833,14 @@ new file mode 100644
diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -75,17 +75,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'ui
else:
# These files can't be built in unified mode because they redefine LOG.
@@ -77,17 +77,19 @@ else:
SOURCES += [
osdir + '/nsOSHelperAppService.cpp',
]
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['MOZ_ENABLE_GTK']:
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
UNIFIED_SOURCES += [
+ 'unix/nsCommonRegistry.cpp',
'unix/nsGNOMERegistry.cpp',
@@ -2722,7 +2853,7 @@ diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
'android/nsExternalSharingAppService.cpp',
'android/nsExternalURLHandlerService.cpp',
'android/nsMIMEInfoAndroid.cpp',
@@ -129,16 +131,17 @@ include('/ipc/chromium/chromium-config.m
@@ -123,16 +125,17 @@ include('/ipc/chromium/chromium-config.m
FINAL_LIBRARY = 'xul'
@@ -2738,7 +2869,7 @@ diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
CXXFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('qt', 'gtk2', 'gtk3'):
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
CXXFLAGS += CONFIG['TK_CFLAGS']
diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
new file mode 100644
@@ -2966,13 +3097,12 @@ new file mode 100644
diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
@@ -7,32 +7,35 @@
#ifdef MOZ_WIDGET_QT
#if (MOZ_ENABLE_CONTENTACTION)
#include <contentaction/contentaction.h>
#include "nsContentHandlerApp.h"
#endif
#endif
@@ -1,50 +1,53 @@
/* -*- Mode: C++; tab-width: 3; 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 "nsMIMEInfoUnix.h"
-#include "nsGNOMERegistry.h"
@@ -2984,9 +3114,6 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
#ifdef MOZ_ENABLE_DBUS
#include "nsDBusHandlerApp.h"
#endif
#ifdef MOZ_WIDGET_QT
#include "nsMIMEInfoQt.h"
#endif
+#if defined(XP_UNIX) && !defined(XP_MACOSX)
+#include "nsKDEUtils.h"
+#endif
@@ -2994,17 +3121,14 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
nsresult
nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)
{
- nsresult rv = nsGNOMERegistry::LoadURL(aURI);
+ nsresult rv = nsCommonRegistry::LoadURL(aURI);
- return nsGNOMERegistry::LoadURL(aURI);
+ return nsCommonRegistry::LoadURL(aURI);
}
#ifdef MOZ_WIDGET_QT
if (NS_FAILED(rv)) {
rv = nsMIMEInfoQt::LoadUriInternal(aURI);
}
#endif
return rv;
@@ -45,24 +48,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo
NS_IMETHODIMP
nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval)
{
// if mDefaultApplication is set, it means the application has been set from
// either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to
// give the GNOME answer.
if (mDefaultApplication)
@@ -3032,7 +3156,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
if (*_retval)
return NS_OK;
@@ -97,16 +100,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
@@ -79,16 +82,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get()));
if (action.isValid()) {
action.trigger();
@@ -3158,7 +3282,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
--- a/widget/gtk/moz.build
+++ b/widget/gtk/moz.build
@@ -86,16 +86,17 @@ else:
@@ -101,16 +101,17 @@ else:
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
@@ -3267,8 +3391,8 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE)
@@ -595,8 +615,235 @@ nsFilePicker::Done(GtkWidget* file_choos
@@ -603,8 +623,235 @@ nsFilePicker::Done(GtkWidget* file_choos
if (mCallback) {
mCallback->Done(result);
mCallback = nullptr;
@@ -3531,25 +3655,25 @@ diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
--- a/xpcom/components/ManifestParser.cpp
+++ b/xpcom/components/ManifestParser.cpp
@@ -35,16 +35,17 @@
@@ -32,16 +32,17 @@
#include "nsTextFormatter.h"
#include "nsVersionComparator.h"
#include "nsXPCOMCIDInternal.h"
#include "nsIConsoleService.h"
#include "nsIScriptError.h"
#include "nsIXULAppInfo.h"
#include "nsIXULRuntime.h"
#ifdef MOZ_B2G_LOADER
#include "mozilla/XPTInterfaceInfoManager.h"
#endif
+#include "nsKDEUtils.h"
#ifdef MOZ_B2G_LOADER
#define XPTONLY_MANIFEST &nsComponentManagerImpl::XPTOnlyManifestManifest
#define XPTONLY_XPT &nsComponentManagerImpl::XPTOnlyManifestXPT
#else
#define XPTONLY_MANIFEST nullptr
#define XPTONLY_XPT nullptr
#endif
@@ -494,16 +495,17 @@ ParseManifest(NSLocationType aType, File
using namespace mozilla;
struct ManifestDirective
{
const char* directive;
int argc;
@@ -472,16 +473,17 @@ ParseManifest(NSLocationType aType, File
NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
NS_NAMED_LITERAL_STRING(kApplication, "application");
@@ -3567,7 +3691,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
NS_NAMED_LITERAL_STRING(kMain, "main");
NS_NAMED_LITERAL_STRING(kContent, "content");
@@ -554,44 +556,49 @@ ParseManifest(NSLocationType aType, File
@@ -532,44 +534,49 @@ ParseManifest(NSLocationType aType, File
CopyUTF8toUTF16(s, abi);
abi.Insert(char16_t('_'), 0);
abi.Insert(osTarget, 0);
@@ -3582,7 +3706,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
#pragma warning(disable:4996) // VC12+ deprecates GetVersionEx
OSVERSIONINFO info = { sizeof(OSVERSIONINFO) };
if (GetVersionEx(&info)) {
nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
info.dwMajorVersion,
info.dwMinorVersion);
}
@@ -3591,12 +3715,12 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
#elif defined(MOZ_WIDGET_COCOA)
SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor();
SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor();
nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
majorVersion,
minorVersion);
+ desktop = NS_LITERAL_STRING("macosx");
#elif defined(MOZ_WIDGET_GTK)
nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
gtk_major_version,
gtk_minor_version);
+ desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");
@@ -3606,7 +3730,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION",
"RELEASE",
osVersion);
isTablet = mozilla::widget::GeckoAppShell::IsTablet();
isTablet = java::GeckoAppShell::IsTablet();
}
+ desktop = NS_LITERAL_STRING("android");
#endif
@@ -3617,7 +3741,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
process = kMain;
}
@@ -694,25 +701,27 @@ ParseManifest(NSLocationType aType, File
@@ -672,25 +679,27 @@ ParseManifest(NSLocationType aType, File
TriState stOsVersion = eUnspecified;
TriState stOs = eUnspecified;
TriState stABI = eUnspecified;
@@ -3645,7 +3769,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
}
#if defined(MOZ_WIDGET_ANDROID)
@@ -762,16 +771,17 @@ ParseManifest(NSLocationType aType, File
@@ -740,16 +749,17 @@ ParseManifest(NSLocationType aType, File
}
if (!ok ||
@@ -3666,7 +3790,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
--- a/xpcom/components/moz.build
+++ b/xpcom/components/moz.build
@@ -47,12 +47,13 @@ FINAL_LIBRARY = 'xul'
@@ -44,12 +44,13 @@ FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'!..',
'../base',
@@ -3678,12 +3802,12 @@ diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
+ '/toolkit/xre'
]
if CONFIG['MOZ_WIDGET_GTK']:
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
CXXFLAGS += CONFIG['TK_CFLAGS']
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -47,16 +47,17 @@
@@ -46,16 +46,17 @@
#include "prproces.h"
#include "nsIDirectoryEnumerator.h"
#include "nsISimpleEnumerator.h"
@@ -3701,7 +3825,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
#include "prmem.h"
#include "plbase64.h"
@@ -1963,42 +1964,52 @@ nsLocalFile::SetPersistentDescriptor(con
@@ -1948,42 +1949,52 @@ nsLocalFile::SetPersistentDescriptor(con
return InitWithNativePath(aPersistentDescriptor);
#endif
}
@@ -3760,7 +3884,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
return rv;
}
return NS_ERROR_FAILURE;
@@ -2006,16 +2017,22 @@ nsLocalFile::Reveal()
@@ -1991,16 +2002,22 @@ nsLocalFile::Reveal()
return NS_ERROR_FAILURE;
#endif
}

View File

@@ -1,23 +1,22 @@
# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
# Parent 5a29924228527f8882c83cf62d470963ea1ce62e
# Parent 55b6ae7fd3ebf28f960031801f1948dfc1bd80d2
# Parent 4f39ed617c2f151a3a15903c7ae4471b66774e9e
Bug 583793 - Firefox interface language set to LANG, ignores LANGUAGE
diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp
--- a/intl/locale/nsLocaleService.cpp
+++ b/intl/locale/nsLocaleService.cpp
@@ -122,16 +122,17 @@ nsLocaleService::nsLocaleService(void)
@@ -114,16 +114,17 @@ nsLocaleService::nsLocaleService(void)
NS_ENSURE_SUCCESS_VOID(rv);
#endif
#if defined(XP_UNIX) && !defined(XP_MACOSX)
RefPtr<nsLocale> resultLocale(new nsLocale());
NS_ENSURE_TRUE_VOID(resultLocale);
#ifdef MOZ_WIDGET_QT
const char* lang = QLocale::system().name().toUtf8();
#else
// Get system configuration
const char* lang = getenv("LANG");
+ const char* language = getenv("LANGUAGE");
#endif
nsAutoString xpLocale, platformLocale;
nsAutoString category, category_platform;
@@ -25,7 +24,8 @@ diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp
for( i = 0; i < LocaleListLength; i++ ) {
nsresult result;
@@ -158,16 +159,21 @@ nsLocaleService::nsLocaleService(void)
// setlocale( , "") evaluates LC_* and LANG
@@ -149,16 +150,36 @@ nsLocaleService::nsLocaleService(void)
} else {
CopyASCIItoUTF16(lang, platformLocale);
result = nsPosixLocale::GetXPLocale(lang, xpLocale);
@@ -35,9 +35,24 @@ diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp
return;
}
+ // LANGUAGE is overriding LC_MESSAGES
+ // it can be a colon separated list of preferred languages
+ // as we do not recognize here if a language is available
+ // we actually only consider the first entry unless GetXPLocale
+ // fails completely
+ if (i == LC_MESSAGES && language && *language) {
+ CopyASCIItoUTF16(language, platformLocale);
+ result = nsPosixLocale::GetXPLocale(language, xpLocale);
+#define LANGUAGE_SEP ":"
+ nsAutoString xpLocale_temp;
+ char* rawBuffer = (char*) language;
+ char* token = nsCRT::strtok(rawBuffer, LANGUAGE_SEP, &rawBuffer);
+ for (; token;
+ token = nsCRT::strtok(rawBuffer, LANGUAGE_SEP, &rawBuffer)) {
+ result = nsPosixLocale::GetXPLocale(token, xpLocale_temp);
+ if (NS_SUCCEEDED(result)) {
+ CopyASCIItoUTF16(token, platformLocale);
+ xpLocale = xpLocale_temp;
+ break;
+ }
+ }
+ }
resultLocale->AddCategory(category, xpLocale);
resultLocale->AddCategory(category_platform, platformLocale);

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4c1817924bed48514d040191526a5c6f1f779b30cbed4829fe3a40209851e028
size 211944208

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:13f49dcf7a18af6d37bfed8e41d795b456fa5b4748cdd0306f962dfe32cc9198
size 240073876