diff -r c360e9aac24a -r 9fc447b00040 mozilla-kde.patch --- a/mozilla-kde.patch Sun Sep 17 10:06:24 2017 +0200 +++ b/mozilla-kde.patch Wed Sep 20 21:52:01 2017 +0200 @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 172cd661ceed38b3161c6246f6729f4d8370dce3 +# Parent faadbf89d1cb02eefec4c5dfd3ab86bc20d815d5 Description: Add KDE integration to Firefox (toolkit parts) Author: Wolfgang Rosenauer Author: Lubos Lunak @@ -9,7 +9,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp -@@ -32,16 +32,17 @@ +@@ -33,16 +33,17 @@ #include "nsIZipReader.h" #include "nsPrefBranch.h" #include "nsXPIDLString.h" @@ -27,7 +27,7 @@ #include "prefread.h" #include "prefapi_private_data.h" -@@ -1219,16 +1220,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char +@@ -1435,16 +1436,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char static nsresult pref_LoadPrefsInDirList(const char *listId) { @@ -62,7 +62,7 @@ return NS_OK; bool hasMore; -@@ -1244,17 +1263,17 @@ static nsresult pref_LoadPrefsInDirList( +@@ -1460,17 +1479,17 @@ static nsresult pref_LoadPrefsInDirList( nsAutoCString leaf; path->GetNativeLeafName(leaf); @@ -81,7 +81,7 @@ { nsZipItemPtr manifest(jarReader, name, true); NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE); -@@ -1348,24 +1367,36 @@ static nsresult pref_InitInitialObjects( +@@ -1566,24 +1585,36 @@ 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) @@ -706,7 +706,7 @@ new file mode 100644 --- /dev/null +++ b/toolkit/content/widgets/preferences-kde.xml -@@ -0,0 +1,1380 @@ +@@ -0,0 +1,1409 @@ + + + + + elements is constructed. Its purpose is to propagate -+ // the values to the associated form elements ++ // the values to the associated form elements. Sometimes the code for ++ // some initializers depend on other elements ++ // being initialized so we wait and call updateElements on all of them ++ // once the last one has been constructed. See bugs 997570 and 992185. + + var elements = this.getElementsByTagName("preference"); + for (let element of elements) { -+ if (!element._constructed) { -+ return; -+ } -+ } -+ for (let element of elements) { + element.updateElements(); + } ++ ++ this._constructAfterChildrenCalled = true; + ]]> + + @@ -821,6 +821,25 @@ + ]]> + + ++ ++ ++ 0 ++ null ++ ++ false ++ ++ ++ + + + @@ -828,8 +847,6 @@ + + + was added after _constructAfterChildren() was already called. ++ // We can directly call updateElements(). ++ this.updateElements(); ++ return; ++ } ++ this.preferences._constructedChildrenCount++; ++ if (this.preferences._constructedChildrenCount == ++ this.preferences._preferenceChildren.length) { ++ // This is the last , time to updateElements() on all of them. ++ this.preferences._constructAfterChildren(); ++ } + ]]> + + @@ -2090,7 +2119,7 @@ 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 -@@ -625,17 +625,17 @@ nsUnknownContentTypeDialog.prototype = { +@@ -628,17 +628,17 @@ nsUnknownContentTypeDialog.prototype = { else typeString = mimeInfo.MIMEType; } @@ -2109,7 +2138,7 @@ }, // Returns true if opening the default application makes sense. -@@ -799,17 +799,17 @@ nsUnknownContentTypeDialog.prototype = { +@@ -802,17 +802,17 @@ nsUnknownContentTypeDialog.prototype = { switch (this.dialogElement("openHandler").selectedIndex) { case 0: // No app need be specified in this case. @@ -2128,15 +2157,15 @@ this.mDialog.document.documentElement.getButton("accept").disabled = !ok; }, -@@ -1066,30 +1066,56 @@ nsUnknownContentTypeDialog.prototype = { +@@ -1067,30 +1067,57 @@ nsUnknownContentTypeDialog.prototype = { + + if (params.handlerApp && params.handlerApp.executable && params.handlerApp.executable.isFile()) { // Remember the file they chose to run. this.chosenApp = params.handlerApp; } - } - else { - #if MOZ_WIDGET_GTK == 3 + } else if ("@mozilla.org/applicationchooser;1" in Components.classes) { - var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser; - var appChooser = Components.classes["@mozilla.org/applicationchooser;1"] - .createInstance(nsIApplicationChooser); @@ -2147,7 +2176,8 @@ - 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 ++ // 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") @@ -2190,7 +2220,7 @@ + // The finishChooseApp is called from appChooserCallback + return; + } - #else + } else { var nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes["@mozilla.org/filepicker;1"] .createInstance(nsIFilePicker);