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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 | 12 +++++-------
  8. 2 files changed, 6 insertions(+), 12 deletions(-)
  9. diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
  10. index 3ec33c9b45417..56081f76a0074 100644
  11. --- a/toolkit/xre/nsAppRunner.cpp
  12. +++ b/toolkit/xre/nsAppRunner.cpp
  13. @@ -4252,11 +4252,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 60de473de07ab..004c066575c17 100644
  25. --- a/widget/gtk/nsAppShell.cpp
  26. +++ b/widget/gtk/nsAppShell.cpp
  27. @@ -24,6 +24,8 @@
  28. # include "WakeLockListener.h"
  29. #endif
  30. #include "gfxPlatform.h"
  31. +#include "nsAppRunner.h"
  32. +#include "mozilla/XREAppData.h"
  33. #include "ScreenHelperGTK.h"
  34. #include "HeadlessScreenHelper.h"
  35. #include "mozilla/widget/ScreenManager.h"
  36. @@ -152,13 +154,9 @@ nsresult nsAppShell::Init() {
  37. // See https://bugzilla.gnome.org/show_bug.cgi?id=747634
  38. //
  39. // Only bother doing this for the parent process, since it's the one
  40. - // creating top-level windows. (At this point, a child process hasn't
  41. - // received the list of registered chrome packages, so the
  42. - // GetBrandShortName call would fail anyway.)
  43. - nsAutoString brandName;
  44. - mozilla::widget::WidgetUtils::GetBrandShortName(brandName);
  45. - if (!brandName.IsEmpty()) {
  46. - gdk_set_program_class(NS_ConvertUTF16toUTF8(brandName).get());
  47. + // creating top-level windows.
  48. + if (gAppData) {
  49. + gdk_set_program_class(gAppData->remotingName);
  50. }
  51. }
  52. }