Bug 1333162 - Only call gdk_set_program_name in the parent process. r=karlt

Differential Revision: https://phabricator.services.mozilla.com/D70640

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Cameron McCormack 2020-04-14 01:48:37 +00:00
Родитель a4806e99d8
Коммит 91abb34d31
1 изменённых файлов: 15 добавлений и 10 удалений

Просмотреть файл

@ -169,17 +169,22 @@ nsresult nsAppShell::Init() {
} else {
screenManager.SetHelper(mozilla::MakeUnique<ScreenHelperGTK>());
}
}
if (gtk_check_version(3, 16, 3) == nullptr) {
// Before 3.16.3, GDK cannot override classname by --class command line
// option when program uses gdk_set_program_class().
//
// See https://bugzilla.gnome.org/show_bug.cgi?id=747634
nsAutoString brandName;
mozilla::widget::WidgetUtils::GetBrandShortName(brandName);
if (!brandName.IsEmpty()) {
gdk_set_program_class(NS_ConvertUTF16toUTF8(brandName).get());
if (gtk_check_version(3, 16, 3) == nullptr) {
// Before 3.16.3, GDK cannot override classname by --class command line
// option when program uses gdk_set_program_class().
//
// 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());
}
}
}