diff -r 84cdfb476431 -r 8e9195853a32 mozilla-kde.patch --- a/mozilla-kde.patch Sun Mar 17 10:00:10 2019 +0100 +++ b/mozilla-kde.patch Tue Nov 19 22:54:22 2019 +0100 @@ -1,5 +1,9 @@ # HG changeset patch -# Parent ff3da33eabc1d8760ec41a87afbaf44ded300ede +# User msirringhaus@suse.de +# Date 1559294891 -7200 +# Fri May 31 11:28:11 2019 +0200 +# Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112 +# Parent 86d7ace0b36abf542e56fbb702a5f9b308b9bf77 Description: Add KDE integration to Firefox (toolkit parts) Author: Wolfgang Rosenauer Author: Lubos Lunak @@ -9,8 +13,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp -@@ -81,16 +81,17 @@ - #include "nsXPCOMCID.h" +@@ -88,16 +88,17 @@ #include "nsXPCOM.h" #include "nsXULAppAPI.h" #include "nsZipArchive.h" @@ -18,16 +21,17 @@ #include "PLDHashTable.h" #include "plstr.h" #include "prlink.h" + #include "xpcpublic.h" +#include "nsKDEUtils.h" + #ifdef DEBUG + # include + #endif + #ifdef MOZ_MEMORY - #include "mozmemory.h" + # include "mozmemory.h" #endif - - #ifdef XP_WIN - #include "windows.h" - #endif -@@ -4466,25 +4467,37 @@ float MOZ_MAYBE_UNUSED GetPref(co +@@ -4542,25 +4543,37 @@ nsresult Preferences::InitInitialObjects // application pref files for backwards compatibility. static const char* specialFiles[] = { #if defined(XP_MACOSX) @@ -37,10 +41,10 @@ #elif defined(XP_UNIX) "unix.js" + , "" // placeholder for KDE (empty is otherwise harmless) - #if defined(_AIX) + # if defined(_AIX) , "aix.js" - #endif + # endif #elif defined(XP_BEOS) "beos.js" #endif @@ -65,7 +69,7 @@ // Load jar:$app/omni.jar!/defaults/preferences/*.js // or jar:$gre/omni.jar!/defaults/preferences/*.js. -@@ -4532,17 +4545,17 @@ float MOZ_MAYBE_UNUSED GetPref(co +@@ -4606,17 +4619,17 @@ nsresult Preferences::InitInitialObjects } nsCOMPtr path = do_QueryInterface(elem); @@ -87,9 +91,9 @@ diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build --- a/modules/libpref/moz.build +++ b/modules/libpref/moz.build -@@ -31,16 +31,20 @@ EXPORTS.mozilla += [ - 'StaticPrefs.h', +@@ -110,16 +110,20 @@ EXPORTS.mozilla += [ ] + EXPORTS.mozilla += sorted(['!' + g for g in gen_h]) UNIFIED_SOURCES += [ 'Preferences.cpp', @@ -97,21 +101,21 @@ ] +LOCAL_INCLUDES += [ -+ '/toolkit/xre' ++ '/toolkit/xre' +] + - include('/ipc/chromium/chromium-config.mozbuild') + gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs) - FINAL_LIBRARY = 'xul' + GENERATED_FILES += [gen_all_tuple] - DEFINES['OS_ARCH'] = CONFIG['OS_ARCH'] - DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT'] - if CONFIG['MOZ_ENABLE_WEBRENDER']: - DEFINES['MOZ_ENABLE_WEBRENDER'] = True + static_pref_list = GENERATED_FILES[gen_all_tuple] + static_pref_list.script = 'init/generate_static_pref_list.py:emit_code' + static_pref_list.inputs = ['init/StaticPrefList.yaml'] + 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 -@@ -220,16 +220,17 @@ class Flags(OrderedDict): +@@ -227,16 +227,17 @@ class Flags(OrderedDict): 'contentaccessible': Flag, 'os': StringFlag, 'osversion': VersionFlag, @@ -132,7 +136,7 @@ diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py --- a/python/mozbuild/mozpack/chrome/manifest.py +++ b/python/mozbuild/mozpack/chrome/manifest.py -@@ -39,16 +39,17 @@ class ManifestEntry(object): +@@ -36,16 +36,17 @@ class ManifestEntry(object): 'platformversion', 'os', 'osversion', @@ -153,7 +157,7 @@ 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 -@@ -41,10 +41,14 @@ EXTRA_JS_MODULES += [ +@@ -41,10 +41,14 @@ XPCOM_MANIFESTS += [ if CONFIG['MOZ_PLACES']: EXTRA_JS_MODULES += [ @@ -168,530 +172,32 @@ + with Files('**'): BUG_COMPONENT = ('Toolkit', 'Downloads API') -diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn ---- a/toolkit/content/jar.mn -+++ b/toolkit/content/jar.mn -@@ -67,16 +67,18 @@ toolkit.jar: - content/global/bindings/calendar.js (widgets/calendar.js) - content/global/bindings/checkbox.xml (widgets/checkbox.xml) - content/global/bindings/datekeeper.js (widgets/datekeeper.js) - content/global/bindings/datepicker.js (widgets/datepicker.js) - 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/general.xml (widgets/general.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/radio.xml (widgets/radio.xml) - content/global/bindings/richlistbox.xml (widgets/richlistbox.xml) -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,477 @@ -+ -+ -+ -+ -+ %globalKeysDTD; -+]> -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+#else -+ keycode="&openHelp.commandkey;"/> -+#endif -+ -+ -+ -+ -+ -+ null -+ (function(event) { -+ if (!document.documentElement.cancelDialog()) -+ event.preventDefault(); -+ }) -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ (screen.availLeft + screen.availWidth)) -+ newX = (screen.availLeft + screen.availWidth) - window.outerWidth - 20; -+ -+ if (newY < screen.availTop) -+ newY = screen.availTop + 20; -+ if ((newY + window.outerHeight) > (screen.availTop + screen.availHeight)) -+ newY = (screen.availTop + screen.availHeight) - window.outerHeight - 60; -+ -+ window.moveTo( newX, newY ); -+ ]]> -+ -+ -+ -+ -+ -+ 0 ? xOffset : 0; -+ yOffset = yOffset > 0 ? yOffset : 0; -+ window.moveTo(xOffset, yOffset); -+ ]]> -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ // see bug 63370 for details -+ this._mStrBundle = Cc["@mozilla.org/intl/stringbundle;1"] -+ .getService(Ci.nsIStringBundleService) -+ .createBundle("chrome://global/locale/dialog.properties"); -+ } -+ return this._mStrBundle; -+ ]]> -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ if (!event.defaultPrevented) -+ this.cancelDialog(); -+ -+#ifdef XP_MACOSX -+ -+#else -+ -+ var btn = this.getButton(this.defaultButton); -+ if (btn) -+ btn.setAttribute("default", event.originalTarget == btn || !(event.originalTarget instanceof Ci.nsIDOMXULButtonElement)); -+ -+#endif -+ -+ -+ -+ -+ -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 -@@ -1030,30 +1030,60 @@ nsUnknownContentTypeDialog.prototype = { - - if (params.handlerApp && - params.handlerApp.executable && - params.handlerApp.executable.isFile()) { +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 +@@ -1199,36 +1199,66 @@ nsUnknownContentTypeDialog.prototype = { + params.handlerApp && + params.handlerApp.executable && + params.handlerApp.executable.isFile() + ) { // Remember the file they chose to run. this.chosenApp = params.handlerApp; } } else if ("@mozilla.org/applicationchooser;1" in Cc) { - var nsIApplicationChooser = Ci.nsIApplicationChooser; -- var appChooser = Cc["@mozilla.org/applicationchooser;1"] -- .createInstance(nsIApplicationChooser); -- appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle")); +- var appChooser = Cc["@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(Ci.nsILocalHandlerApp); +- contentTypeDialogObj.chosenApp = aResult.QueryInterface( +- Ci.nsILocalHandlerApp +- ); - } - contentTypeDialogObj.finishChooseApp(); - }; @@ -728,13 +234,19 @@ + }); + } else { + var nsIApplicationChooser = Ci.nsIApplicationChooser; -+ var appChooser = Cc["@mozilla.org/applicationchooser;1"] -+ .createInstance(nsIApplicationChooser); -+ appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle")); ++ var appChooser = Cc["@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(Ci.nsILocalHandlerApp); ++ contentTypeDialogObj.chosenApp = aResult.QueryInterface( ++ Ci.nsILocalHandlerApp ++ ); + } + contentTypeDialogObj.finishChooseApp(); + }; @@ -744,16 +256,16 @@ + } } else { var nsIFilePicker = Ci.nsIFilePicker; - var fp = Cc["@mozilla.org/filepicker;1"] - .createInstance(nsIFilePicker); - fp.init(this.mDialog, - this.dialogElement("strings").getString("chooseAppFilePickerTitle"), - nsIFilePicker.modeOpen); - + var fp = Cc["@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 -@@ -15,16 +15,17 @@ +@@ -14,16 +14,17 @@ #include "nsPrintfCString.h" #include "nsNetCID.h" #include "nsNetUtil.h" @@ -764,17 +276,17 @@ #include "nsIURI.h" +#include "nsKDEUtils.h" + using namespace mozilla; + class nsUnixSystemProxySettings final : public nsISystemProxySettings { public: NS_DECL_ISUPPORTS NS_DECL_NSISYSTEMPROXYSETTINGS - nsUnixSystemProxySettings() : mSchemeProxySettings(4) {} - nsresult Init(); -@@ -42,16 +43,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 mProxySettings; + nsInterfaceHashtable + mSchemeProxySettings; nsresult GetProxyFromGSettings(const nsACString& aScheme, const nsACString& aHost, int32_t aPort, nsACString& aResult); @@ -790,7 +302,7 @@ nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) { // dbus prevents us from being threadsafe, but this routine should not block // anyhow -@@ -488,16 +491,19 @@ nsresult nsUnixSystemProxySettings::GetP +@@ -381,21 +384,50 @@ nsresult nsUnixSystemProxySettings::GetP return NS_OK; } @@ -806,20 +318,10 @@ 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); } -@@ -521,8 +527,34 @@ static const mozilla::Module::CIDEntry k - static const mozilla::Module::ContractIDEntry kUnixProxyContracts[] = { - {NS_SYSTEMPROXYSETTINGS_CONTRACTID, &kNS_UNIXSYSTEMPROXYSERVICE_CID}, - {nullptr}}; - static const mozilla::Module kUnixProxyModule = { - mozilla::Module::kVersion, kUnixProxyCIDs, kUnixProxyContracts}; - - NSMODULE_DEFN(nsUnixProxyModule) = &kUnixProxyModule; -+ +nsresult +nsUnixSystemProxySettings::GetProxyFromKDE(const nsACString& aScheme, + const nsACString& aHost, @@ -845,10 +347,16 @@ + return NS_OK; +} + ++ + NS_IMPL_COMPONENT_FACTORY(nsUnixSystemProxySettings) { + auto result = MakeRefPtr(); + result->Init(); + return result.forget().downcast(); + } diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build --- a/toolkit/xre/moz.build +++ b/toolkit/xre/moz.build -@@ -73,17 +73,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co +@@ -85,17 +85,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co '../components/printingui', ] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit': @@ -856,7 +364,7 @@ 'nsNativeAppSupportDefault.cpp', 'UIKitDirProvider.mm', ] - elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: + elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': + EXPORTS += ['nsKDEUtils.h'] UNIFIED_SOURCES += [ + 'nsKDEUtils.cpp', @@ -867,7 +375,7 @@ 'nsNativeAppSupportDefault.cpp', ] - if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3': + if CONFIG['MOZ_HAS_REMOTE']: diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp new file mode 100644 --- /dev/null @@ -916,7 +424,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 ) + { @@ -1273,7 +781,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 @@ +@@ -7,17 +7,17 @@ + #include "mozilla/ipc/ProtocolUtils.h" #include "mozilla/Logging.h" #include "HandlerServiceParent.h" #include "nsIHandlerService.h" @@ -1281,8 +790,8 @@ #include "ContentHandlerService.h" #include "nsStringEnumerator.h" #ifdef MOZ_WIDGET_GTK --#include "unix/nsGNOMERegistry.h" -+#include "unix/nsCommonRegistry.h" +-# include "unix/nsGNOMERegistry.h" ++# include "unix/nsCommonRegistry.h" #endif using mozilla::dom::ContentHandlerService; @@ -1291,13 +800,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( +@@ -288,17 +288,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()); @@ -1308,19 +817,38 @@ 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 +@@ -317,17 +317,17 @@ mozilla::ipc::IPCResult HandlerServicePa + nsCOMPtr 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 -@@ -76,17 +76,19 @@ else: +@@ -83,17 +83,19 @@ else: SOURCES += [ osdir + '/nsOSHelperAppService.cpp', ] if CONFIG['CC_TYPE'] in ('clang', 'gcc'): CXXFLAGS += ['-Wno-error=shadow'] - if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': UNIFIED_SOURCES += [ + 'unix/nsCommonRegistry.cpp', 'unix/nsGNOMERegistry.cpp', @@ -1333,7 +861,7 @@ 'android/nsExternalURLHandlerService.cpp', 'android/nsMIMEInfoAndroid.cpp', ] -@@ -120,16 +122,17 @@ include('/ipc/chromium/chromium-config.m +@@ -133,16 +135,17 @@ include('/ipc/chromium/chromium-config.m FINAL_LIBRARY = 'xul' LOCAL_INCLUDES += [ @@ -1349,7 +877,7 @@ CXXFLAGS += CONFIG['TK_CFLAGS'] CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS'] - if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3': + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': CXXFLAGS += CONFIG['TK_CFLAGS'] diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp new file mode 100644 @@ -1591,19 +1119,19 @@ #include "nsIIOService.h" #include "nsAutoPtr.h" #ifdef MOZ_ENABLE_DBUS - #include "nsDBusHandlerApp.h" + # include "nsDBusHandlerApp.h" #endif +#if defined(XP_UNIX) && !defined(XP_MACOSX) +#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. @@ -1678,8 +1206,8 @@ #include "nsOSHelperAppService.h" #include "nsMIMEInfoUnix.h" #ifdef MOZ_WIDGET_GTK --#include "nsGNOMERegistry.h" -+#include "nsCommonRegistry.h" +-# include "nsGNOMERegistry.h" ++# include "nsCommonRegistry.h" #endif #include "nsISupports.h" #include "nsString.h" @@ -1688,7 +1216,7 @@ #include "nsIURL.h" #include "nsIFileStreams.h" #include "nsILineInputStream.h" -@@ -1031,17 +1031,17 @@ nsresult nsOSHelperAppService::GetHandle +@@ -1025,17 +1025,17 @@ nsresult nsOSHelperAppService::GetHandle nsresult nsOSHelperAppService::OSProtocolHandlerExists( const char* aProtocolScheme, bool* aHandlerExists) { @@ -1707,7 +1235,7 @@ nsCOMPtr handlerSvc = do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv); if (NS_SUCCEEDED(rv) && handlerSvc) { -@@ -1051,17 +1051,17 @@ nsresult nsOSHelperAppService::OSProtoco +@@ -1045,17 +1045,17 @@ nsresult nsOSHelperAppService::OSProtoco } return rv; @@ -1726,7 +1254,7 @@ nsresult nsOSHelperAppService::GetFileTokenForPath( const char16_t* platformAppPath, nsIFile** aFile) { -@@ -1142,17 +1142,17 @@ already_AddRefed nsOSHel +@@ -1136,17 +1136,17 @@ already_AddRefed nsOSHel nsresult rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, minorType, mime_types_description, true); @@ -1745,7 +1273,7 @@ rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, minorType, mime_types_description, false); -@@ -1254,17 +1254,17 @@ already_AddRefed nsOSHel +@@ -1248,17 +1248,17 @@ already_AddRefed nsOSHel // Now look up our extensions nsAutoString extensions, mime_types_description; @@ -1767,7 +1295,7 @@ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build -@@ -116,16 +116,17 @@ include('/ipc/chromium/chromium-config.m +@@ -126,16 +126,17 @@ include('/ipc/chromium/chromium-config.m FINAL_LIBRARY = 'xul' @@ -1788,7 +1316,7 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp --- a/widget/gtk/nsFilePicker.cpp +++ b/widget/gtk/nsFilePicker.cpp -@@ -4,32 +4,34 @@ +@@ -4,16 +4,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/Types.h" @@ -1801,11 +1329,12 @@ #include "nsGtkUtils.h" #include "nsIFileURL.h" + #include "nsIGIOService.h" #include "nsIURI.h" #include "nsIWidget.h" #include "nsIFile.h" #include "nsIStringBundle.h" - +@@ -21,16 +22,17 @@ #include "nsArrayEnumerator.h" #include "nsMemory.h" #include "nsEnumeratorUtils.h" @@ -1822,14 +1351,14 @@ // bug 1184009 #define MAX_PREVIEW_SOURCE_SIZE 4096 - nsIFile *nsFilePicker::mPrevDisplayDirectory = nullptr; -@@ -227,17 +229,19 @@ nsFilePicker::AppendFilters(int32_t aFil + nsIFile* nsFilePicker::mPrevDisplayDirectory = nullptr; +@@ -228,17 +230,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; @@ -1844,12 +1373,12 @@ mFilters.AppendElement(filter); mFilterNames.AppendElement(name); -@@ -337,16 +341,39 @@ nsresult nsFilePicker::Show(int16_t *aRe +@@ -338,16 +342,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; @@ -1879,12 +1408,12 @@ nsCString title; title.Adopt(ToNewUTF8String(mTitle)); - GtkWindow *parent_widget = + GtkWindow* parent_widget = GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); GtkFileChooserAction action = GetGtkFileChooserAction(mMode); -@@ -571,16 +598,240 @@ void nsFilePicker::Done(void *file_choos +@@ -573,16 +600,240 @@ void nsFilePicker::Done(void* file_choos mCallback->Done(result); mCallback = nullptr; } else { @@ -2118,13 +1647,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 @@ -2135,7 +1664,7 @@ nsTArray mFilterNames; private: - static nsIFile *mPrevDisplayDirectory; + static nsIFile* mPrevDisplayDirectory; + bool kdeRunning(); + bool getKdeRunning(); @@ -2143,12 +1672,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 @@ -2172,7 +1701,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"); @@ -2190,7 +1719,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); @@ -2201,15 +1730,15 @@ nsAutoString osVersion; + nsAutoString desktop; #if defined(XP_WIN) - #pragma warning(push) - #pragma warning(disable : 4996) // VC12+ deprecates GetVersionEx + # pragma warning(push) + # pragma warning(disable : 4996) // VC12+ deprecates GetVersionEx OSVERSIONINFO info = {sizeof(OSVERSIONINFO)}; if (GetVersionEx(&info)) { nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", info.dwMajorVersion, info.dwMinorVersion); } + desktop = NS_LITERAL_STRING("win"); - #pragma warning(pop) + # pragma warning(pop) #elif defined(MOZ_WIDGET_COCOA) SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor(); SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor(); @@ -2235,7 +1764,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; @@ -2263,7 +1792,7 @@ continue; } -@@ -621,17 +630,17 @@ void ParseManifest(NSLocationType aType, +@@ -622,17 +631,17 @@ void ParseManifest(NSLocationType aType, } LogMessageWithContext( @@ -2285,7 +1814,7 @@ diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build --- a/xpcom/components/moz.build +++ b/xpcom/components/moz.build -@@ -44,12 +44,13 @@ LOCAL_INCLUDES += [ +@@ -66,16 +66,17 @@ LOCAL_INCLUDES += [ '!..', '../base', '../build', @@ -2297,8 +1826,12 @@ + '/toolkit/xre', ] - if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': CXXFLAGS += CONFIG['TK_CFLAGS'] + + 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 @@ -2310,15 +1843,15 @@ #include "prlink.h" #ifdef MOZ_WIDGET_GTK - #include "nsIGIOService.h" -+#include "nsKDEUtils.h" + # include "nsIGIOService.h" ++# include "nsKDEUtils.h" #endif #ifdef MOZ_WIDGET_COCOA - #include - #include "CocoaFileUtils.h" - #include "prmem.h" - #include "plbase64.h" + # include + # include "CocoaFileUtils.h" + # include "prmem.h" + # include "plbase64.h" @@ -1902,62 +1903,77 @@ nsLocalFile::SetPersistentDescriptor(con