Unity always shows all devices in launcher when CD is inserted

Bug #1103593 reported by Dave Vree on 2013-01-23
158
This bug affects 35 people
Affects Status Importance Assigned to Milestone
unity (Ubuntu)
Medium
Andrea Azzarone
Xenial
Undecided
Unassigned

Bug Description

[Impact]
In Ubuntu 12.10 the default behavior when inserting a CD (or a USB memory stick, etc.) is to add a list of mounted devices to the launcher. This takes up a lot of extra space for me as I usually have several Samba mounts. Furthermore, I don't need or want to see my CD in the launcher.

I can click right on the mounted devices and select "Unlock from launcher", but the next time I insert a CD they're back. Disabling this "feature" should be an option in 12.10. I believe it was an option in 12.04 via CCSM. Thanks.

[Test Case]
1. Add an usb memory stick to device blacklist
2. Mount a cd
3. Make sure the usb is still blacklisted.

[Possible Rgressions]
Nothing known.

Related branches

lp:~azzar1/unity/volume-fallback-to-name
Marco Trevisan (Treviño): Approve on 2016-06-02
PS Jenkins bot: Pending (continuous-integration) requested 2016-06-01
lp:~unity-team/unity/x-sru2
Andrea Azzarone: Approve on 2016-07-06
Dave Vree (hdave) on 2013-01-23
affects: udisks2 (Ubuntu) → launcher (Ubuntu)
Martin Pitt (pitti) on 2013-01-24
affects: launcher (Ubuntu) → unity (Ubuntu)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity (Ubuntu):
status: New → Confirmed
Matpen (matpen) wrote :

The "Unlock from launcher" feature is apparently equivalent to UUID-based blacklisting. Therefore it applies only to that specific device. I tried disabling this feature by removing 'unity://devices' from "com.canonical.Unity.Launcher favorites" using gsettings but this seems to have no effect.

JHosier (jhosier) wrote :

Can someone please fix this bug. It is very frustrating.

As a network administrator I have about a dozen network shares mounted in /etc/fstab.
I also create distributions and other CD/DVDs all of the time.
Everytime I insert a CD/DVD in my PC the Unity Bar gets filled with all the mounted network shares which I have to unlock from the lanucher, only to re-appear a few minutes later when the next CD/DVD is inserted. So far today this silly routine has had to be done more than a dozen times!

After googling I can see that some people suggest blacklisting all devices as a workaround.
I cannot simply block all devices from appearing on the unity launcher as this would blacklist my other hard drives.

Now that this is a confirmed bug, can it please be fixed.

Thank you.

JHosier (jhosier) wrote :

Further to my previous comment I should note that this problem is appearing when I eject the CD/DVD not when I insert the CD/DVD.

Also, unlike the originator of the bug, I am very happy that the CD/DVD drive appears in the unity launcher and I know that the drive can be easily removed from the unity launcher by right clicking on it and choosing "Unlock from Launcher" and this will blacklist it until you run the command to reset the settings

Nicolai Fröhlich (nifr) wrote :

While it is possible to blacklist UUIDs as described in this stackoverflow answer:

http://askubuntu.com/a/195998

It's not possible to prevent new (i.e. USB, Disc ) devices from showing up in the launcher automatically.

The experimental-tab / possibility to disable all devices in CompizConfig Settings Manager (CCSM) stated in the second answer isn't available in my version of compizconfig-settings-manager (0.9.10) on Ubuntu 13.10.

http://askubuntu.com/a/62015

A generic solution to disable the devices would really be appreciated.

Nicolai Fröhlich (nifr) wrote :

Okay rolling back - problem still exists. Now external devices are still shown at the bottom of the launcher!

Problem is NOT solved for me.

JoseLuisTriana (theunfor) wrote :

In Ubuntu 14.04 haven't found a way to solve this issue... unless this bug is a wontfix...

Changed in unity:
status: New → Confirmed
dafreez (dafreez-gmail) wrote :

I recently moved form 12.04 to 14.04 (through a clean upgrade, keeping home partition) and so dar this is the only serious bug I have encountered.
It affects me both opn removing an audio-cd as noted above (have not tested with other optical media) and, more annoyingly, on removing my android (google nexus 4) phone.

Detailed description of setup and behavior:
- I have a number of NFS shares on a home server that are mounted through fstab.

-After installing Trusty these all appeared in the launcher. Right clicking one of them and selcting 'unlock form launcher' removed them all.

