Closed Bug 1151753 Opened 5 years ago Closed 2 years ago

WM_CLASS should be different between Mozilla Firefox and Firefox Developer Edition, even in private browsing


(Firefox :: Shell Integration, defect)

Not set



Firefox 58
Tracking Status
firefox58 --- fixed


(Reporter: cm-t, Assigned: m_kato)


(Depends on 1 open bug, Blocks 1 open bug)



(2 files)

Attached image ubuntu-firefox.png
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150403004008

Steps to reproduce:

 * Running Ubuntu 14.04 LTS (Unity Desktop) fully up to date (including Mozilla Firefox)
 * Installed Firefox Developer Edition using the developer tools "ubuntu-make"[1]
 * Both Mozilla Firefox and Firefox Developer Edition's shortcuts (unity's launcher on sidebar) are pinned
 * Right click on the Mozilla Firefox launcher
 * Select "New Private browsing windows"
 * Launch optionnaly new windows from Mozilla Firefox and Firefox Developer Edition

[1]: ubuntu-make:

Actual results:

On the Unity's sidebar and ALT+TAB "popup", you will see the Firefox Developer Edition telling that all windows are opened as Firefox Developer Edition. All windows are launched as Firefox Developer Edition (as seen by Ubuntu Unity).

Note: There are more informations and screenshots on this bug report


Expected results:

All those opened windows should be in their own icons (sidebar/alt+tab unity's icons): 

 * Firefox Developer Edition windows under the Firefox Developer Edition icon
 * Mozilla Firefox under the Mozilla Firefox icon
OS: Windows XP → Linux
Hardware: x86 → All
Component: Untriaged → Shell Integration
Ever confirmed: true
See Also: → 849571
We should call gdk_set_program_class.  If gdk_prgclass is overriden by --class, it isn't updated according to GTK+ 3.20 code.
Comment on attachment 8922739 [details]
Bug 1151753 - Set program class name when not using --class command line option.

Thanks for sharing and tidying up the existing code.

::: widget/WidgetUtils.cpp:148
(Diff revision 1)
> +WidgetUtils::GetBrandShortName(nsAString& aBrandName)
> +{
> +    aBrandName.Truncate();
> +
> +    nsCOMPtr<nsIStringBundleService> bundleService =
> +        do_GetService(NS_STRINGBUNDLE_CONTRACTID);

Please use GetStringBundleService() as it caches the result of the service look-up.

::: widget/gtk/nsAppShell.cpp:180
(Diff revision 1)
>          } else {
>              screenManager.SetHelper(mozilla::MakeUnique<ScreenHelperGTK>());
>          }
>      }
> +    if (!gtk_check_version(3, 16, 3)) {

Please compare the result of gtk_check_version() with nullptr, so that it is clear that this function does not return a boolean, as a hint that the result is opposite to what is expected.
Attachment #8922739 - Flags: review?(karlt) → review+
Pushed by
Set program class name when not using --class command line option. r=karlt
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Blocks: 1387859
Assignee: nobody → m_kato
For anyone wanting to take advantage of this, the .desktop filename must match the channel's "brandShortName" which can be found in chrome://branding/locale/ with current values:

> Nightly: "Nightly"
> Developer Edition: "Firefox Developer Edition"
> Beta: "Firefox"
> Release: "Firefox"

These are mostly obvious but Developer Edition is a bit tricky and Beta cannot be distinguished from Release.
(In reply to Kestrel from comment #7)
> For anyone wanting to take advantage of this, the .desktop filename must
> match the channel's "brandShortName" [...]

What about case and space characters? Does it have to be named "Firefox Developer Edition.desktop" or would "firefox developer edition" or "firefox_developer_edition" work, too?
In my testing, I found that the letter case must be equal or lower (not higher) and you can substitute space with dash (not underscore) but then all must be lower case.

Firefox Developer Edition.desktop
firefox developer edition.desktop

FIREFOX developer edition.desktop
Depends on: 1465814
You need to log in before you can comment on or make changes to this bug.