0001-Use-remoting-name-for-GDK-application-names.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
  3. Date: Mon, 25 Mar 2019 20:30:11 +0100
  4. Subject: [PATCH] Use remoting name for GDK application names
  5. ---
  6. toolkit/xre/nsAppRunner.cpp | 6 +-----
  7. widget/gtk/nsAppShell.cpp | 11 ++++-------
  8. 2 files changed, 5 insertions(+), 12 deletions(-)
  9. diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
  10. index 49e2c73986ab..43ebcac381c7 100644
  11. --- a/toolkit/xre/nsAppRunner.cpp
  12. +++ b/toolkit/xre/nsAppRunner.cpp
  13. @@ -3822,11 +3822,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
  14. // consistently.
  15. // Set program name to the one defined in application.ini.
  16. - {
  17. - nsAutoCString program(gAppData->name);
  18. - ToLowerCase(program);
  19. - g_set_prgname(program.get());
  20. - }
  21. + g_set_prgname(gAppData->remotingName);
  22. // Initialize GTK here for splash.
  23. diff --git a/widget/gtk/nsAppShell.cpp b/widget/gtk/nsAppShell.cpp
  24. index cfe022e65d82..06325264dbb1 100644
  25. --- a/widget/gtk/nsAppShell.cpp
  26. +++ b/widget/gtk/nsAppShell.cpp
  27. @@ -24,6 +24,7 @@
  28. # include "WakeLockListener.h"
  29. #endif
  30. #include "gfxPlatform.h"
  31. +#include "nsAppRunner.h"
  32. #include "ScreenHelperGTK.h"
  33. #include "HeadlessScreenHelper.h"
  34. #include "mozilla/widget/ScreenManager.h"
  35. @@ -159,13 +160,9 @@ nsresult nsAppShell::Init() {
  36. // See https://bugzilla.gnome.org/show_bug.cgi?id=747634
  37. //
  38. // Only bother doing this for the parent process, since it's the one
  39. - // creating top-level windows. (At this point, a child process hasn't
  40. - // received the list of registered chrome packages, so the
  41. - // GetBrandShortName call would fail anyway.)
  42. - nsAutoString brandName;
  43. - mozilla::widget::WidgetUtils::GetBrandShortName(brandName);
  44. - if (!brandName.IsEmpty()) {
  45. - gdk_set_program_class(NS_ConvertUTF16toUTF8(brandName).get());
  46. + // creating top-level windows.
  47. + if (gAppData) {
  48. + gdk_set_program_class(gAppData->remotingName);
  49. }
  50. }
  51. }