summaryrefslogtreecommitdiff
path: root/libre/iceweasel/0001-Use-remoting-name-for-GDK-application-names.patch
blob: f307772948ebefc6bb35dd7e0acb8ce6c89b8ce7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Mon, 25 Mar 2019 20:30:11 +0100
Subject: [PATCH] Use remoting name for GDK application names

---
 toolkit/xre/nsAppRunner.cpp |  6 +-----
 widget/gtk/nsAppShell.cpp   | 12 +++++-------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index ce001e93821f..3be817c5cbd5 100644
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4348,11 +4348,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
   // consistently.
 
   // Set program name to the one defined in application.ini.
-  {
-    nsAutoCString program(gAppData->name);
-    ToLowerCase(program);
-    g_set_prgname(program.get());
-  }
+  g_set_prgname(gAppData->remotingName);
 
   // Initialize GTK here for splash.
 
diff --git a/widget/gtk/nsAppShell.cpp b/widget/gtk/nsAppShell.cpp
index c8bbd9a373f5..a6a2186f20fb 100644
--- a/widget/gtk/nsAppShell.cpp
+++ b/widget/gtk/nsAppShell.cpp
@@ -27,6 +27,8 @@
 #  include "nsIObserverService.h"
 #endif
 #include "gfxPlatform.h"
+#include "nsAppRunner.h"
+#include "mozilla/XREAppData.h"
 #include "ScreenHelperGTK.h"
 #include "HeadlessScreenHelper.h"
 #include "mozilla/widget/ScreenManager.h"
@@ -257,13 +259,9 @@ nsresult nsAppShell::Init() {
       // See https://bugzilla.gnome.org/show_bug.cgi?id=747634
       //
       // Only bother doing this for the parent process, since it's the one
-      // creating top-level windows. (At this point, a child process hasn't
-      // received the list of registered chrome packages, so the
-      // GetBrandShortName call would fail anyway.)
-      nsAutoString brandName;
-      mozilla::widget::WidgetUtils::GetBrandShortName(brandName);
-      if (!brandName.IsEmpty()) {
-        gdk_set_program_class(NS_ConvertUTF16toUTF8(brandName).get());
+      // creating top-level windows.
+      if (gAppData) {
+        gdk_set_program_class(gAppData->remotingName);
       }
     }
   }