Bug 426990 - If a removable device is plugged-in and/or a disc is inside an optical device, "Disks & Devices" popup always opens when Plasma session is started or plasmashell process is restarted
Summary: If a removable device is plugged-in and/or a disc is inside an optical device...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Disks & Devices widget (other bugs)
Version First Reported In: 5.19.90
Platform: Arch Linux Linux
: VHI normal
Target Milestone: 1.0
Assignee: Nate Graham
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-09-26 13:14 UTC by Patrick Silva
Modified: 2020-10-03 13:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.20
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2020-09-26 13:14:32 UTC
SUMMARY
Device Notifier was renamed to "Disks & Devices" in Plasma 5.20 beta
and the option "Open popup when new device is plugged in" is no longer available. Consequently, now a popup always opens when Plasma session is started or plasmashell process is restarted manually or automatically due to crash if a removable device is plugged-in and/or a disc is inside an optical device and there is no way to prevent this behavior.


STEPS TO REPRODUCE
1. have a removable device connected to usb port and/or a cd/dvd/bd inside an optical device
2. start or restart Plasma session. Or restart plasmashell process running "plasmashell --replace".
3. 

OBSERVED RESULT
"Disks & Devices" popup opens

EXPECTED RESULT
behavior of "Disks & Devices" popup should be configurable like the behavior of "Device Notifier" popup was before Plasma 5.20 beta.

Operating System: Arch Linux
KDE Plasma Version: 5.19.90
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1
Comment 1 Fabian Vogt 2020-10-02 08:14:37 UTC
openQA sees the same and fails because of this: https://openqa.opensuse.org/tests/1415989#step/first_boot/1

This didn't happen with Plasma 5.19.5:
https://openqa.opensuse.org/tests/1407746#step/first_boot/1

Reassigning to Nate, who touched it last :P
Comment 2 Nate Graham 2020-10-02 15:21:48 UTC
>(In reply to Patrick Silva from comment #0)
> SUMMARY
> Device Notifier was renamed to "Disks & Devices" in Plasma 5.20 beta
> and the option "Open popup when new device is plugged in" is no longer
> available. Consequently, now a popup always opens when Plasma session is
> started or plasmashell process is restarted manually or automatically due to
> crash if a removable device is plugged-in and/or a disc is inside an optical
> device and there is no way to prevent this behavior.
Does this mean that you had unchecked that checkbox to work around a bug whereby the old popup always opened on login? Or was it not happening before and it just started happening now?
Comment 3 Fabian Vogt 2020-10-02 15:28:59 UTC
(In reply to Nate Graham from comment #2)
> >(In reply to Patrick Silva from comment #0)
> > SUMMARY
> > Device Notifier was renamed to "Disks & Devices" in Plasma 5.20 beta
> > and the option "Open popup when new device is plugged in" is no longer
> > available. Consequently, now a popup always opens when Plasma session is
> > started or plasmashell process is restarted manually or automatically due to
> > crash if a removable device is plugged-in and/or a disc is inside an optical
> > device and there is no way to prevent this behavior.
> Does this mean that you had unchecked that checkbox to work around a bug
> whereby the old popup always opened on login? Or was it not happening before
> and it just started happening now?

At least in openQA it runs with default settings. With Plasma 5.19.5, there is no popup on login (just the icon is there) and with the 5.20 Beta there is a popup on login.
Comment 4 Nate Graham 2020-10-02 15:33:30 UTC
Got it, thanks.
Comment 5 Patrick Silva 2020-10-02 15:35:39 UTC
(In reply to Nate Graham from comment #2)
> >(In reply to Patrick Silva from comment #0)
> > SUMMARY
> > Device Notifier was renamed to "Disks & Devices" in Plasma 5.20 beta
> > and the option "Open popup when new device is plugged in" is no longer
> > available. Consequently, now a popup always opens when Plasma session is
> > started or plasmashell process is restarted manually or automatically due to
> > crash if a removable device is plugged-in and/or a disc is inside an optical
> > device and there is no way to prevent this behavior.
> Does this mean that you had unchecked that checkbox to work around a bug
> whereby the old popup always opened on login? Or was it not happening before
> and it just started happening now?
"Open popup when new device is plugged in" was unchecked on my system before update to Plasma 5.20 beta, exactly to prevent the behavior of Plasma 5.20 beta. It worked as expected,
that is, no popup after login or plasmashell restarting.
Comment 6 Nate Graham 2020-10-02 15:59:50 UTC
Thanks.

Is there any way to simulate having an optical drive? None of my Linux computers have one. I can debug in a live ISO on a Windows desktop, but that will probably take longer.
Comment 7 Fabian Vogt 2020-10-02 16:02:32 UTC
(In reply to Nate Graham from comment #6)
> Thanks.
> 
> Is there any way to simulate having an optical drive? None of my Linux
> computers have one. I can debug in a live ISO on a Windows desktop, but that
> will probably take longer.

I don't think it has to be an optical drive. Any removable drive should do,
as long as it shows up in the notifier.
Comment 8 Nate Graham 2020-10-02 16:04:39 UTC
Ah, so the bug is more generic such that the pop-up should not appear if the external $thing is already present at boot. I did notice this while porting the applet but did not register it as a bug.

If people do consider it a bug, I can fix it.
Comment 9 Fabian Vogt 2020-10-02 18:03:42 UTC
(In reply to Nate Graham from comment #8)
> Ah, so the bug is more generic such that the pop-up should not appear if the
> external $thing is already present at boot. I did notice this while porting
> the applet but did not register it as a bug.
> 
> If people do consider it a bug, I can fix it.

At least I consider it a bug. It's not too uncommon to have semi-permanently attached storage, some even boot from it. (Though udev rules could be used as a workaround for that).

While it's not as much of a distraction/obstruction to people as it is currently to openQA, I don't see much value in showing the popup directly after login or plasma restarts/crashes.

So unless it's something which needs considerable work (I couldn't immediately spot the culprit), I'm in favor for restoring the old behaviour.
Comment 10 Nate Graham 2020-10-02 18:13:35 UTC
Fair enough. I'll see what I can do!
Comment 11 Bug Janitor Service 2020-10-02 21:41:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/320
Comment 12 Nate Graham 2020-10-03 13:15:42 UTC
Git commit 7f5339cb77c77caba94088fb1c9e28a913c21eda by Nate Graham.
Committed on 03/10/2020 at 13:15.
Pushed by ngraham into branch 'master'.

[applets/devicenotifier] Don't open popup for already-connected devices

The old applet only opened the popup when a new device was attached
after the applet was loaded, not if there was already a device attached
when the applet was loaded. This commit brings back the old behavior by
re-using the approach taken in the old applet.
FIXED-IN: 5.20

M  +4    -4    applets/devicenotifier/package/contents/ui/devicenotifier.qml

https://invent.kde.org/plasma/plasma-workspace/commit/7f5339cb77c77caba94088fb1c9e28a913c21eda
Comment 13 Nate Graham 2020-10-03 13:17:48 UTC
Git commit e22f0c90fb8a0946f29eda318e17cdc9982aa482 by Nate Graham.
Committed on 03/10/2020 at 13:17.
Pushed by ngraham into branch 'Plasma/5.20'.

[applets/devicenotifier] Don't open popup for already-connected devices

The old applet only opened the popup when a new device was attached
after the applet was loaded, not if there was already a device attached
when the applet was loaded. This commit brings back the old behavior by
re-using the approach taken in the old applet.
FIXED-IN: 5.20


(cherry picked from commit 7f5339cb77c77caba94088fb1c9e28a913c21eda)

M  +4    -4    applets/devicenotifier/package/contents/ui/devicenotifier.qml

https://invent.kde.org/plasma/plasma-workspace/commit/e22f0c90fb8a0946f29eda318e17cdc9982aa482