Skip to content

Commit

Permalink
Restore polkit agent.
Browse files Browse the repository at this point in the history
This will allow us to launch programs as root in a wayland session.

ref:
#10172

fixes: linuxmint/wayland#64
fixes: linuxmint/wayland#26
fixes: linuxmint/wayland#22

possible todo:
 - multi-user selection
  • Loading branch information
mtwebster committed Feb 9, 2024
1 parent f627573 commit 529d141
Show file tree
Hide file tree
Showing 8 changed files with 952 additions and 6 deletions.
73 changes: 73 additions & 0 deletions data/theme/cinnamon.css
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,79 @@ StScrollBar StButton#vhandle:hover {
-arrow-rise: 10px;
-boxpointer-gap: 5px;
}

/* ===================================================================
* Policykit authentication dialog
* ===================================================================*/
.polkit-dialog {
/* this is the width of the entire modal popup */
width: 500px;
}
.polkit-dialog-main-layout {
spacing: 24px;
padding: 10px;
}
.polkit-dialog-message-layout {
spacing: 16px;
}
.polkit-dialog-headline {
font-size: 12pt;
font-weight: bold;
color: #666666;
}
.polkit-dialog-description {
font-size: 10pt;
color: white;
}
.polkit-dialog-user-layout {
padding-left: 10px;
spacing: 10px;
}
.polkit-dialog-user-layout:rtl {
padding-left: 0px;
padding-right: 10px;
}
.polkit-dialog-user-root-label {
color: #ff0000;
}
.polkit-dialog-password-label:ltr {
padding-right: 0.5em;
}
.polkit-dialog-password-label:rtl {
padding-left: 0.5em;
}
.polkit-dialog-password-entry {
background-gradient-start: rgb(236,236,236);
background-gradient-end: white;
background-gradient-direction: vertical;
color: black;
border-radius: 5px;
border: 2px solid #555753;
}
.polkit-dialog-password-entry:focus {
border: 2px solid #3465a4;
}
.polkit-dialog-password-entry .capslock-warning {
icon-size: 16px;
warning-color: #999;
padding: 0 4px;
}
.polkit-dialog-error-label {
font-size: 10pt;
color: #ffff00;
padding-bottom: 8px;
}
.polkit-dialog-info-label {
font-size: 10pt;
padding-bottom: 8px;
}
/* intentionally left transparent to avoid dialog changing size */
.polkit-dialog-null-label {
font-size: 10pt;
color: rgba(0,0,0,0);
padding-bottom: 8px;
}

/* ###################################################################
* Cinnamon Specific Section
* ###################################################################*/
Expand Down
3 changes: 1 addition & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ Depends:
metacity,
nemo,
network-manager-gnome [linux-any],
policykit-1-gnome,
python3,
python3-dbus,
python3-distro,
Expand Down Expand Up @@ -115,7 +114,7 @@ Recommends:
gnome-themes-extra | gnome-themes-standard,
touchegg,
Suggests: cinnamon-doc
Provides: notification-daemon, x-window-manager
Provides: notification-daemon, x-window-manager, polkit-1-auth-agent
Description: Modern Linux desktop
Cinnamon is a modern Linux desktop which provides advanced innovative
features and a traditional user experience. It's easy to use, powerful
Expand Down
7 changes: 4 additions & 3 deletions js/ui/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const Overview = imports.ui.overview;
const Expo = imports.ui.expo;
const Panel = imports.ui.panel;
const PlacesManager = imports.ui.placesManager;
const PolkitAuthenticationAgent = imports.ui.polkitAuthenticationAgent;
const RunDialog = imports.ui.runDialog;
const Layout = imports.ui.layout;
const LookingGlass = imports.ui.lookingGlass;
Expand Down Expand Up @@ -431,9 +432,9 @@ function start() {
_initUserSession();
screenRecorder = new ScreenRecorder.ScreenRecorder();

// Provide the bus object for gnome-session to
// initiate logouts.
//EndSessionDialog.init();
if (Meta.is_wayland_compositor()) {
PolkitAuthenticationAgent.init();
}

_startDate = new Date();

Expand Down
3 changes: 2 additions & 1 deletion js/ui/modalDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ ModalDialog.prototype = {
this._group.add_actor(this._backgroundBin);

this._dialogLayout = new St.BoxLayout({ style_class: 'modal-dialog',
vertical: true });
vertical: true,
important: true });
if (params.styleClass != null) {
this._dialogLayout.add_style_class_name(params.styleClass);
}
Expand Down
Loading

0 comments on commit 529d141

Please sign in to comment.