New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qvm-sync-appmenus doesn't respect OnlyShowIn and NotShowIn resulting in duplicate entries on Ubuntu #3246

Open
qubesuser opened this Issue Oct 28, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@qubesuser

Qubes OS version:

R4.0-rc2

Affected TemplateVMs:

ubuntu 17.10

Steps to reproduce the behavior:

  1. Install an Ubuntu template VM
  2. Sync appmenus

Expected behavior:

There is only one "Files" appmenu.

Actual behavior:

There are two "Files" appmenus.

General notes:

Ubuntu has org.gnome.Nautilus.desktop with "OnlyShowIn=Unity;GNOME;" and nautilus.desktop with "NotShowIn=Unity;GNOME;"

Thus, with a proper implementation only one can be shown regardless of what "desktop name" the implementation considers itself to be, while Qubes seems to just ignore those directives resulting in duplication.

I think Qubes might also want to pretend to be "GNOME", although this is not totally clear.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Oct 28, 2017

Member

This is semi-intentional - to allow using any application, regardless of its native desktop environment. While this particular application provide both desktop files, there are a lot of them that provide only one (for example with OnlyShowIn=KDE;, or OnlyShowIn=GNOME;). For example nautilus, or gnome contacts, or baobab in Fedora are such cases.
We may add a tooltip in that window to help distinguishing such corner cases - for example desktop file name.

Member

marmarek commented Oct 28, 2017

This is semi-intentional - to allow using any application, regardless of its native desktop environment. While this particular application provide both desktop files, there are a lot of them that provide only one (for example with OnlyShowIn=KDE;, or OnlyShowIn=GNOME;). For example nautilus, or gnome contacts, or baobab in Fedora are such cases.
We may add a tooltip in that window to help distinguishing such corner cases - for example desktop file name.

@qubesuser

This comment has been minimized.

Show comment
Hide comment
@qubesuser

qubesuser Oct 28, 2017

I see.

I guess the solution could then be to deduplicate desktop entries that have the same Name= and same Exec= line (after removing %f, %F, %u, %U from the exec line and canonicalizing whitespace).

It's not really a big deal though.

qubesuser commented Oct 28, 2017

I see.

I guess the solution could then be to deduplicate desktop entries that have the same Name= and same Exec= line (after removing %f, %F, %u, %U from the exec line and canonicalizing whitespace).

It's not really a big deal though.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Oct 28, 2017

Member

I guess those do have different Exec= lines... Or at least one have DBusActivable=true (which also result in something different being executed in practice)

Member

marmarek commented Oct 28, 2017

I guess those do have different Exec= lines... Or at least one have DBusActivable=true (which also result in something different being executed in practice)

@qubesuser

This comment has been minimized.

Show comment
Hide comment
@qubesuser

qubesuser Oct 28, 2017

Yes, one has %U at the end, but the spec says it should be removed when not opening any files, and thus the Exec= lines are logically equivalent for the purpose of application menus.

If there is already logic to avoid duplicate exec lines, then it looks like it only needs to be updated to do s/%[fFuU]//g; s/\s+/ /g; s/^\s+//; s/\s+$//; before comparing.

qubesuser commented Oct 28, 2017

Yes, one has %U at the end, but the spec says it should be removed when not opening any files, and thus the Exec= lines are logically equivalent for the purpose of application menus.

If there is already logic to avoid duplicate exec lines, then it looks like it only needs to be updated to do s/%[fFuU]//g; s/\s+/ /g; s/^\s+//; s/\s+$//; before comparing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment