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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3089>
This commit is contained in:
Florian Müllner 2024-01-04 14:39:45 +01:00 committed by Marge Bot
parent 075df42d01
commit 723ccb70ee

View File

@ -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) {