- On inserting a CD or plugging my phone in nothing happens in the launcher (ideaally these devices would show up, but no big deal)

- On ejecting the disc or plugging out the phone all the other mounted drives, including nfs shares reappear in the launcher and need to again be 'unlocked from launcher')

- Pendrives do behave correctly: they show up seperately in the launcher on being inserted, and dissapear upon 'eject' either via filemanager or ddirectly through the launcher.

- I also have to USB-3 hard drives that show a mixture of these behaviors. They appear seperately in the launcher upon turning them on (good). If I select unmount in the filemanager they remain visible in the launcher and dissapear upon turning them off. However, if I select 'safely remove dirve, either through the launcher or filemanager, they briefly dissappear and reappear along with all the NFS shares in the launcher.
NB: this last behavior seems related to Nemo being deafault file manager. With Nautilus there is no 'safely remove' option either in launcher or in file manager, instead I can 'unmount' through launcher and then turn the drive off.
All other behavior appears identical regardless of default file manager.

dafreez (dafreez-gmail) wrote :

NB;

Ideally it would be possible to selectively have certaion volumes show up in the launcehr. For instance: I woould want my phone, pendrives, and usb hard drives to show up, but not my NFS shares.

dafreez (dafreez-gmail) wrote :

NB2: This seems related to

#1060484 (fixed)
#792085
#1206298

dafreez (dafreez-gmail) wrote :

I've created a workaround until this is fixed:

Creat a textfile 'foo' in directory 'bar' with the following script:
#!/bin/bash
while [ 1 ]
do
 gsettings set com.canonical.Unity.Devices blacklist "['-']"
 sleep 1
done

make it executable

run "crontab -e" from terminal

add a line as follows:
@reboot /path/to/bar/foo

Artur (artur.) wrote :

Quite annoying: launcher filled with icons, after connecting external drive with partitions or a few pendrives last icons are gone. I tried following suggestions:

gconftool --set /apps/compiz-1/plugins/unityshell/screen0/options/devices_option --type=int 0

gsettings set com.canonical.Unity.Devices devices-option "Never"
Key"devices-option" does not exists.

dconf-editor - Browse to apps - nautilus - desktop
Key does not exists.

ccsm - Unity plugin - experimental - Show Devices combobox to Never.
Option "experimental" does not exists, there is no "Devices" in "Launcher".

gsettings set com.canonical.Unity.Devices blacklist "['-']"

Nothing works :-(

JHosier (jhosier) wrote :

Dear Fellow Annoyed Ubuntu Users :-)
After giving up checking on this thread for some months, assuming that it would never get fixed, I checked it again this morning.
After reading the comment above from dafreez I tested it and it nearly worked. Thank you for the suggestion dafreez.
This is what I found after testing the suggested script.
It seems as though the gsettings command needs to be run as the user which is logged on.
If it is run as root it does not work when you login as yourself.
Also the crontab suggestion did not work for me. The command @reboot did nothing for me.

However, after a bit of tweaking I got a workable solution that is OK for me.
I followed the first part of the suggestion and created a file in my home area called /home/jhosier/stop-network-mounts-unity
In the file I placed the lines as above, namely:

#!/bin/bash
echo stop-network-mounts-unity running > /home/jhosier/test.txt
while [ 1 ]
do
 gsettings set com.canonical.Unity.Devices blacklist "['-']"
 sleep 1
done

Then in order to make it run when I login I created a file named /home/jhosier/.config/autostart/stop-network-mounts-unity.desktop

The file contained the lines:

[Desktop Entry]
Type=Application
Exec=/home/jhosier/stop-network-mounts-unity
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_GB]=stop-network-mounts-unity.desktop
Name=stop-network-mounts-unity
Comment[en_GB]=stop-network-mounts-unity

This means that when I login to Ubuntu 14.04 with Unity, the file /home/jhosier/.config/autostart/stop-network-mounts-unity.desktop is executed which in turn calls the script /home/jhosier/stop-network-mounts-unity, which in turn writes to the file /home/jhosier/test.txt confirming that the script is constantly running in the background.

Now when I insert a CD it appears in the Unity Launcher Bar and I can open and mount the CD.
Then when I eject the CD (whether pressing the eject button on the CD drive or right clicking on the icon in the Unity Launcher Bar and choosing Eject) the CD gets ejected and all my network shares are populated into the Unity Launcher Bar as before, but after about 1 second they then get removed from the Unity Launcher Bar.

I hope this helps you too.

Artur (artur.) wrote :

