From 723ccb70eeac2980732de1161fed55c8e4176bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 4 Jan 2024 14:39:45 +0100 Subject: [PATCH] mountOperation: Close when drive gets disconnected If the volume that corresponds to the mount operation has an associated drive, we should withdraw any pending dialogs or notifications when the drive gets physically disconnected, as they've become obsolete. Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7302 Part-of: --- js/ui/shellMountOperation.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js index 84f8ad631..caef313af 100644 --- a/js/ui/shellMountOperation.js +++ b/js/ui/shellMountOperation.js @@ -74,6 +74,10 @@ export class ShellMountOperation { this.close.bind(this)); this.mountOp.connect('show-unmount-progress', this._onShowUnmountProgress.bind(this)); + + this._drive = source.get_drive(); + this._drive?.connectObject('disconnected', + this.close.bind(this), this); } _closeExistingDialog() { @@ -141,6 +145,11 @@ export class ShellMountOperation { this._notifier.done(); this._notifier = null; } + + if (this._drive) { + this._drive.disconnectObject(this); + this._drive = null; + } } _onShowProcesses2(op) {