summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-12-05 23:10:54 -0500
committerFlorian Müllner <fmuellner@gnome.org>2020-01-20 17:48:31 +0100
commitb0362945f4404fe270ad3aabe9282c5100066b26 (patch)
tree71ced936453bb7b5116ad4c258cb4afda333a89f
parent1fb955b8daf30258d59e5dc328e906cdc1558bc7 (diff)
downloadgnome-shell-b0362945f4404fe270ad3aabe9282c5100066b26.tar.gz
data: Stop providing an Access portal backenddrop-portal
A portal review by the design team has concluded that it is better to have all portals as application-modal GTK dialogs, instead of mixing them with some system-modal shell dialogs. https://gitlab.gnome.org/GNOME/gnome-shell/issues/1994
-rw-r--r--data/dbus-interfaces/org.freedesktop.impl.portal.Access.xml15
-rw-r--r--data/gnome-shell-dbus-interfaces.gresource.xml1
-rw-r--r--data/gnome-shell.portal4
-rw-r--r--data/meson.build1
-rw-r--r--js/js-resources.gresource.xml1
-rw-r--r--js/ui/accessDialog.js156
-rw-r--r--js/ui/main.js5
-rw-r--r--meson.build1
-rw-r--r--po/POTFILES.in1
9 files changed, 1 insertions, 184 deletions
diff --git a/data/dbus-interfaces/org.freedesktop.impl.portal.Access.xml b/data/dbus-interfaces/org.freedesktop.impl.portal.Access.xml
deleted file mode 100644
index 802a2c15d..000000000
--- a/data/dbus-interfaces/org.freedesktop.impl.portal.Access.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<node>
- <interface name="org.freedesktop.impl.portal.Access">
- <method name="AccessDialog">
- <arg type="o" name="handle" direction="in"/>
- <arg type="s" name="app_id" direction="in"/>
- <arg type="s" name="parent_window" direction="in"/>
- <arg type="s" name="title" direction="in"/>
- <arg type="s" name="subtitle" direction="in"/>
- <arg type="s" name="body" direction="in"/>
- <arg type="a{sv}" name="options" direction="in"/>
- <arg type="u" name="response" direction="out"/>
- <arg type="a{sv}" name="results" direction="out"/>
- </method>
- </interface>
-</node>
diff --git a/data/gnome-shell-dbus-interfaces.gresource.xml b/data/gnome-shell-dbus-interfaces.gresource.xml
index db3ef4ac2..92a8d3d27 100644
--- a/data/gnome-shell-dbus-interfaces.gresource.xml
+++ b/data/gnome-shell-dbus-interfaces.gresource.xml
@@ -9,7 +9,6 @@
<file preprocess="xml-stripblanks">org.freedesktop.DBus.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.GeoClue2.Agent.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.GeoClue2.Manager.xml</file>
- <file preprocess="xml-stripblanks">org.freedesktop.impl.portal.Access.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.impl.portal.PermissionStore.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.impl.portal.Request.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.login1.Manager.xml</file>
diff --git a/data/gnome-shell.portal b/data/gnome-shell.portal
deleted file mode 100644
index b70463777..000000000
--- a/data/gnome-shell.portal
+++ /dev/null
@@ -1,4 +0,0 @@
-[portal]
-DBusName=org.freedesktop.impl.portal.desktop.gnome
-Interfaces=org.freedesktop.impl.portal.Access
-UseIn=gnome
diff --git a/data/meson.build b/data/meson.build
index ee4b1abbf..553c5c956 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -72,7 +72,6 @@ configure_file(
)
-install_data('gnome-shell.portal', install_dir: portaldir)
install_data('50-gnome-shell-system.xml', install_dir: keysdir)
diff --git a/js/js-resources.gresource.xml b/js/js-resources.gresource.xml
index aec3427e0..5f8be8fac 100644
--- a/js/js-resources.gresource.xml
+++ b/js/js-resources.gresource.xml
@@ -32,7 +32,6 @@
<file>perf/core.js</file>
<file>perf/hwtest.js</file>
- <file>ui/accessDialog.js</file>
<file>ui/altTab.js</file>
<file>ui/animation.js</file>
<file>ui/appDisplay.js</file>
diff --git a/js/ui/accessDialog.js b/js/ui/accessDialog.js
deleted file mode 100644
index 6d3ede01e..000000000
--- a/js/ui/accessDialog.js
+++ /dev/null
@@ -1,156 +0,0 @@
-/* exported AccessDialogDBus */
-const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
-
-const CheckBox = imports.ui.checkBox;
-const Dialog = imports.ui.dialog;
-const ModalDialog = imports.ui.modalDialog;
-
-const { loadInterfaceXML } = imports.misc.fileUtils;
-
-const RequestIface = loadInterfaceXML('org.freedesktop.impl.portal.Request');
-const AccessIface = loadInterfaceXML('org.freedesktop.impl.portal.Access');
-
-var DialogResponse = {
- OK: 0,
- CANCEL: 1,
- CLOSED: 2,
-};
-
-var AccessDialog = GObject.registerClass(
-class AccessDialog extends ModalDialog.ModalDialog {
- _init(invocation, handle, title, description, body, options) {
- super._init({ styleClass: 'access-dialog' });
-
- this._invocation = invocation;
- this._handle = handle;
-
- this._requestExported = false;
- this._request = Gio.DBusExportedObject.wrapJSObject(RequestIface, this);
-
- for (let option in options)
- options[option] = options[option].deep_unpack();
-
- this._buildLayout(title, description, body, options);
- }
-
- _buildLayout(title, description, body, options) {
- // No support for non-modal system dialogs, so ignore the option
- // let modal = options['modal'] || true;
- let denyLabel = options['deny_label'] || _("Deny Access");
- let grantLabel = options['grant_label'] || _("Grant Access");
- let choices = options['choices'] || [];
-
- let content = new Dialog.MessageDialogContent({ title, description });
- this.contentLayout.add_actor(content);
-
- this._choices = new Map();
-
- for (let i = 0; i < choices.length; i++) {
- let [id, name, opts, selected] = choices[i];
- if (opts.length > 0)
- continue; // radio buttons, not implemented
-
- let check = new CheckBox.CheckBox();
- check.getLabelActor().text = name;
- check.checked = selected == "true";
- content.add_child(check);
-
- this._choices.set(id, check);
- }
-
- let bodyLabel = new St.Label({
- text: body,
- x_align: Clutter.ActorAlign.CENTER,
- });
- content.add_child(bodyLabel);
-
- this.addButton({ label: denyLabel,
- action: () => {
- this._sendResponse(DialogResponse.CANCEL);
- },
- key: Clutter.KEY_Escape });
- this.addButton({ label: grantLabel,
- action: () => {
- this._sendResponse(DialogResponse.OK);
- } });
- }
-
- open() {
- super.open();
-
- let connection = this._invocation.get_connection();
- this._requestExported = this._request.export(connection, this._handle);
- }
-
- CloseAsync(invocation, _params) {
- if (this._invocation.get_sender() != invocation.get_sender()) {
- invocation.return_error_literal(Gio.DBusError,
- Gio.DBusError.ACCESS_DENIED,
- '');
- return;
- }
-
- this._sendResponse(DialogResponse.CLOSED);
- }
-
- _sendResponse(response) {
- if (this._requestExported)
- this._request.unexport();
- this._requestExported = false;
-
- let results = {};
- if (response == DialogResponse.OK) {
- for (let [id, check] of this._choices) {
- let checked = check.checked ? 'true' : 'false';
- results[id] = new GLib.Variant('s', checked);
- }
- }
-
- // Delay actual response until the end of the close animation (if any)
- this.connect('closed', () => {
- this._invocation.return_value(new GLib.Variant('(ua{sv})',
- [response, results]));
- });
- this.close();
- }
-});
-
-var AccessDialogDBus = class {
- constructor() {
- this._accessDialog = null;
-
- this._windowTracker = Shell.WindowTracker.get_default();
-
- this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(AccessIface, this);
- this._dbusImpl.export(Gio.DBus.session, '/org/freedesktop/portal/desktop');
-
- Gio.DBus.session.own_name('org.freedesktop.impl.portal.desktop.gnome', Gio.BusNameOwnerFlags.REPLACE, null, null);
- }
-
- AccessDialogAsync(params, invocation) {
- if (this._accessDialog) {
- invocation.return_error_literal(Gio.DBusError,
- Gio.DBusError.LIMITS_EXCEEDED,
- 'Already showing a system access dialog');
- return;
- }
-
- let [handle, appId, parentWindow_, title, description, body, options] = params;
- // We probably want to use parentWindow and global.display.focus_window
- // for this check in the future
- if (appId && `${appId}.desktop` != this._windowTracker.focus_app.id) {
- invocation.return_error_literal(Gio.DBusError,
- Gio.DBusError.ACCESS_DENIED,
- 'Only the focused app is allowed to show a system access dialog');
- return;
- }
-
- let dialog = new AccessDialog(
- invocation, handle, title, description, body, options);
- dialog.open();
-
- dialog.connect('closed', () => (this._accessDialog = null));
-
- this._accessDialog = dialog;
- }
-};
diff --git a/js/ui/main.js b/js/ui/main.js
index 09b0249aa..18b705dd0 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -2,7 +2,7 @@
/* exported componentManager, notificationDaemon, windowAttentionHandler,
ctrlAltTabManager, padOsdService, osdWindowManager,
osdMonitorLabeler, shellMountOpDBusService, shellDBusService,
- shellAccessDialogDBusService, shellAudioSelectionDBusService,
+ shellAudioSelectionDBusService,
screenSaverDBus, screencastService, uiGroup, magnifier,
xdndHandler, keyboard, kbdA11yDialog, introspectService,
start, pushModal, popModal, activateWindow, createLookingGlass,
@@ -10,7 +10,6 @@
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
-const AccessDialog = imports.ui.accessDialog;
const AudioDeviceSelection = imports.ui.audioDeviceSelection;
const Components = imports.ui.components;
const CtrlAltTab = imports.ui.ctrlAltTab;
@@ -68,7 +67,6 @@ var padOsdService = null;
var osdWindowManager = null;
var osdMonitorLabeler = null;
var sessionMode = null;
-var shellAccessDialogDBusService = null;
var shellAudioSelectionDBusService = null;
var shellDBusService = null;
var shellMountOpDBusService = null;
@@ -137,7 +135,6 @@ function start() {
St.Settings.get().connect('notify::gtk-theme', _loadDefaultStylesheet);
_initializeUI();
- shellAccessDialogDBusService = new AccessDialog.AccessDialogDBus();
shellAudioSelectionDBusService = new AudioDeviceSelection.AudioDeviceSelectionDBus();
shellDBusService = new ShellDBus.GnomeShell();
shellMountOpDBusService = new ShellMountOperation.GnomeShellMountOpHandler();
diff --git a/meson.build b/meson.build
index 1ee210703..91724d8ea 100644
--- a/meson.build
+++ b/meson.build
@@ -57,7 +57,6 @@ convertdir = join_paths(datadir, 'GConf', 'gsettings')
desktopdir = join_paths(datadir, 'applications')
ifacedir = join_paths(datadir, 'dbus-1', 'interfaces')
localedir = join_paths(datadir, 'locale')
-portaldir = join_paths(datadir, 'xdg-desktop-portal', 'portals')
schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
servicedir = join_paths(datadir, 'dbus-1', 'services')
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c8d6c03de..cb94a3438 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -12,7 +12,6 @@ js/gdm/util.js
js/misc/systemActions.js
js/misc/util.js
js/portalHelper/main.js
-js/ui/accessDialog.js
js/ui/appDisplay.js
js/ui/appFavorites.js
js/ui/audioDeviceSelection.js