Skip to content

Commit

Permalink
polkitAuthenticationAgent.js: Fix dialog cancellation when
Browse files Browse the repository at this point in the history
transitions are disabled.

When no transitions are allowed, _emitDone() ends up being called
too late causing two issues:

- The PolKit session instance is canceled in _destroySession(),
  causing its 'completed' signal to be fired. This runs the signal
  handler _onSessionCompleted(). Since this._doneEmitted hasn't
  been set yet the authentication attempt ends up being *restarted*
  internally.
- modalDialog.close() results in the AuthenticationDialog being
  disposed, causing this._emitDone() to fail on an invalid GObject.
  This results in Cinnamon never completing the polkit request.

Emit the 'done' signal immediately, so pkit isn't held up by anything
UI-related in Cinnamon.

Fixes linuxmint/mint22.1-beta#89
  • Loading branch information
mtwebster committed Dec 31, 2024
1 parent 4c4bd53 commit 6bb2684
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/ui/polkitAuthenticationAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ var AuthenticationDialog = GObject.registerClass({

cancel() {
this._wasDismissed = true;
this.close(global.get_current_time());
this._emitDone(true);
this.close(global.get_current_time());
}

_onDialogClosed() {
Expand Down

0 comments on commit 6bb2684

Please sign in to comment.