After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676238 - App menus for 2 instances get merged
App menus for 2 instances get merged
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-05-17 13:55 UTC by Bastien Nocera
Modified: 2012-06-19 15:58 UTC
See Also:
GNOME target: 3.6
GNOME version: ---


Attachments
shell-app: Update app menu if necessary (4.98 KB, patch)
2012-05-17 16:38 UTC, Florian Müllner
committed Details | Review

Description Bastien Nocera 2012-05-17 13:55:56 UTC
gnome-shell-3.4.1-3.fc17.x86_64

1. Launch epiphany
2. Open a website to differentiate it
3. Launch epiphany -p (a private instance)
4. Select the empty window launched in 3.
5. Click on the app menu and select "Personal Data"

The "Personal Data" section should be empty, as "epiphany -p" doesn't copy that. But it's full of stuff, which means you just activated the app menu for instance 1.

This should be reproduceable by launching any 2 instances of an application with an app menu.
Comment 1 Florian Müllner 2012-05-17 15:58:18 UTC
We wrongly assume that all GtkApplications are single-instance, see http://git.gnome.org/browse/gnome-shell/tree/src/shell-app.c#n1225
Comment 2 Giovanni Campagna 2012-05-17 16:19:12 UTC
That assumption is right - one ShellApp matches to one GMenu (or bad stuff will probably happen at the JS layer).
The problem is that multiple logical applications (such as global epiphany and private epiphany, or empathy and empathy-chat) are merged into one ShellApp. We need better application heuristics, especially when we have explicit information from GtkApplication.
Comment 3 Florian Müllner 2012-05-17 16:33:04 UTC
(In reply to comment #2)
> That assumption is right - one ShellApp matches to one GMenu (or bad stuff will
> probably happen at the JS layer).

I think it is unfortunate that we got G_APPLICATION_NON_UNIQUE, but as it's done we should support it, e.g. one GtkApplication matches one GMenu (with one ShellApp one or more GtkApplications).

Updating the menu as necessary is actually not hard, but a fancier solution would iterate over all the ShellApp's windows and activate the appropriate action in the non-unique case.
Comment 4 Florian Müllner 2012-05-17 16:38:12 UTC
Created attachment 214267 [details] [review]
shell-app: Update app menu if necessary

Currently we assume that GTK_UNIQUE_BUS_NAME is shared between all
windows of an application. This assumption does not hold true for
applications that specify G_APPLICATION_NON_UNIQUE, so make sure
to update the menu as necessary.


For what it's worth, this is the first (inferior imo) solution which makes the app menu per-window in case of non-uniqueness. Technically it works, but I don't like it from a UI POV (see comment #3).
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-06-01 12:09:41 UTC
Yeah, I'd prefer it if we actually had supported multiple ShellAppRunningStates for every app -- one per unique bus name.
Comment 6 Florian Müllner 2012-06-15 13:29:10 UTC
(In reply to comment #4)
> For what it's worth, this is the first (inferior imo) solution which makes the
> app menu per-window in case of non-uniqueness. Technically it works, but I
> don't like it from a UI POV (see comment #3).

Actually I've thought about it a bit more, and the approach in this patch should be better in most cases (like "about", "preferences"). We might want to special-case actions called "quit" to activate them once for each instance eventually though.
Comment 7 Matthias Clasen 2012-06-19 11:16:49 UTC
should we just go with this, then ?
Comment 8 Florian Müllner 2012-06-19 11:20:16 UTC
Yup, waiting for review.
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-06-19 15:49:35 UTC
Review of attachment 214267 [details] [review]:

Not a giant fan, but it works.
Comment 10 Florian Müllner 2012-06-19 15:58:44 UTC
Attachment 214267 [details] pushed as c303c6b - shell-app: Update app menu if necessary