Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Polkit agent for X11 sessions #12272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ Depends:
metacity,
nemo,
network-manager-gnome [linux-any],
policykit-1-gnome,
python3,
python3-dbus,
python3-distro,
Expand Down
4 changes: 1 addition & 3 deletions js/ui/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,7 @@ function start() {
_initUserSession();
screenRecorder = new ScreenRecorder.ScreenRecorder();

if (Meta.is_wayland_compositor()) {
PolkitAuthenticationAgent.init();
}
PolkitAuthenticationAgent.init();

_startDate = new Date();

Expand Down
20 changes: 19 additions & 1 deletion js/ui/polkitAuthenticationAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const PolkitAgent = imports.gi.PolkitAgent;
const ModalDialog = imports.ui.modalDialog;
const CinnamonEntry = imports.ui.cinnamonEntry;
const UserWidget = imports.ui.userWidget;
const Main = imports.ui.main;

const DIALOG_ICON_SIZE = 64;

Expand Down Expand Up @@ -389,5 +390,22 @@ AuthenticationAgent.prototype = {
}

function init() {
let agent = new AuthenticationAgent();
try {
let agent = new AuthenticationAgent();
} catch(err) {
if(!(err instanceof Error)) {
err = new Error(err);
}

log('polkitAuthenticationAgent: init error ' + err);

let icon = new St.Icon({ icon_name: 'dialog-warning',
icon_type: St.IconType.FULLCOLOR,
icon_size: 36 });

Main.warningNotify(_('Unable to start Cinnamon PolicyKit Agent'), err.message +
"\n\n" +
_("If you have another PolicyKit Agent configured to autostart, it should be disabled."),
icon);
Comment on lines +396 to +409
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was my best guess at how to handle this. I wasn't sure if it belonged here or in main.js

}
}
Loading