--- a/mozilla-kde.patch Mon Jul 08 12:56:52 2019 +0200
+++ b/mozilla-kde.patch Wed Jul 10 08:14:34 2019 +0200
@@ -1,5 +1,9 @@
# HG changeset patch
-# Parent cafacdb0b7c50666e5dcc927684a23e8733206a5
+# User msirringhaus@suse.de
+# Date 1559294891 -7200
+# Fri May 31 11:28:11 2019 +0200
+# Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112
+# Parent f11c2d7239c0caa4dc74272716d9e30ced1a1ca3
Description: Add KDE integration to Firefox (toolkit parts)
Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
Author: Lubos Lunak <lunak@suse.com>
@@ -27,7 +31,7 @@
#ifdef XP_WIN
# include "windows.h"
#endif
-@@ -4493,25 +4494,37 @@ float MOZ_MAYBE_UNUSED GetPref<float>(co
+@@ -4507,25 +4508,37 @@ static nsresult pref_ReadDefaultPrefs(co
// application pref files for backwards compatibility.
static const char* specialFiles[] = {
#if defined(XP_MACOSX)
@@ -65,7 +69,7 @@
// Load jar:$app/omni.jar!/defaults/preferences/*.js
// or jar:$gre/omni.jar!/defaults/preferences/*.js.
-@@ -4559,17 +4572,17 @@ float MOZ_MAYBE_UNUSED GetPref<float>(co
+@@ -4573,17 +4586,17 @@ static nsresult pref_ReadDefaultPrefs(co
}
nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
@@ -183,18 +187,18 @@
+* 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/general.xml (widgets/general.xml)
- content/global/bindings/menu.xml (widgets/menu.xml)
content/global/bindings/popup.xml (widgets/popup.xml)
- content/global/bindings/radio.xml (widgets/radio.xml)
content/global/bindings/richlistbox.xml (widgets/richlistbox.xml)
content/global/bindings/scrollbox.xml (widgets/scrollbox.xml)
content/global/bindings/spinner.js (widgets/spinner.js)
content/global/bindings/tabbox.xml (widgets/tabbox.xml)
+ * content/global/bindings/textbox.xml (widgets/textbox.xml)
+ content/global/bindings/timekeeper.js (widgets/timekeeper.js)
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,507 @@
+@@ -0,0 +1,499 @@
+<?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
@@ -495,6 +499,10 @@
+ buttons.help = document.getAnonymousElementByAttribute(this, "dlgtype", "help");
+ buttons.disclosure = document.getAnonymousElementByAttribute(this, "dlgtype", "disclosure");
+
++ for (let button in buttons) {
++ customElements.upgrade(buttons[button]);
++ }
++
+ // look for any overriding explicit button elements
+ var exBtns = this.getElementsByAttribute("dlgtype", "*");
+ var dlgtype;
@@ -646,19 +654,7 @@
+ event.initEvent("dialog" + aDlgType, true, true);
+
+ // handle dom event handlers
-+ var noCancel = this.dispatchEvent(event);
-+
-+ // handle any xml attribute event handlers
-+ var handler = this.getAttribute("ondialog" + aDlgType);
-+ if (handler != "") {
-+ var fn = new Function("event", handler);
-+ var returned = fn(event);
-+ // eslint-disable-next-line mozilla/no-compare-against-boolean-literals
-+ if (returned == false)
-+ noCancel = false;
-+ }
-+
-+ return noCancel;
++ return this.dispatchEvent(event);
+ ]]>
+ </body>
+ </method>
@@ -705,7 +701,7 @@
diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm
--- a/toolkit/mozapps/downloads/HelperAppDlg.jsm
+++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm
-@@ -1030,30 +1030,60 @@ nsUnknownContentTypeDialog.prototype = {
+@@ -1042,30 +1042,60 @@ nsUnknownContentTypeDialog.prototype = {
if (params.handlerApp &&
params.handlerApp.executable &&
@@ -783,7 +779,7 @@
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
-@@ -15,16 +15,17 @@
+@@ -14,16 +14,17 @@
#include "nsPrintfCString.h"
#include "nsNetCID.h"
#include "nsNetUtil.h"
@@ -801,10 +797,10 @@
NS_DECL_ISUPPORTS
NS_DECL_NSISYSTEMPROXYSETTINGS
-@@ -44,16 +45,18 @@ class nsUnixSystemProxySettings final :
- nsACString& aResult);
- nsresult GetProxyFromGConf(const nsACString& aScheme, const nsACString& aHost,
- int32_t aPort, nsACString& aResult);
+@@ -37,16 +38,18 @@ class nsUnixSystemProxySettings final :
+ nsCOMPtr<nsIGSettingsCollection> mProxySettings;
+ nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection>
+ mSchemeProxySettings;
nsresult GetProxyFromGSettings(const nsACString& aScheme,
const nsACString& aHost, int32_t aPort,
nsACString& aResult);
@@ -820,7 +816,7 @@
nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
// dbus prevents us from being threadsafe, but this routine should not block
// anyhow
-@@ -487,22 +490,51 @@ nsresult nsUnixSystemProxySettings::GetP
+@@ -382,21 +385,50 @@ nsresult nsUnixSystemProxySettings::GetP
return NS_OK;
}
@@ -836,7 +832,6 @@
nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult);
if (NS_SUCCEEDED(rv)) return rv;
}
- if (mGConf) return GetProxyFromGConf(aScheme, aHost, aPort, aResult);
return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult);
}
@@ -943,7 +938,7 @@
+ Display* dpy = XOpenDisplay( NULL );
+ if( dpy == NULL )
+ return false;
-+ Atom kde_full_session = XInternAtom( dpy, "KDE_FULL_SESSION", True );
++ Atom kde_full_session = XInternAtom( dpy, "KDE_FULL_SESSION", true );
+ bool kde = false;
+ if( kde_full_session != None )
+ {
@@ -1300,7 +1295,8 @@
diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandler/HandlerServiceParent.cpp
--- a/uriloader/exthandler/HandlerServiceParent.cpp
+++ b/uriloader/exthandler/HandlerServiceParent.cpp
-@@ -1,16 +1,16 @@
+@@ -1,17 +1,17 @@
+ #include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/Logging.h"
#include "HandlerServiceParent.h"
#include "nsIHandlerService.h"
@@ -1318,13 +1314,13 @@
using mozilla::dom::RemoteHandlerApp;
namespace {
-@@ -246,17 +246,17 @@ mozilla::ipc::IPCResult HandlerServicePa
- handlerSvc->Exists(info, exists);
- return IPC_OK();
- }
-
- mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocol(
+@@ -282,17 +282,17 @@ mozilla::ipc::IPCResult HandlerServicePa
+ mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS(
const nsCString& aProtocolScheme, bool* aHandlerExists) {
+ if (aProtocolScheme.Length() > MAX_SCHEME_LENGTH) {
+ *aHandlerExists = false;
+ return IPC_OK();
+ }
#ifdef MOZ_WIDGET_GTK
// Check the GNOME registry for a protocol handler
- *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme.get());
@@ -1335,12 +1331,31 @@
return IPC_OK();
}
- mozilla::ipc::IPCResult HandlerServiceParent::RecvGetTypeFromExtension(
- const nsCString& aFileExtension, nsCString* type) {
+ /*
+ * Check if a handler exists for the provided protocol. Check the datastore
+@@ -311,17 +311,17 @@ mozilla::ipc::IPCResult HandlerServicePa
+ nsCOMPtr<nsIExternalProtocolService> protoSvc =
+ do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &rv);
+ if (NS_WARN_IF(NS_FAILED(rv))) {
+ *aHandlerExists = false;
+ return IPC_OK();
+ }
+ rv = protoSvc->ExternalProtocolHandlerExists(aProtocolScheme.get(),
+ aHandlerExists);
+-
++##
+ if (NS_WARN_IF(NS_FAILED(rv))) {
+ *aHandlerExists = false;
+ }
+ #else
+ MOZ_RELEASE_ASSERT(false, "No implementation on this platform.");
+ *aHandlerExists = false;
+ #endif
+ return IPC_OK();
diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
-@@ -80,17 +80,19 @@ else:
+@@ -83,17 +83,19 @@ else:
SOURCES += [
osdir + '/nsOSHelperAppService.cpp',
]
@@ -1360,7 +1375,7 @@
'android/nsExternalURLHandlerService.cpp',
'android/nsMIMEInfoAndroid.cpp',
]
-@@ -130,16 +132,17 @@ include('/ipc/chromium/chromium-config.m
+@@ -133,16 +135,17 @@ include('/ipc/chromium/chromium-config.m
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
@@ -1624,13 +1639,13 @@
+#include "nsKDEUtils.h"
+#endif
- nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI *aURI) {
+ nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI* aURI) {
- return nsGNOMERegistry::LoadURL(aURI);
+ return nsCommonRegistry::LoadURL(aURI);
}
NS_IMETHODIMP
- nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval) {
+ 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.
@@ -1794,7 +1809,7 @@
diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
--- a/widget/gtk/moz.build
+++ b/widget/gtk/moz.build
-@@ -121,16 +121,17 @@ include('/ipc/chromium/chromium-config.m
+@@ -124,16 +124,17 @@ include('/ipc/chromium/chromium-config.m
FINAL_LIBRARY = 'xul'
@@ -1849,14 +1864,14 @@
// bug 1184009
#define MAX_PREVIEW_SOURCE_SIZE 4096
- nsIFile *nsFilePicker::mPrevDisplayDirectory = nullptr;
+ nsIFile* nsFilePicker::mPrevDisplayDirectory = nullptr;
@@ -227,17 +229,19 @@ nsFilePicker::AppendFilters(int32_t aFil
mAllowURLs = !!(aFilterMask & filterAllowURLs);
return nsBaseFilePicker::AppendFilters(aFilterMask);
}
NS_IMETHODIMP
- nsFilePicker::AppendFilter(const nsAString &aTitle, const nsAString &aFilter) {
+ nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) {
if (aFilter.EqualsLiteral("..apps")) {
// No platform specific thing we can do here, really....
- return NS_OK;
@@ -1871,12 +1886,12 @@
mFilters.AppendElement(filter);
mFilterNames.AppendElement(name);
-@@ -337,16 +341,39 @@ nsresult nsFilePicker::Show(int16_t *aRe
+@@ -337,16 +341,39 @@ nsresult nsFilePicker::Show(int16_t* aRe
return NS_OK;
}
NS_IMETHODIMP
- nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) {
+ nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) {
// Can't show two dialogs concurrently with the same filepicker
if (mRunning) return NS_ERROR_NOT_AVAILABLE;
@@ -1906,12 +1921,12 @@
nsCString title;
title.Adopt(ToNewUTF8String(mTitle));
- GtkWindow *parent_widget =
+ GtkWindow* parent_widget =
GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
-@@ -572,16 +599,240 @@ void nsFilePicker::Done(void *file_choos
+@@ -572,16 +599,240 @@ void nsFilePicker::Done(void* file_choos
mCallback->Done(result);
mCallback = nullptr;
} else {
@@ -2145,13 +2160,13 @@
+ }
+
// All below functions available as of GTK 3.20+
- void *nsFilePicker::GtkFileChooserNew(const gchar *title, GtkWindow *parent,
+ void* nsFilePicker::GtkFileChooserNew(const gchar* title, GtkWindow* parent,
GtkFileChooserAction action,
- const gchar *accept_label) {
+ const gchar* accept_label) {
static auto sGtkFileChooserNativeNewPtr =
- (void *(*)(const gchar *, GtkWindow *, GtkFileChooserAction,
- const gchar *,
- const gchar *))dlsym(RTLD_DEFAULT,
+ (void* (*)(const gchar*, GtkWindow*, GtkFileChooserAction, const gchar*,
+ const gchar*))dlsym(RTLD_DEFAULT,
+ "gtk_file_chooser_native_new");
diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
--- a/widget/gtk/nsFilePicker.h
+++ b/widget/gtk/nsFilePicker.h
@@ -2162,7 +2177,7 @@
nsTArray<nsCString> mFilterNames;
private:
- static nsIFile *mPrevDisplayDirectory;
+ static nsIFile* mPrevDisplayDirectory;
+ bool kdeRunning();
+ bool getKdeRunning();
@@ -2170,12 +2185,12 @@
+ NS_IMETHODIMP kdeAppsDialog(PRInt16 *aReturn);
+ nsCString kdeMakeFilter( int index );
+
- void *GtkFileChooserNew(const gchar *title, GtkWindow *parent,
+ void* GtkFileChooserNew(const gchar* title, GtkWindow* parent,
GtkFileChooserAction action,
- const gchar *accept_label);
- void GtkFileChooserShow(void *file_chooser);
- void GtkFileChooserDestroy(void *file_chooser);
- void GtkFileChooserSetModal(void *file_chooser, GtkWindow *parent_widget,
+ const gchar* accept_label);
+ void GtkFileChooserShow(void* file_chooser);
+ void GtkFileChooserDestroy(void* file_chooser);
+ void GtkFileChooserSetModal(void* file_chooser, GtkWindow* parent_widget,
gboolean modal);
diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
@@ -2199,7 +2214,7 @@
int argc;
bool ischrome;
-@@ -392,16 +393,17 @@ void ParseManifest(NSLocationType aType,
+@@ -393,16 +394,17 @@ void ParseManifest(NSLocationType aType,
NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
NS_NAMED_LITERAL_STRING(kApplication, "application");
@@ -2217,7 +2232,7 @@
NS_NAMED_LITERAL_STRING(kMain, "main");
NS_NAMED_LITERAL_STRING(kContent, "content");
-@@ -447,39 +449,44 @@ void ParseManifest(NSLocationType aType,
+@@ -448,39 +450,44 @@ void ParseManifest(NSLocationType aType,
CopyUTF8toUTF16(s, abi);
abi.Insert(char16_t('_'), 0);
abi.Insert(osTarget, 0);
@@ -2262,7 +2277,7 @@
process = kMain;
}
-@@ -566,25 +573,27 @@ void ParseManifest(NSLocationType aType,
+@@ -567,25 +574,27 @@ void ParseManifest(NSLocationType aType,
TriState stOsVersion = eUnspecified;
TriState stOs = eUnspecified;
TriState stABI = eUnspecified;
@@ -2290,7 +2305,7 @@
continue;
}
-@@ -621,17 +630,17 @@ void ParseManifest(NSLocationType aType,
+@@ -622,17 +631,17 @@ void ParseManifest(NSLocationType aType,
}
LogMessageWithContext(
@@ -2312,7 +2327,7 @@
diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
--- a/xpcom/components/moz.build
+++ b/xpcom/components/moz.build
-@@ -66,14 +66,15 @@ LOCAL_INCLUDES += [
+@@ -66,16 +66,17 @@ LOCAL_INCLUDES += [
'!..',
'../base',
'../build',
@@ -2327,7 +2342,9 @@
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
CXXFLAGS += CONFIG['TK_CFLAGS']
- include('/ipc/chromium/chromium-config.mozbuild')
+ if CONFIG['MOZ_LAYOUT_DEBUGGER']:
+ DEFINES['MOZ_LAYOUT_DEBUGGER'] = True
+
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp