lxqt-panel icon indicating copy to clipboard operation
lxqt-panel copied to clipboard

Unmount encrypted external drive impossible from plugin-mount menu

Open stefonarch opened this issue 4 years ago • 1 comments

Clicking on the eject button in the popup menu from plugin-mount does nothing when usb drive is encrypted. Unmount in pcmanfm-qt sidebar works as expected.

Expected Behavior

Unmount encrypted drive from panel works.

Current Behavior

It does nothing.

Steps to Reproduce (for bugs)
  1. Connect an encrypted usb drive
  2. fill out passwd dialog
  3. try to unmount from panel, plugin mount widget.
System Information
  • Distribution & Version: latest git, probably all

stefonarch avatar Jul 20 '21 20:07 stefonarch

Just wanted to say that pcmanfm-qt (actually, libfm-qt) and plugin-mount have totally different methods for it: the former uses GLib/GIO while the latter makes use of solid (belonging to KDE Frameworks).

tsujan avatar Jul 20 '21 21:07 tsujan

This is still annoying. Will check in a plasma session if there's something working, not sure if there is an applet on the panel.

stefonarch avatar May 04 '24 16:05 stefonarch

This is still annoying.

Because nothing has changed ;)

I'd use only pcmanfm-qt for such jobs.

tsujan avatar May 04 '24 16:05 tsujan

Just out of curiosity I had a look in the implementation… Tsujan is fully correct here. The plugin itself simply ignores LXQt's (existing) device management approach (-> pcmanfm-qt).

Let me prepare something…

antis81 avatar May 05 '24 10:05 antis81

The plugin itself simply ignores LXQt's (existing) device management approach

LXQt is modular and can be used without pcmanfm-qt/libfm-qt. lxqt-panel isn't and shouldn't be dependent on libfm-qt, and vice versa.

tsujan avatar May 05 '24 12:05 tsujan

Sure lxqt-panel is (conceptually) broken in many ways… What do you suggest!?

antis81 avatar May 05 '24 14:05 antis81

Sure lxqt-panel is (conceptually) broken in many ways

I don't know what you're talking about.

What do you suggest!?

Like in other places. If the bug is in the code, it should be fixed. If it's in solid, maybe a workaround could be found. Finally, if solid isn't supposed to handle this situation, the corresponding option could be removed.

In short, someone needs to look into the current code, not to dismiss it altogether.

tsujan avatar May 05 '24 15:05 tsujan

(As written earlier) I actually had a look in the code (exactly here). Although the "architecture" is very spaghetty :spaghetti: it is unlikely a bug in the lxqt-panel code since the specific scenario can be observed only on encrypted devices. (Spaghetti fixing is not for me anymore… :rofl:)

antis81 avatar May 05 '24 18:05 antis81

@stefonarch I found a little time and, after seeing that the code was simple and clean, added a few debug messages to it. The problem was as simple as this: solid couldn't "see" that an encrypted volume was mounted by GLib/GIO, although GLib/GIO didn't have that problem with solid.

More details:

  1. I had an encrypted volume on an external disk. First, I mounted it with pcmanfm-qt, but solid didn't "see" that it was mounted, or more precisely, the signal Solid::StorageAccess::accessibilityChanged was not emitted. As a result, the eject button was not enabled. Of course, a disabled eject button couldn't do anything.
  2. Then, I unmounted the volume from pcmanfm-qt and mounted it with Panel's Removable Media plugin instead. This time, Solid::StorageAccess::accessibilityChanged was emitted, the eject button was enabled, and I was able to unmount the volume by clicking the eject button.

So, I don't think we can do anything about this. GLib/GIO is simply superior to solid. To put it differently, solid has a bug about encrypted volumes that's revealed by GLib, not when solid is used to mount them.

tsujan avatar May 05 '24 23:05 tsujan

Then, I unmounted the volume from pcmanfm-qt and mounted it with Panel's Removable Media plugin instead

I connected the device, ignored the popup and used the button on the panel, first it asked me the passwd for kwalletd6, then the passwd for the disk. I remember kwallet to be complicated as many other things in KDE.

https://github.com/lxqt/lxqt-panel/assets/10681413/45675b2a-9b9b-4add-a8e7-3cb0b03dfe2c

stefonarch avatar May 06 '24 06:05 stefonarch

first it asked me the passwd for kwalletd6

Nothing about KWallet here, but that's beside the point.

Even if the encrypted volume is mounted by pcmanfm-qt, restarting of Panel makes the Removable Media plugin see the mounted volume and enable its eject button. The bug is that no solid signal is emitted when the encrypted volume is mounted by GLib.

tsujan avatar May 06 '24 11:05 tsujan

There's no way to fake/send such a signal?

stefonarch avatar May 06 '24 11:05 stefonarch

No, but there may be a workaround: to update the mount state every time the popup is shown. I'll make a patch.

tsujan avatar May 06 '24 11:05 tsujan