Unity always shows all devices in launcher when CD is inserted

Bug #1103593 reported by Dave Vree
158
This bug affects 35 people
Affects Status Importance Assigned to Milestone
unity (Ubuntu)
Fix Released
Medium
Andrea Azzarone
Xenial
Fix Released
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

Dave Vree (hdave)
affects: udisks2 (Ubuntu) → launcher (Ubuntu)
Martin Pitt (pitti)
affects: launcher (Ubuntu) → unity (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
pcworld (pcworld) wrote :
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
dafreez (dafreez-gmail) wrote :

NB2: This seems related to

#1060484 (fixed)
#792085
#1206298

Revision history for this message
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

Revision history for this message
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 :-(

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
tellapu (tellapu) wrote :

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

Revision history for this message
ITEAS (info-tux-pc) wrote :

Hope it too...

Revision history for this message
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
Revision history for this message
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)
Changed in unity (Ubuntu):
status: Invalid → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
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)
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)
Revision history for this message
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?

Revision history for this message
Will Cooke (willcooke) wrote : Automatically added comment
tags: removed: desktop-trello-import
Revision history for this message
Andrea Azzarone (azzar1) wrote :

@Rich operator bool is overloaded in glib::String

Revision history for this message
Rich Daley (y-rich-j) wrote :

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

Revision history for this message
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)
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)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

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
Revision history for this message
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
Revision history for this message
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
Revision history for this message
Adam Conrad (adconrad) wrote : Update 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.

Revision history for this message
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.

Revision history for this message
MasterCATZ (mastercatz) wrote :

Ubuntu 18.4

having issues with all my multi-path drives constantly showing when black listed

using dconf-editor, scroll down to com → canonical → Unity → devices and shows the UUID of the mounts I unlocked from the Launcher in the blacklist

['edce7b85-018c-41d9-b049-66637bf95040-SRD6NA1B6', '1d6d82ca-18df-4b23-96ec-86f6c4cbef03-rescue', 'cda99451-448a-4fd5-8814-f71f2d078153-SRD5NA1B5', '5339a12a-e35a-4904-9117-dd59d787aa6f-SRD7NA1B7', '45db86a1-3ccd-4687-beb9-8b7c8ccc9f6c-SRD4NA1B4', 'bb1b0bd5-a21d-458c-b2b5-8f06edc4e144-SRD11NA1B10', 'b17fb70f-69dc-4101-a1df-a36a9c3925ce-SRD14NA1B13', '20385169-bb82-4fcf-9cbf-135fa9a9814f-SRD16NA1B15', 'eb6480ae-8739-4318-8022-c99ff37dfcd2-SRD15NA1B14', 'bd9ea90a-cc1a-4332-9a43-35c44ebb79dd-SRD6NA1B5', 'c74986f0-2a5b-4a0e-a132-b32424577385-SRP1NA1B20', '89e8ae64-10bb-4dac-a055-2e5e333d8da0-SRD9NA1B8', '7d40febc-057b-4549-a13b-7cf0b26dfed6-SRD4NA1B3', 'b7bf61a4-84ef-42d8-a27b-ef0ac73ef70b-SRD10NA1B9', 'd1a78c29-cc83-4d31-9e23-bf222daab659-SRD17NA1B16', '0a4a46d2-fe5d-4c67-9cb7-8253f1bc4903-SRD2NA1B1', '26e2702b-5614-4d50-9554-0025e7a884d9-SRP4NA1B23', '2b897e01-3799-4359-b230-02e457e391bd-SRD8NA1B7', 'a52a189e-3eb6-4271-81e6-00c460e2cd60-SRD5NA1B4', 'a12f1546-8bcf-4a0e-bb05-71691a88632b-SRD3NA1B2', '2a9b052c-645b-42c6-afd3-742e76e98d0a-SRP3NA1B22', '92fb492e-a667-4c59-bd08-6d64a0479417-SRD13NA1B12', 'dd052ca7-1ea7-49fa-9ba9-aed1f8898a13-SRD12NA1B11', '4cf1ec32-4a85-4c47-a27c-a93c7e5329d5-SRD19NA1B18', '39c82bb8-7ba1-41ca-8fa2-9c1458d13f7b-SRD20NA1B19', 'aab59b87-e9a4-4c52-aeb8-5b3bf45f8aea-SRD18NA1B17', '89395c82-5b62-43de-8cf2-1064e18d2b0a-SRD7NA1B6', '20f9ba35-b65d-450c-9d91-d71d088f22b7-SRD1NA1B0', '260fc195-a7cf-409e-9310-bb7be6a3620b-SRP2NA1B21']

but every few hours they all end back in the Launcher

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.