Unfortunately setting blacklist to "['-']" in com.canonical.Unity.Devices does not work for USB drives, pendrives, partitions, etc. They are not removed from launchbar. I used dconf editor to watch the blacklist: it forgets gathered uuids right after disconnecting external device, so they appear again and again.

I found following workaround: there is com.canonical.Unity.Launcher.favorites parameter, the same Matpen tried to remove value 'unity://devices' from. It is enough to move 'unity://devices' to the end. The auto-USB-device icons - 3,5,10, whatever number is - still appear but at end of launchbar, so they do not disturb other icons. It is possible icons of new applications, not pinned to launchbar, can still be added after USB icons, so ensure 'unity://running-apps' and any other value occurs before 'unity://devices'. Unity remembers order of the values, after system reboot too.

If developers find a time to deal with this problem: IMHO the best solution is ONE icon, one icon to rule them all... Depending on user choice it may be pinned to launchbar or appear automatically after mounting first resource at /media/<user>. Hovering cursor or clicking it should expand list of all mounted devices to the right to allow to browse selected one (if more than one). A number of connected media on the icon would be a nice addition.

tellapu (tellapu) wrote :

I still hope there will be a fix! Thanks for any contributions!

ITEAS (info-tux-pc) wrote :

Hope it too...

Alex Baggott (alex-baggott) wrote :

Thank you for taking the time to report this bug. We have tried to recreate this on the latest release of Ubuntu and cannot reproduce it. This bug is being marked as Invalid. If you believe the problem to still exist in the latest version of Ubuntu, please comment on why that is the case and change the bug status to NEW.

When testing In 15.10 Beta 2, connected USB drives that have been unlocked from the launcher do not reappear when a CD is inserted. I did not test this with network shared filesystems.

Changed in unity:
status: Confirmed → Invalid
Changed in unity (Ubuntu):
status: Confirmed → Invalid
Dave DSH (ddastoussthi) wrote :

What do you mean invalid?
The whole problem is with NFS mounts through CIFS and you haven't tried? You've gotta be shitting me...

This is annoying the #$%^ outta me.

Dave DSH (ddastoussthi) on 2016-01-22
Changed in unity (Ubuntu):
status: Invalid → New
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity (Ubuntu):
status: New → Confirmed
Rich Daley (y-rich-j) wrote :

This has been bothering me too, so I thought I'd take a look. I'm no C++ person, but playing around a bit with the Unity sources I seem to have found at least part of the problem.

Here's what I found:

1. The VolumeImp::GetIdentifier() function returns "-" when GVolume devices in the launcher don't return values for G_VOLUME_IDENTIFIER_KIND_LABEL and G_VOLUME_IDENTIFIER_KIND_UUID.
2. In my case, my phone (USB) and NFS shares both fall into this category and are all blacklisted/whitelisted together as a single item.
3. Connecting or disconnecting my phone can cause the "-" to become whitelisted again, which puts them all back on the launcher.
4. Changing this function to look like this:

<pre><code>std::string GetIdentifier() const
  {
    glib::String label(g_volume_get_identifier(volume_, G_VOLUME_IDENTIFIER_KIND_LABEL));
    glib::String uuid(g_volume_get_identifier(volume_, G_VOLUME_IDENTIFIER_KIND_UUID));

    if (!uuid.Value() && !label.Value())
    {
      glib::String udi(g_volume_get_identifier(volume_, G_VOLUME_IDENTIFIER_KIND_HAL_UDI));
      glib::String nfsmount(g_volume_get_identifier(volume_, G_VOLUME_IDENTIFIER_KIND_NFS_MOUNT));
      glib::String unix(g_volume_get_identifier(volume_, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE));
      glib::String cls(g_volume_get_identifier(volume_, G_VOLUME_IDENTIFIER_KIND_CLASS));
      return udi.Str() + "-" + nfsmount.Str() + "-" + unix.Str() + "-" + cls.Str();
    }

    return uuid.Str() + "-" + label.Str();
  }
</code></pre>

changes the behaviour. The network devices are now blacklisted as "---network" (which suggests that CLASS is the only identifier type they respond to) and they don't return to the whitelist when I connect/disconnect my phone.

I think the correct solution to this (from someone who knows Gtk/GIO/C++ better than me) is to find a good unique identifier for these devices so they can be blacklisted independently, because it seems like their GVolume identifiers are not unique enough for this task.

Andrea Azzarone (azzar1) on 2016-06-01
tags: added: desktop-trello-import
no longer affects: unity
Changed in unity (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → Medium
assignee: nobody → Andrea Azzarone (azzar1)
Rich Daley (y-rich-j) wrote :

Hi @azzar1 - quick thought and please correct me if I'm wrong because I'm not a C++ person.

In your branch you have "if (!uuid && !label)" but those objects will always exist - does it not need to be "if (!uuid.Value() && !label.Value())"? Or do they evaluate to false when their value is false?

Andrea Azzarone (azzar1) wrote :

@Rich operator bool is overloaded in glib::String

Rich Daley (y-rich-j) wrote :

Awesome - thanks for the clarification! Really looking forward to a new release with this patch!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity - 7.5.0+16.10.20160602-0ubuntu1

---------------
unity (7.5.0+16.10.20160602-0ubuntu1) yakkety; urgency=medium

  [ Andrea Azzarone ]
  * Add whitelist for auto-repated keys. (LP: #1586491)
  * Fix scale window activation if in show desktop mode. (LP: #1582056)
  * Order matters in the rendering. Draw launcher shadow after the
    background in all cases. (LP: #1586374)
  * Fallback to volume name if no other identifier is available. (LP:
    #1103593)

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Thu, 02 Jun 2016 01:02:19 +0000

Changed in unity (Ubuntu):
status: In Progress → Fix Released
Andrea Azzarone (azzar1) on 2016-07-08
summary: - Unity always shows all devices in launcher when CD is inserted
+ [SRU] Unity always shows all devices in launcher when CD is inserted
summary: - [SRU] Unity always shows all devices in launcher when CD is inserted
+ Unity always shows all devices in launcher when CD is inserted
Andrea Azzarone (azzar1) on 2016-07-08
description: updated

Hello Dave, or anyone else affected,

Accepted unity into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unity/7.4.0+16.04.20160705-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in unity (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
tags: added: verification-done
removed: verification-needed
Steve Langasek (vorlon) wrote :

Hello Dave, or anyone else affected,

Accepted unity into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unity/7.4.0+16.04.20160715-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: removed: verification-done
tags: added: verification-needed
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity - 7.4.0+16.04.20160715-0ubuntu1

---------------
unity (7.4.0+16.04.20160715-0ubuntu1) xenial; urgency=medium

  [ Eleni Maria Stea ]
  * PanelView: Don't draw it if the geo doesn't intersect the monitor
    geo (as in ezoom)
  * speeds up the showdesktop plugin in lowgfx mode

  [ Andrea Azzarone ]
  * Add whitelist for auto-repated keys. (LP: #1586491)
  * Fix scale window activation if in show desktop mode. (LP: #1582056)
  * Order matters in the rendering. Draw launcher shadow after the
    background in all cases. (LP: #1586374)
  * Fallback to volume name if no other identifier is available. (LP:
    #1103593)
  * Do not trigger screensaver on session inactive. (LP: #1587507)
  * Use SwitcherController::SetDetail instead of detail=... (LP:
    #1587618)
  * UnitySettings: Add an option to enable/disable pam account checking.
    (LP: #1460649)
  * Lockscreen: Make sure warning and errors are properly shown to the
    user (LP: #1593696)
  * Add missing header to fix compilation error with -Duse_pch=OFF.
  * Filter out fullscreen window in show desktop mode. (LP: #1597706)
  * Make sure file manager icon is not removed when unpinned. (LP:
    #1578792)
  * Properly calculate the intersection geometry in PanelView::Draw.
    This is needed to properly call SyncGeometries and to avoid problems
    such as lp:1595698. (LP: #1595698)

  [ Alberto Milone ]
  * UnitySettings: Add dconf keys for disabling multitouch gestures (LP:
    #1589520)

  [ Marco Trevisan (Treviño) ]
  * LockScreenAcceleratorController: use key::Grabber to handle allowed
    bindings (LP: #1438754)
  * LockScreenAcceleratorController: check if a setting key is available
    instead of crashing
  * ApplicationLauncherIcon: ensure quirks are properly set on icon
    initialization
  * Views: Toggle animators durations based on low-gfx setting (LP:
    #1598770)
  * unity7.conf: use different compiz profile based on
    unity_support_test result (LP: #1598770)

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Fri, 15 Jul 2016 10:14:41 +0000

Changed in unity (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for unity has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Rich Daley (y-rich-j) wrote :

I can confirm that this morning's update appears to fix the issue for me on xenial x86_64.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers