firefox-kde.patch
branchfirefox118
changeset 1196 954851a35787
parent 1190 2a24a948b5cf
child 1198 de5582739a05
equal deleted inserted replaced
1195:78bbadb03249 1196:954851a35787
     1 # HG changeset patch
     1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
     2 # User msirringhaus@suse.de
     2 From: Martin Sirringhaus <msirringhaus@suse.de>
     3 # Date 1559300151 -7200
     3 Date: Tue, 8 Aug 2023 16:18:24 +0300
     4 #      Fri May 31 12:55:51 2019 +0200
     4 Subject: [PATCH] Add KDE integration to Firefox
     5 # Node ID 54d41b0033b8d649d842a1f862c6fed8b9874dec
     5 
     6 # Parent  340817025937e2c69bb1643930d7dfdf63656a7b
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
       
     7 Bug: https://bugzilla.suse.com/show_bug.cgi?id=170055
       
     8 
     7 How to apply this patch:
     9 How to apply this patch:
       
    10 
     8 1. Import and apply it
    11 1. Import and apply it
     9 2. cp browser/base/content/browser.xul browser/base/content/browser-kde.xul
    12 2. cp browser/base/content/browser.xul browser/base/content/browser-kde.xul
    10 3. Find editBookmarkPanelDoneButton
    13 3. Find editBookmarkPanelDoneButton
    11 4. Replace #ifndef with #ifdef in the line above (this hanges the button order from Gnome-style to KDE-style)
    14 4. Replace #ifndef with #ifdef in the line above (this hanges the button order from Gnome-style to KDE-style)
    12 5. hg qrefresh
    15 5. hg qrefresh
    13 
    16 ---
    14 Index: firefox-115.0/browser/components/preferences/main.js
    17  browser/components/preferences/main.js        |  18 +++
    15 ===================================================================
    18  browser/components/shell/moz.build            |   2 +
    16 --- firefox-115.0.orig/browser/components/preferences/main.js
    19  .../components/shell/nsKDEShellService.cpp    | 109 ++++++++++++++++++
    17 +++ firefox-115.0/browser/components/preferences/main.js
    20  browser/components/shell/nsKDEShellService.h  |  32 +++++
    18 @@ -293,6 +293,13 @@ var gMainPane = {
    21  .../components/shell/nsUnixShellService.cpp   |  22 ++++
       
    22  browser/components/shell/nsUnixShellService.h |  15 +++
       
    23  6 files changed, 198 insertions(+)
       
    24  create mode 100644 browser/components/shell/nsKDEShellService.cpp
       
    25  create mode 100644 browser/components/shell/nsKDEShellService.h
       
    26  create mode 100644 browser/components/shell/nsUnixShellService.cpp
       
    27  create mode 100644 browser/components/shell/nsUnixShellService.h
       
    28 
       
    29 diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js
       
    30 index 609b9a9d06178b42b0ba8509500a1b72d8bd3b88..05df0fc6ce279ab6161a3f93450e7296c95a371f 100644
       
    31 --- a/browser/components/preferences/main.js
       
    32 +++ b/browser/components/preferences/main.js
       
    33 @@ -294,6 +294,13 @@ var gMainPane = {
    19        }, backoffTimes[this._backoffIndex]);
    34        }, backoffTimes[this._backoffIndex]);
    20      }
    35      }
    21  
    36  
    22 +    var env = Components.classes["@mozilla.org/process/environment;1"]
    37 +    var env = Components.classes["@mozilla.org/process/environment;1"]
    23 +      .getService(Components.interfaces.nsIEnvironment);
    38 +      .getService(Components.interfaces.nsIEnvironment);
    27 +    }
    42 +    }
    28 +
    43 +
    29      this.initBrowserContainers();
    44      this.initBrowserContainers();
    30      this.buildContentProcessCountMenuList();
    45      this.buildContentProcessCountMenuList();
    31  
    46  
    32 @@ -1762,6 +1769,17 @@ var gMainPane = {
    47 @@ -1725,6 +1732,17 @@ var gMainPane = {
    33        }
    48        }
    34        try {
    49        try {
    35          shellSvc.setDefaultBrowser(true, false);
    50          shellSvc.setDefaultBrowser(true, false);
    36 +        if (kde_session == 1) {
    51 +        if (kde_session == 1) {
    37 +          var shellObj = Components.classes["@mozilla.org/file/local;1"]
    52 +          var shellObj = Components.classes["@mozilla.org/file/local;1"]
    45 +          process.run(false, args, args.length);
    60 +          process.run(false, args, args.length);
    46 +        }
    61 +        }
    47        } catch (ex) {
    62        } catch (ex) {
    48          console.error(ex);
    63          console.error(ex);
    49          return;
    64          return;
    50 Index: firefox-115.0/browser/components/shell/moz.build
    65 diff --git a/browser/components/shell/moz.build b/browser/components/shell/moz.build
    51 ===================================================================
    66 index eb88cb287dc3f04022b74b978666118bbd5fa6b2..95277533781a7224d108e3c45731a6d9a89ba1a0 100644
    52 --- firefox-115.0.orig/browser/components/shell/moz.build
    67 --- a/browser/components/shell/moz.build
    53 +++ firefox-115.0/browser/components/shell/moz.build
    68 +++ b/browser/components/shell/moz.build
    54 @@ -36,6 +36,8 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gt
    69 @@ -36,6 +36,8 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
    55  
    70  
    56      SOURCES += [
    71      SOURCES += [
    57          "nsGNOMEShellService.cpp",
    72          "nsGNOMEShellService.cpp",
    58 +        "nsKDEShellService.cpp",
    73 +        "nsKDEShellService.cpp",
    59 +        "nsUnixShellService.cpp",
    74 +        "nsUnixShellService.cpp",
    60      ]
    75      ]
    61      if CONFIG["MOZ_ENABLE_DBUS"]:
    76      if CONFIG["MOZ_ENABLE_DBUS"]:
    62          SOURCES += [
    77          SOURCES += [
    63 Index: firefox-115.0/browser/components/shell/nsKDEShellService.cpp
    78 diff --git a/browser/components/shell/nsKDEShellService.cpp b/browser/components/shell/nsKDEShellService.cpp
    64 ===================================================================
    79 new file mode 100644
    65 --- /dev/null
    80 index 0000000000000000000000000000000000000000..152a3aca87ea73477bc75c4e93c01e5a52dda102
    66 +++ firefox-115.0/browser/components/shell/nsKDEShellService.cpp
    81 --- /dev/null
       
    82 +++ b/browser/components/shell/nsKDEShellService.cpp
    67 @@ -0,0 +1,109 @@
    83 @@ -0,0 +1,109 @@
    68 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
    84 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
    69 +/* This Source Code Form is subject to the terms of the Mozilla Public
    85 +/* This Source Code Form is subject to the terms of the Mozilla Public
    70 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    86 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    71 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    87 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
   172 +nsKDEShellService::IsDefaultForScheme(nsTSubstring<char> const& aScheme, bool* aIsDefaultBrowser)
   188 +nsKDEShellService::IsDefaultForScheme(nsTSubstring<char> const& aScheme, bool* aIsDefaultBrowser)
   173 +{
   189 +{
   174 +    return NS_ERROR_NOT_IMPLEMENTED;
   190 +    return NS_ERROR_NOT_IMPLEMENTED;
   175 +}
   191 +}
   176 +
   192 +
   177 Index: firefox-115.0/browser/components/shell/nsKDEShellService.h
   193 diff --git a/browser/components/shell/nsKDEShellService.h b/browser/components/shell/nsKDEShellService.h
   178 ===================================================================
   194 new file mode 100644
   179 --- /dev/null
   195 index 0000000000000000000000000000000000000000..8b0bb19164352453cfa453dd87c19263160b9ad8
   180 +++ firefox-115.0/browser/components/shell/nsKDEShellService.h
   196 --- /dev/null
       
   197 +++ b/browser/components/shell/nsKDEShellService.h
   181 @@ -0,0 +1,32 @@
   198 @@ -0,0 +1,32 @@
   182 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
   199 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
   183 +/* This Source Code Form is subject to the terms of the Mozilla Public
   200 +/* This Source Code Form is subject to the terms of the Mozilla Public
   184 + * License, v. 2.0. If a copy of the MPL was not distributed with this
   201 + * License, v. 2.0. If a copy of the MPL was not distributed with this
   185 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
   202 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
   209 +
   226 +
   210 +  bool mCheckedThisSession;
   227 +  bool mCheckedThisSession;
   211 +};
   228 +};
   212 +
   229 +
   213 +#endif // nskdeshellservice_h____
   230 +#endif // nskdeshellservice_h____
   214 Index: firefox-115.0/browser/components/shell/nsUnixShellService.cpp
   231 diff --git a/browser/components/shell/nsUnixShellService.cpp b/browser/components/shell/nsUnixShellService.cpp
   215 ===================================================================
   232 new file mode 100644
   216 --- /dev/null
   233 index 0000000000000000000000000000000000000000..abf266ebdc52e136f495911da3454e69c770c6db
   217 +++ firefox-115.0/browser/components/shell/nsUnixShellService.cpp
   234 --- /dev/null
       
   235 +++ b/browser/components/shell/nsUnixShellService.cpp
   218 @@ -0,0 +1,22 @@
   236 @@ -0,0 +1,22 @@
   219 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
   237 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
   220 +/* This Source Code Form is subject to the terms of the Mozilla Public
   238 +/* This Source Code Form is subject to the terms of the Mozilla Public
   221 + * License, v. 2.0. If a copy of the MPL was not distributed with this
   239 + * License, v. 2.0. If a copy of the MPL was not distributed with this
   222 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
   240 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
   236 +{
   254 +{
   237 +    if( nsKDEUtils::kdeSupport())
   255 +    if( nsKDEUtils::kdeSupport())
   238 +        return nsKDEShellServiceConstructor( aIID, aResult );
   256 +        return nsKDEShellServiceConstructor( aIID, aResult );
   239 +    return nsGNOMEShellServiceConstructor( aIID, aResult );
   257 +    return nsGNOMEShellServiceConstructor( aIID, aResult );
   240 +}
   258 +}
   241 Index: firefox-115.0/browser/components/shell/nsUnixShellService.h
   259 diff --git a/browser/components/shell/nsUnixShellService.h b/browser/components/shell/nsUnixShellService.h
   242 ===================================================================
   260 new file mode 100644
   243 --- /dev/null
   261 index 0000000000000000000000000000000000000000..26b5dbac47dd9a8ec1fcb6c93575cca750692735
   244 +++ firefox-115.0/browser/components/shell/nsUnixShellService.h
   262 --- /dev/null
       
   263 +++ b/browser/components/shell/nsUnixShellService.h
   245 @@ -0,0 +1,15 @@
   264 @@ -0,0 +1,15 @@
   246 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
   265 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
   247 +/* This Source Code Form is subject to the terms of the Mozilla Public
   266 +/* This Source Code Form is subject to the terms of the Mozilla Public
   248 + * License, v. 2.0. If a copy of the MPL was not distributed with this
   267 + * License, v. 2.0. If a copy of the MPL was not distributed with this
   249 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
   268 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */