Open Bug 1017856 Opened 10 years ago Updated 1 year ago

Should pick different windows taskbar group IDs for each profile

Categories

(Core :: Widget: Win32, defect)

30 Branch
x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: noitidart, Unassigned)

References

Details

(Whiteboard: tpi:-)

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140522105902

Steps to reproduce:

Used add-on Profilist to make new profile.


Actual results:

The new profile window was lumped with the other already opened profile window in the taskbar. It is same on WinXP and Win7, i dont know about linux, but on mac i heard that it is seperate.


Expected results:

Should be seperate on toolbar
in win7 i can "hack" it by doing:

var wt = Components.classes["@mozilla.org/windows-taskbar;1"].getService(Components.interfaces.nsIWinTaskbar);
wt.setGroupIdForWindow(me,wt.defaultGroupId + '-profile name');


but this is not right solution, a profile should automatically have its u nique defaultGroupId so when an addon does this technique they usually do `wt.setGroupIdForWindow(me,wt.defaultGroupId + '-addonName');` so that will give them there seperate group.


furthermore, winXP doesnt support this


i tried opening profiles with command line option of "-new-instance" but it doesnt seperate them in taskbar either
dupe of bug 644914?
I don't think so because it's affecting WinXP too. And it's not about pinned or unpinned.
(In reply to noitidart from comment #1)
> in win7 i can "hack" it by doing:
> 
> var wt =
> Components.classes["@mozilla.org/windows-taskbar;1"].getService(Components.
> interfaces.nsIWinTaskbar);
> wt.setGroupIdForWindow(me,wt.defaultGroupId + '-profile name');
> 
> 
> but this is not right solution, a profile should automatically have its u
> nique defaultGroupId so when an addon does this technique they usually do
> `wt.setGroupIdForWindow(me,wt.defaultGroupId + '-addonName');` so that will
> give them there seperate group.

From the documentation, I would assume this isn't possible, because the default corresponds to the executable and is registered with the system. See: http://mxr.mozilla.org/mozilla-central/source/widget/nsIWinTaskbar.idl#61

Changing the ID for all windows because of multiple profiles being run doesn't really sound like something we should support.
Component: Untriaged → Widget: Win32
Product: Firefox → Core
Summary: on windows (maybe linux i dont know) if multiple profiles run simultaneously they windows are liumped into one in the taskbar → Should pick different windows taskbar group IDs for each profile
Ah no problem about changing the defaultGroupId. I would much rather prefer default handling by Firefox , it doesn't make sense that in Win7 that we have to programatically do the split while in mac os it's innate to have separate group. Also this defaultGroupId fix wouldn't fix WinXP, which tons of people use especially as companies aren't able to pull off the massive upgrade to Win7 haha.
While researching this stuff I came across something that's pretty interesting I posted in the topic Yang linked though: https://bugzilla.mozilla.org/show_bug.cgi?id=644914#c19
Hi all,
I found out that in https://bugzilla.mozilla.org/show_bug.cgi?id=644914 it fixes this in Win7 but is a bit kwirky. But what about for WinXP?

So for Win7:

    As for grouping by profile instead of install location, we added an option
    for that in Bug 577867. Add a boolean pref named
    |taskbar.grouping.useprofile| and set it to true.

After creating and setting the pref the browser must be restarted.

But how it works is it changes the defaultGroupId `Cc["@mozilla.org/windows-taskbar;1"].getService(Ci.nsIWinTaskbar).defaultGroupId`

The problem with this is, if firefox.exe is pinned it uses the defaultGroupId and all profiles now have a different defaultGroupId, I need to detect the defaultGroupId of the original firefox.exe so I can apply it to the profile that is selected as default.

Can you please help me how to figure out the defaultGroupId.

Thanks
(In reply to noitidart from comment #7)
> Can you please help me how to figure out the defaultGroupId.

http://mxr.mozilla.org/mozilla-central/source/widget/windows/WinTaskbar.cpp#244 might be useful
Thanks Mark! I'll investigate and report back. :)
Hi all ok so no one really took this so I'm doing it. But I odn't know C++ so im just implementing this feature in an add-on.

I'm trying really hard to do the js-ctypes for separating windows in WinXP. I am incredibly stuck, I was wondering if anyone wanted to help out?

The C++ code i'm trying to translate is here: https://ask.mozilla.org/question/781/sendmessage-with-tb_getbutton-pointer-crashes-explorerexe-winxp/?answer=796#post-id-796

This is what I have so far: https://gist.github.com/Noitidart/f691ab9a750f24be346f
Hi all,
Ok I've taken on this task, implementing this in my addon. However its hardcore js-ctypes so os dependent. I don't know C or C++ and have been bugging a guy on stackoverflow but I feel like I'm annoying him.


I got all the ground work done, as in I got the C code, i even converted it all to ctypes to the best i can which is pretty dang buggy. Is there anyone that can help me out with the c to ctypes conversion, basically they just have to look at my js-ctypes conversion and fix that please.
If you guys want you can find the respective shortcut after pinning and change the name from "Firefox - ########" to be like "Firefox - My Profile Name" and you can also change the icon there. Fun stuff. The shortcuts after pinning are located here: %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\ImplicitAppShortcuts just look through the folders till you find your matching name.

Or if you want to set the name and icon via the code, its just a couple lines:
edit name here: https://github.com/Noitidart/Bugzilla-644914-Solution/blob/master/bootstrap.js#L571
uncomment and set path to icon on this line: https://github.com/Noitidart/Bugzilla-644914-Solution/blob/master/bootstrap.js#L572
whoops posted in wrong topic. i was just posting the solution for Win7+ in the other topic here: https://bugzilla.mozilla.org/show_bug.cgi?id=644914#c48
Whiteboard: tpi:-
See Also: → 702669

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
20190516215225

I haven't tested extensively, but it seems this could serve as a workaround:

  1. Enter about:config into the location bar.
  2. Right-click somewhere in the lower pane and choose New, then Boolean. Enter taskbar.grouping.useprofile as the preference name and true as the value.
    In later versions, paste the preference name into the search box, then choose Boolean below, then click the Add button. If the value isn't what it should be, click the Toggle button.
  3. Exit then restart Firefox with that profile.

Jim, when bug 577867 added this option, why was it not turned on? Is there a reason not to turn it on now (probably with some QA testing) ?

Depends on: 577867
Flags: needinfo?(jmathies)

(In reply to :Gijs (he/him) from comment #17)

Jim, when bug 577867 added this option, why was it not turned on?

No reason was provided for the resolution of bug 1168694

(In reply to Gingerbread Man from comment #18)

(In reply to :Gijs (he/him) from comment #17)

Jim, when bug 577867 added this option, why was it not turned on?

No reason was provided for the resolution of bug 1168694

Profiles (we're/still are) considered a developer feature and as such, not supported as a release feature. The default was to use the install location id generated when the browser installed. The profile option was mostly a convenience for power users who ran a lot of profiles. Pretty sure this came up for discussion with drivers back when we worked on it 2011.

Flags: needinfo?(jmathies)
Severity: normal → S3

(In reply to Gingerbread Man from comment #16)

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
20190516215225

I haven't tested extensively, but it seems this could serve as a workaround:

  1. Enter about:config into the location bar.
  2. Right-click somewhere in the lower pane and choose New, then Boolean. Enter taskbar.grouping.useprofile as the preference name and true as the value.
    In later versions, paste the preference name into the search box, then choose Boolean below, then click the Add button. If the value isn't what it should be, click the Toggle button.
  3. Exit then restart Firefox with that profile.

Thanks! Is it possible to have a different taskbar icon for each profile?

You need to log in before you can comment on or make changes to this bug.