This commit is contained in:
Ward Nakchbandi (Cosmic Fusion) 2023-10-03 21:55:10 +03:00 committed by GitHub
parent 17fb80f210
commit 419cd8ccb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 38 additions and 2376 deletions

7
debian/changelog vendored
View File

@ -1,3 +1,10 @@
gnome-shell-vrr (45.0-100pika1) pikauwu; urgency=medium
* Why are there two control files? wtffffffffffffff
-- Ward Nakchbandi <hotrod.master@hotmail.com> Fri, 07 Oct 2022 23:26:00 +0300
gnome-shell-vrr (44.2-99pika5) lunar; urgency=medium
* Why are there two control files? wtffffffffffffff

31
debian/control vendored
View File

@ -2,20 +2,12 @@
#
# Modifications should be made to debian/control.in instead.
# This file is regenerated automatically in the clean target.
# This file is autogenerated. DO NOT EDIT!
#
# Modifications should be made to debian/control.in instead.
# This file is regenerated automatically in the clean target.
# This file is autogenerated. DO NOT EDIT!
#
# Modifications should be made to debian/control.in instead.
# This file is regenerated automatically in the clean target.
Source: gnome-shell-vrr
Section: gnome
Priority: optional
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
Uploaders: Jeremy Bicha <jbicha@ubuntu.com>
Uploaders: Jeremy Bícha <jbicha@ubuntu.com>, Marco Trevisan (Treviño) <marco@ubuntu.com>
Build-Depends: appstream,
asciidoc-base,
bash-completion,
@ -54,8 +46,6 @@ Build-Depends: appstream,
libgnome-menu-3-dev,
libgstreamer1.0-dev,
libgstreamer-plugins-base1.0-dev,
libgtk-3-bin,
libgtk-3-dev <!nocheck>,
libgtk-4-dev,
libibus-1.0-dev (>= 1.5.22-2ubuntu2~),
libjson-glib-dev,
@ -79,7 +69,7 @@ Build-Depends: appstream,
xvfb <!nocheck>,
xwayland <!nocheck>
Rules-Requires-Root: no
Standards-Version: 4.6.1
Standards-Version: 4.6.2
Homepage: https://wiki.gnome.org/Projects/GnomeShell
XS-Debian-Vcs-Git: https://salsa.debian.org/gnome-team/gnome-shell.git
XS-Debian-Vcs-Browser: https://salsa.debian.org/gnome-team/gnome-shell
@ -107,7 +97,7 @@ Depends: gir1.2-accountsservice-1.0,
gir1.2-gweather-4.0 (>= 4.1),
gir1.2-freedesktop,
gir1.2-ibus-1.0 (>= 1.5.22-2ubuntu2~),
gir1.2-mutter-12 (>= 44.2),
gir1.2-mutter-13 (>= 45.0),
gir1.2-nm-1.0 [linux-any],
gir1.2-nma4-1.0 [linux-any],
gir1.2-pango-1.0,
@ -115,7 +105,7 @@ Depends: gir1.2-accountsservice-1.0,
gir1.2-rsvg-2.0,
gir1.2-soup-3.0,
gir1.2-upowerglib-1.0,
gir1.2-webkit2-4.1,
gir1.2-webkit-6.0,
gnome-settings-daemon (>= 40~),
gnome-shell-common-vrr (= ${source:Version}),
gsettings-desktop-schemas (>= 42~beta),
@ -158,11 +148,18 @@ Breaks: gnome-shell-extension-appindicator (<< 50),
gnome-shell-extensions (<< 40.0~),
Provides: notification-daemon,
polkit-1-auth-agent
Description: Gnome shell but actually good
Description: graphical shell for the GNOME desktop
The GNOME Shell provides core interface functions like switching
windows, launching applications or see your notifications. It takes
advantage of the capabilities of modern graphics hardware and
introduces innovative user interface concepts to provide a
delightful and easy to use experience. GNOME Shell is the defining
technology of the GNOME 3 user experience.
Package: gnome-shell-common-vrr
Architecture: all
Depends: ${misc:Depends}
Depends: ${misc:Depends}, mutter-vrr
Recommends: yaru-theme-gnome-shell (>= 23.10.0~)
Breaks: gnome-shell-vrr (<< 3.36.1-6~)
Replaces: gnome-shell-vrr (<< 3.36.1-6~)
Description: common files for the GNOME graphical shell
@ -184,4 +181,4 @@ Breaks: gnome-shell-vrr (<< 3.36.0-2)
Replaces: gnome-shell-vrr (<< 3.36.0-2)
Description: tool to enable / disable GNOME Shell extensions
This package contains a tool which users who use Shell extensions can use to
toggle them on and off, and access their preferences.
toggle them on and off, and access their preferences.

35
debian/control.in vendored
View File

@ -1,21 +1,9 @@
# This file is autogenerated. DO NOT EDIT!
#
# Modifications should be made to debian/control.in instead.
# This file is regenerated automatically in the clean target.
# This file is autogenerated. DO NOT EDIT!
#
# Modifications should be made to debian/control.in instead.
# This file is regenerated automatically in the clean target.
# This file is autogenerated. DO NOT EDIT!
#
# Modifications should be made to debian/control.in instead.
# This file is regenerated automatically in the clean target.
Source: gnome-shell-vrr
Section: gnome
Priority: optional
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
Uploaders: Jeremy Bicha <jbicha@ubuntu.com>
Uploaders: @GNOME_TEAM@
Build-Depends: appstream,
asciidoc-base,
bash-completion,
@ -54,8 +42,6 @@ Build-Depends: appstream,
libgnome-menu-3-dev,
libgstreamer1.0-dev,
libgstreamer-plugins-base1.0-dev,
libgtk-3-bin,
libgtk-3-dev <!nocheck>,
libgtk-4-dev,
libibus-1.0-dev (>= 1.5.22-2ubuntu2~),
libjson-glib-dev,
@ -79,7 +65,7 @@ Build-Depends: appstream,
xvfb <!nocheck>,
xwayland <!nocheck>
Rules-Requires-Root: no
Standards-Version: 4.6.1
Standards-Version: 4.6.2
Homepage: https://wiki.gnome.org/Projects/GnomeShell
XS-Debian-Vcs-Git: https://salsa.debian.org/gnome-team/gnome-shell.git
XS-Debian-Vcs-Browser: https://salsa.debian.org/gnome-team/gnome-shell
@ -107,7 +93,7 @@ Depends: gir1.2-accountsservice-1.0,
gir1.2-gweather-4.0 (>= 4.1),
gir1.2-freedesktop,
gir1.2-ibus-1.0 (>= 1.5.22-2ubuntu2~),
gir1.2-mutter-12 (>= 44.2),
gir1.2-mutter-13 (>= 45.0),
gir1.2-nm-1.0 [linux-any],
gir1.2-nma4-1.0 [linux-any],
gir1.2-pango-1.0,
@ -115,7 +101,7 @@ Depends: gir1.2-accountsservice-1.0,
gir1.2-rsvg-2.0,
gir1.2-soup-3.0,
gir1.2-upowerglib-1.0,
gir1.2-webkit2-4.1,
gir1.2-webkit-6.0,
gnome-settings-daemon (>= 40~),
gnome-shell-common-vrr (= ${source:Version}),
gsettings-desktop-schemas (>= 42~beta),
@ -158,11 +144,18 @@ Breaks: gnome-shell-extension-appindicator (<< 50),
gnome-shell-extensions (<< 40.0~),
Provides: notification-daemon,
polkit-1-auth-agent
Description: Gnome shell but actually good
Description: graphical shell for the GNOME desktop
The GNOME Shell provides core interface functions like switching
windows, launching applications or see your notifications. It takes
advantage of the capabilities of modern graphics hardware and
introduces innovative user interface concepts to provide a
delightful and easy to use experience. GNOME Shell is the defining
technology of the GNOME 3 user experience.
Package: gnome-shell-common-vrr
Architecture: all
Depends: ${misc:Depends}
Depends: ${misc:Depends}, mutter-vrr
Recommends: yaru-theme-gnome-shell (>= 23.10.0~)
Breaks: gnome-shell-vrr (<< 3.36.1-6~)
Replaces: gnome-shell-vrr (<< 3.36.1-6~)
Description: common files for the GNOME graphical shell
@ -184,4 +177,4 @@ Breaks: gnome-shell-vrr (<< 3.36.0-2)
Replaces: gnome-shell-vrr (<< 3.36.0-2)
Description: tool to enable / disable GNOME Shell extensions
This package contains a tool which users who use Shell extensions can use to
toggle them on and off, and access their preferences.
toggle them on and off, and access their preferences.

View File

@ -1,95 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Fri, 1 Apr 2022 02:41:07 +0200
Subject: Revert "st: Apply css foreground color to text as a PangoAttribute"
Using the pango foreground color implies that such part will have a
color set at pango level and so that cogl will use this value as a
color override (as per cogl_pango_renderer_set_color_for_part()).
This is fine for most labels, but in case the clutter-text has the
selected text color set, it is simply ignored, because the overridden
color is always preferred.
Also the reason for this commit, was not to apply colors on top of
colored fonts, but this won't happen anymore now because mutter's commit
aa136f45 ensures that no color will be applied to glyphs that are
already colored.
So to me it looks that's just safer to revert it, instead of adding
different logic to handle the selected-text-color case.
This reverts commit 66c4b1a8b607600f193b34e6a9f8c85f76c2ac2c.
Origin: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2260
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1878998
---
src/st/st-entry.c | 2 ++
src/st/st-private.c | 32 ++++++++++++++++++++++++++------
2 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index 64f85fd..d45ce95 100644
--- a/src/st/st-entry.c
+++ b/src/st/st-entry.c
@@ -1095,6 +1095,8 @@ st_entry_init (StEntry *entry)
g_signal_connect (priv->entry, "notify::line-alignment",
G_CALLBACK (invalidate_shadow_pipeline), entry);
+ g_signal_connect_swapped (priv->entry, "notify::editable",
+ G_CALLBACK (st_widget_style_changed), entry);
priv->spacing = 6.0f;
diff --git a/src/st/st-private.c b/src/st/st-private.c
index bb98151..1b70c5e 100644
--- a/src/st/st-private.c
+++ b/src/st/st-private.c
@@ -115,22 +115,42 @@ _st_set_text_from_style (ClutterText *text,
StTextDecoration decoration;
PangoAttrList *attribs = NULL;
const PangoFontDescription *font;
- PangoAttribute *foreground;
StTextAlign align;
gdouble spacing;
gchar *font_features;
+ gboolean foreground_color_set;
font = st_theme_node_get_font (theme_node);
clutter_text_set_font_description (text, (PangoFontDescription *) font);
attribs = pango_attr_list_new ();
+ foreground_color_set = FALSE;
st_theme_node_get_foreground_color (theme_node, &color);
- clutter_text_set_cursor_color (text, &color);
- foreground = pango_attr_foreground_new (color.red * 255,
- color.green * 255,
- color.blue * 255);
- pango_attr_list_insert (attribs, foreground);
+
+ if (clutter_text_get_editable (text))
+ {
+ ClutterColor selected_color;
+
+ if (st_theme_node_lookup_color (theme_node, "selected-color",
+ TRUE, &selected_color) &&
+ !clutter_color_equal (&selected_color, &color))
+ {
+ clutter_text_set_color (text, &color);
+ clutter_text_set_cursor_color (text, &color);
+ foreground_color_set = TRUE;
+ }
+ }
+
+ if (!foreground_color_set)
+ {
+ PangoAttribute *foreground;
+ clutter_text_set_cursor_color (text, &color);
+ foreground = pango_attr_foreground_new (color.red * 255,
+ color.green * 255,
+ color.blue * 255);
+ pango_attr_list_insert (attribs, foreground);
+ }
if (color.alpha != 255)
{

View File

@ -1,107 +0,0 @@
From: Jeremy Bicha <jeremy.bicha@canonical.com>
Date: Sun, 21 Aug 2022 10:30:55 -0400
Subject: Revert "build: Port to gcr4"
This reverts commit 5c935af7d3b3a3c9feb4e0d9ea214b6d25a7a2e7.
Forwarded: not-needed
---
js/ui/environment.js | 2 +-
meson.build | 4 ++--
src/meson.build | 2 +-
src/shell-keyring-prompt.c | 6 +++---
src/shell-secure-text-buffer.c | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/js/ui/environment.js b/js/ui/environment.js
index 224456d..d4292ca 100644
--- a/js/ui/environment.js
+++ b/js/ui/environment.js
@@ -8,7 +8,7 @@ imports.gi.versions.Atk = '1.0';
imports.gi.versions.Atspi = '2.0';
imports.gi.versions.Clutter = Config.LIBMUTTER_API_VERSION;
imports.gi.versions.Cogl = Config.LIBMUTTER_API_VERSION;
-imports.gi.versions.Gcr = '4';
+imports.gi.versions.Gcr = '3';
imports.gi.versions.Gdk = '4.0';
imports.gi.versions.Gdm = '1.0';
imports.gi.versions.Geoclue = '2.0';
diff --git a/meson.build b/meson.build
index 7b08fe5..0100552 100644
--- a/meson.build
+++ b/meson.build
@@ -20,7 +20,7 @@ libmutter_test_pc = 'libmutter-test-' + mutter_api_version
ecal_req = '>= 3.33.1'
eds_req = '>= 3.33.1'
-gcr_req = '>= 3.90.0'
+gcr_req = '>= 3.7.5'
gio_req = '>= 2.56.0'
gi_req = '>= 1.49.1'
gjs_req = '>= 1.73.1'
@@ -71,7 +71,7 @@ endif
atk_bridge_dep = dependency('atk-bridge-2.0')
ecal_dep = dependency('libecal-2.0', version: ecal_req)
eds_dep = dependency('libedataserver-1.2', version: eds_req)
-gcr_dep = dependency('gcr-4', version: gcr_req)
+gcr_dep = dependency('gcr-base-3', version: gcr_req)
gdk_x11_dep = dependency('gdk-x11-3.0')
gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0')
gi_dep = dependency('gobject-introspection-1.0', version: gi_req)
diff --git a/src/meson.build b/src/meson.build
index 4f88207..512c213 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -213,7 +213,7 @@ libshell_dep = declare_dependency(link_with: libshell)
libshell_gir_includes = [
'Clutter-@0@'.format(mutter_api_version),
'Meta-@0@'.format(mutter_api_version),
- 'Gcr-4',
+ 'Gcr-3',
'PolkitAgent-1.0',
'GdkPixbuf-2.0'
]
diff --git a/src/shell-keyring-prompt.c b/src/shell-keyring-prompt.c
index bb03279..83c6746 100644
--- a/src/shell-keyring-prompt.c
+++ b/src/shell-keyring-prompt.c
@@ -26,7 +26,7 @@
#include "shell-secure-text-buffer.h"
#define GCR_API_SUBJECT_TO_CHANGE
-#include <gcr/gcr.h>
+#include <gcr/gcr-base.h>
#include <glib/gi18n.h>
@@ -91,7 +91,7 @@ enum {
static GParamSpec *props[N_PROPS] = { NULL, };
-static void shell_keyring_prompt_iface (GcrPromptInterface *iface);
+static void shell_keyring_prompt_iface (GcrPromptIface *iface);
G_DEFINE_TYPE_WITH_CODE (ShellKeyringPrompt, shell_keyring_prompt, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GCR_TYPE_PROMPT, shell_keyring_prompt_iface);
@@ -531,7 +531,7 @@ shell_keyring_prompt_close (GcrPrompt *prompt)
}
static void
-shell_keyring_prompt_iface (GcrPromptInterface *iface)
+shell_keyring_prompt_iface (GcrPromptIface *iface)
{
iface->prompt_password_async = shell_keyring_prompt_password_async;
iface->prompt_password_finish = shell_keyring_prompt_password_finish;
diff --git a/src/shell-secure-text-buffer.c b/src/shell-secure-text-buffer.c
index 8271410..03af451 100644
--- a/src/shell-secure-text-buffer.c
+++ b/src/shell-secure-text-buffer.c
@@ -26,7 +26,7 @@
#include "shell-secure-text-buffer.h"
#define GCR_API_SUBJECT_TO_CHANGE
-#include <gcr/gcr.h>
+#include <gcr/gcr-base.h>
#include <string.h>

View File

@ -1,22 +0,0 @@
From: Jeremy Bicha <jeremy.bicha@canonical.com>
Date: Fri, 17 Feb 2023 15:35:20 -0500
Subject: Revert "tests: Fail on warnings too"
This reverts commit 207b9bb3c0a582b830218fd1b6e8760684adbc48.
---
tests/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/meson.build b/tests/meson.build
index 85339dd..345eedc 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -54,7 +54,7 @@ libgvc_path = fs.parent(libgvc.get_variable('libgvc').full_path())
background_file = files(join_paths('data', 'background.png'))
perf_testenv = environment()
-perf_testenv.set('G_DEBUG', 'fatal-warnings')
+perf_testenv.set('G_DEBUG', 'fatal-criticals')
perf_testenv.set('G_MESSAGES_DEBUG', 'GNOME Shell')
perf_testenv.set('GNOME_SHELL_DATADIR', data_builddir)
perf_testenv.set('GNOME_SHELL_BUILDDIR', src_builddir)

View File

@ -1,32 +0,0 @@
From: Simon McVittie <smcv@debian.org>
Date: Sun, 12 Sep 2021 10:41:54 +0100
Subject: gnome-shell-extension-prefs: Give Debian-specific advice
We package gnome-extensions-app in the same binary package as
gnome-shell-extension-prefs, so there's never a need to download it from
Flathub.
Forwarded: not-needed, Debian-specific
Signed-off-by: Simon McVittie <smcv@debian.org>
---
src/gnome-shell-extension-prefs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/gnome-shell-extension-prefs b/src/gnome-shell-extension-prefs
index 303b196..a59ffed 100755
--- a/src/gnome-shell-extension-prefs
+++ b/src/gnome-shell-extension-prefs
@@ -13,10 +13,10 @@ openPrefs() {
}
cat >&2 <<EOT
-gnome-shell-extension-prefs is deprecated
+The gnome-shell-extension-prefs program is deprecated.
-Install https://flathub.org/apps/details/org.gnome.Extensions for extension
-management, or use the gnome-extensions command line tool.
+Run gnome-extensions-app (from the gnome-shell-extension-prefs package)
+for extension management, or use the gnome-extensions command line tool.
Extensions can use the ExtensionUtils.openPrefs() method.
EOT

View File

@ -1,248 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Tue, 1 Mar 2022 11:57:20 +0100
Subject: gmd/util: Only start fingerprint service synchronously when it's
default
On ShellUserVerifier construction we used to start fprintd in a sync
fashion all the times, however in case the daemon had startup failures
or was hanging for whatever reason (like due to devices probing, given
that fprintd synchronously wait for them all to be initialized) we used
to just fail, leaving gdm or the lockscreen inusable.
While this could be prevented with a try/catch statement, there's no
much point to wait for fprintd if that's not the default authentication
service, and so:
- If we use gdm-fingerprint as default auth method, use a sync call to
initialize it and in case of failures, just continue with fallback
authentication mechanism (password)
- Otherwise, asynchronously initialize fprintd and continue with the
ShellUserVerifier without fingerprint support until we got a reply.
In case the service fails to deliver us a result, we don't give up
but we will try doing that at each authentication via
_checkForFingerprintReader().
In case all works properly, as per the previous commit, once the
initialization is done, we'll start the fingerprint PAM gdm service.
Fixes #5168
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1962566
Bug-GNOME: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5168
Origin: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267
---
js/gdm/util.js | 128 +++++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 101 insertions(+), 27 deletions(-)
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 78c45cb..e4902f8 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -44,6 +44,7 @@ var DISABLE_USER_LIST_KEY = 'disable-user-list';
// Give user 48ms to read each character of a PAM message
var USER_READ_TIME = 48;
+const FINGERPRINT_SERVICE_PROXY_TIMEOUT = 5000;
const FINGERPRINT_ERROR_TIMEOUT_WAIT = 15;
var MessageType = {
@@ -148,16 +149,49 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
this._preemptingService = null;
this._settings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA });
- this._settings.connect('changed',
- this._updateDefaultService.bind(this));
- this._updateDefaultService();
+ this._settings.connect('changed', () => this._updateDefaultServiceWithFallback());
+
+ this._fingerprintReaderType = FingerprintReaderType.NONE;
+ if (this._settings.get_boolean(FINGERPRINT_AUTHENTICATION_KEY)) {
+ const fprintManager = new FprintManagerProxy(Gio.DBus.system,
+ 'net.reactivated.Fprint',
+ '/net/reactivated/Fprint/Manager',
+ null,
+ null,
+ Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES |
+ Gio.DBusProxyFlags.DO_NOT_AUTO_START_AT_CONSTRUCTION |
+ Gio.DBusProxyFlags.DO_NOT_CONNECT_SIGNALS);
+
+ // Do not wait too much for fprintd to reply, as in case it hangs
+ // we should fail early without having the shell to misbehave because
+ fprintManager.set_default_timeout(FINGERPRINT_SERVICE_PROXY_TIMEOUT);
- this._fprintManager = new FprintManagerProxy(Gio.DBus.system,
- 'net.reactivated.Fprint',
- '/net/reactivated/Fprint/Manager',
- null,
- null,
- Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES);
+ this._updateDefaultService();
+
+ if (!this._defaultService) {
+ // Fingerprint is the default one, we must wait for it!
+ try {
+ const [devicePath] = fprintManager.GetDefaultDeviceSync();
+ this._fprintManager = fprintManager;
+
+ const fprintDeviceProxy = new FprintDeviceProxy(Gio.DBus.system,
+ 'net.reactivated.Fprint', devicePath, null, null,
+ Gio.DBusProxyFlags.NOT_CONNECT_SIGNALS);
+ this._setFingerprintReaderType(fprintDeviceProxy['scan-type']);
+ } catch (e) {
+ logError(e, 'Failed to initialize fprintd service');
+ } finally {
+ this._updateDefaultServiceWithFallback();
+ }
+ } else {
+ // Ensure fingerprint service starts, but do not wait for it
+ this._updateFingerprintReaderType(fprintManager, null).then(
+ () => (this._fprintManager = fprintManager)).catch(
+ e => logError(e, 'Failed to initialize fprintd service'));
+ }
+ } else {
+ this._updateDefaultServiceWithFallback();
+ }
this._smartcardManager = SmartcardManager.getSmartcardManager();
// We check for smartcards right away, since an inserted smartcard
@@ -176,6 +210,7 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
this.reauthenticating = false;
this._failCounter = 0;
+ this._startedServices = new Set();
this._unavailableServices = new Set();
this._credentialManagers = {};
@@ -265,6 +300,7 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
this._clearUserVerifier();
this._clearMessageQueue();
+ this._startedServices.clear();
}
destroy() {
@@ -385,27 +421,52 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
}
async _checkForFingerprintReader() {
- this._fingerprintReaderType = FingerprintReaderType.NONE;
-
- if (!this._settings.get_boolean(FINGERPRINT_AUTHENTICATION_KEY) ||
- this._fprintManager == null) {
- this._updateDefaultService();
+ if (!this._fprintManager) {
+ this._updateDefaultServiceWithFallback();
return;
}
+ if (this._fingerprintReaderType !== FingerprintReaderType.NONE)
+ return;
+
+ await this._updateFingerprintReaderType(this._fprintManager, this._cancellable);
+ }
+
+ async _updateFingerprintReaderType(fprintManager, cancellable) {
try {
- const [device] = await this._fprintManager.GetDefaultDeviceAsync(
- Gio.DBusCallFlags.NONE, this._cancellable);
- const fprintDeviceProxy = new FprintDeviceProxy(Gio.DBus.system,
- 'net.reactivated.Fprint',
- device);
- const fprintDeviceType = fprintDeviceProxy['scan-type'];
+ // Wrappers don't support null cancellable, so let's cheat about it
+ const [devicePath] = await fprintManager.GetDefaultDeviceAsync(
+ cancellable ? cancellable : Gio.DBusCallFlags.NONE);
+ const fprintDeviceProxy = await new Promise((resolve, reject) => {
+ const proxy = new FprintDeviceProxy(Gio.DBus.system,
+ 'net.reactivated.Fprint', devicePath, (_, error) => {
+ if (error)
+ reject(error);
+ else
+ resolve(proxy);
+ }, cancellable, Gio.DBusProxyFlags.NOT_CONNECT_SIGNALS);
+ });
+ this._setFingerprintReaderType(fprintDeviceProxy['scan-type']);
+ this._updateDefaultServiceWithFallback();
+
+ if (this._userVerifier &&
+ !this._startedServices.has(FINGERPRINT_SERVICE_NAME)) {
+ if (!this._hold?.isAcquired())
+ this._hold = new Batch.Hold();
+ await this._maybeStartFingerprintVerification();
+ }
+ } catch (e) {
+ if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
+ logError(e);
+ }
+ }
- this._fingerprintReaderType = fprintDeviceType === 'swipe'
- ? FingerprintReaderType.SWIPE
- : FingerprintReaderType.PRESS;
- this._updateDefaultService();
- } catch (e) {}
+ _setFingerprintReaderType(fprintDeviceType) {
+ this._fingerprintReaderType =
+ FingerprintReaderType[fprintDeviceType.toUpperCase()];
+
+ if (this._fingerprintReaderType === undefined)
+ throw new Error(`Unexpected fingerprint device type '${fprintDeviceType}'`);
}
_onCredentialManagerAuthenticated(credentialManager, _token) {
@@ -506,6 +567,7 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
'problem', this._onProblem.bind(this),
'info-query', this._onInfoQuery.bind(this),
'secret-info-query', this._onSecretInfoQuery.bind(this),
+ 'conversation-started', this._onConversationStarted.bind(this),
'conversation-stopped', this._onConversationStopped.bind(this),
'service-unavailable', this._onServiceUnavailable.bind(this),
'reset', this._onReset.bind(this),
@@ -559,6 +621,10 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
this._defaultService = SMARTCARD_SERVICE_NAME;
else if (this._fingerprintReaderType !== FingerprintReaderType.NONE)
this._defaultService = FINGERPRINT_SERVICE_NAME;
+ }
+
+ _updateDefaultServiceWithFallback() {
+ this._updateDefaultService();
if (!this._defaultService) {
log("no authentication service is enabled, using password authentication");
@@ -597,11 +663,14 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
_beginVerification() {
this._startService(this._getForegroundService());
+ this._maybeStartFingerprintVerification();
+ }
+ async _maybeStartFingerprintVerification() {
if (this._userName &&
this._fingerprintReaderType !== FingerprintReaderType.NONE &&
!this.serviceIsForeground(FINGERPRINT_SERVICE_NAME))
- this._startService(FINGERPRINT_SERVICE_NAME);
+ await this._startService(FINGERPRINT_SERVICE_NAME);
}
_onChoiceListQuery(client, serviceName, promptMessage, list) {
@@ -694,8 +763,9 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
_onReset() {
// Clear previous attempts to authenticate
this._failCounter = 0;
+ this._startedServices.clear();
this._unavailableServices.clear();
- this._updateDefaultService();
+ this._updateDefaultServiceWithFallback();
this.emit('reset');
}
@@ -776,6 +846,10 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
this._queueMessage(serviceName, errorMessage, MessageType.ERROR);
}
+ _onConversationStarted(client, serviceName) {
+ this._startedServices.add(serviceName);
+ }
+
_onConversationStopped(client, serviceName) {
// If the login failed with the preauthenticated oVirt credentials
// then discard the credentials and revert to default authentication

View File

@ -1,237 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Tue, 24 Oct 2017 02:15:13 +0200
Subject: global: make possible to set debug-flags dynamically
Adding {set,get}_debug_flags functions to the shell global object to
make possible to set this easily from looking class, making it easier
for developers and users to debug without having to restart the shell
with environment variables.
Debug flags in main are updated when the "debug-flags" property is
changed. I'm keeping this as a string-list so that it's easier to update.
https://bugzilla.gnome.org/show_bug.cgi?id=789377
Bug-GNOME: https://bugzilla.gnome.org/show_bug.cgi?id=789377
Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/6
---
src/main.c | 57 ++++++++++++++++++++++++++++++++++++++++++------------
src/shell-global.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
src/shell-global.h | 4 ++++
3 files changed, 101 insertions(+), 12 deletions(-)
diff --git a/src/main.c b/src/main.c
index d4988e9..a9ea4e9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -353,14 +353,14 @@ shell_a11y_init (void)
}
static void
-shell_init_debug (const char *debug_env)
+shell_update_debug (const char *debug_string)
{
static const GDebugKey keys[] = {
{ "backtrace-warnings", SHELL_DEBUG_BACKTRACE_WARNINGS },
{ "backtrace-segfaults", SHELL_DEBUG_BACKTRACE_SEGFAULTS },
};
- _shell_debug = g_parse_debug_string (debug_env, keys,
+ _shell_debug = g_parse_debug_string (debug_string, keys,
G_N_ELEMENTS (keys));
}
@@ -462,6 +462,42 @@ dump_gjs_stack_on_signal (int signo)
_tracked_signals[signo] = TRUE;
}
+static void
+reset_signal_handler_to_default (int signo)
+{
+ signal (signo, SIG_DFL);
+ _tracked_signals[signo] = FALSE;
+}
+
+static void
+setup_debug_signal_listners (void)
+{
+ dump_gjs_stack_on_signal (SIGABRT);
+ dump_gjs_stack_on_signal (SIGFPE);
+ dump_gjs_stack_on_signal (SIGIOT);
+ dump_gjs_stack_on_signal (SIGTRAP);
+
+ if ((_shell_debug & SHELL_DEBUG_BACKTRACE_SEGFAULTS))
+ {
+ dump_gjs_stack_on_signal (SIGBUS);
+ dump_gjs_stack_on_signal (SIGSEGV);
+ }
+ else
+ {
+ reset_signal_handler_to_default (SIGBUS);
+ reset_signal_handler_to_default (SIGSEGV);
+ }
+}
+
+static void
+global_notify_debug_flags (GObject *gobject,
+ GParamSpec *pspec,
+ gpointer data)
+{
+ shell_update_debug (shell_global_get_debug_flags (shell_global_get ()));
+ setup_debug_signal_listners ();
+}
+
static gboolean
list_modes (const char *option_name,
const char *value,
@@ -585,6 +621,7 @@ main (int argc, char **argv)
{
g_autoptr (MetaContext) context = NULL;
GError *error = NULL;
+ const char *debug_flags;
int ecode = EXIT_SUCCESS;
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
@@ -622,7 +659,8 @@ main (int argc, char **argv)
g_setenv ("GJS_DEBUG_OUTPUT", "stderr", TRUE);
g_setenv ("GJS_DEBUG_TOPICS", "JS ERROR;JS LOG", TRUE);
- shell_init_debug (g_getenv ("SHELL_DEBUG"));
+ debug_flags = g_getenv ("SHELL_DEBUG");
+ shell_update_debug (debug_flags);
shell_dbus_init (meta_context_is_replacing (context));
shell_a11y_init ();
@@ -638,18 +676,13 @@ main (int argc, char **argv)
_shell_global_init ("session-mode", session_mode,
"force-animations", force_animations,
+ "debug-flags", debug_flags,
NULL);
- dump_gjs_stack_on_signal (SIGABRT);
- dump_gjs_stack_on_signal (SIGFPE);
- dump_gjs_stack_on_signal (SIGIOT);
- dump_gjs_stack_on_signal (SIGTRAP);
+ g_signal_connect (shell_global_get (), "notify::debug-flags",
+ G_CALLBACK (global_notify_debug_flags), NULL);
- if ((_shell_debug & SHELL_DEBUG_BACKTRACE_SEGFAULTS))
- {
- dump_gjs_stack_on_signal (SIGBUS);
- dump_gjs_stack_on_signal (SIGSEGV);
- }
+ setup_debug_signal_listners ();
shell_profiler_init ();
diff --git a/src/shell-global.c b/src/shell-global.c
index aae9469..e4565b3 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -61,6 +61,7 @@ struct _ShellGlobal {
Display *xdisplay;
char *session_mode;
+ char *debug_flags;
XserverRegion input_region;
@@ -120,6 +121,7 @@ enum {
PROP_FRAME_FINISH_TIMESTAMP,
PROP_SWITCHEROO_CONTROL,
PROP_FORCE_ANIMATIONS,
+ PROP_DEBUG_FLAGS,
N_PROPS
};
@@ -249,6 +251,9 @@ shell_global_set_property(GObject *object,
case PROP_FORCE_ANIMATIONS:
global->force_animations = g_value_get_boolean (value);
break;
+ case PROP_DEBUG_FLAGS:
+ shell_global_set_debug_flags (global, g_value_get_string (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -338,6 +343,9 @@ shell_global_get_property(GObject *object,
case PROP_FORCE_ANIMATIONS:
g_value_set_boolean (value, global->force_animations);
break;
+ case PROP_DEBUG_FLAGS:
+ g_value_set_string (value, global->debug_flags);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -688,6 +696,13 @@ shell_global_class_init (ShellGlobalClass *klass)
FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT| G_PARAM_STATIC_STRINGS);
+ props[PROP_DEBUG_FLAGS] =
+ g_param_spec_string ("debug-flags",
+ "Debug Flags",
+ "The debugging flags",
+ NULL,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+
g_object_class_install_properties (gobject_class, N_PROPS, props);
}
@@ -1988,3 +2003,40 @@ shell_global_get_app_usage (ShellGlobal *global)
global->app_usage = g_object_new (SHELL_TYPE_APP_USAGE, NULL);
return global->app_usage;
}
+
+/**
+ * shell_global_get_debug_flags:
+ * @global: a #ShellGlobal
+ *
+ * Returns: (transfer none): The current debug flags
+ */
+const gchar *
+shell_global_get_debug_flags (ShellGlobal *global)
+{
+ g_return_val_if_fail (SHELL_IS_GLOBAL (global), NULL);
+
+ return global->debug_flags;
+}
+
+/**
+ * shell_global_set_debug_flags:
+ * @global: a #ShellGlobal
+ * @debug_flags: (nullable): A string for debugging flags
+ *
+ * Updates the debugging flags at runtime as the one set using the SHELL_DEBUG
+ * environment variables. Currently we support 'backtrace-warnings' and
+ * 'backtrace-segfaults' keys.
+ */
+void
+shell_global_set_debug_flags (ShellGlobal *global,
+ const char *debug_flags)
+{
+ g_return_if_fail (SHELL_IS_GLOBAL (global));
+
+ if (g_strcmp0 (global->debug_flags, debug_flags) != 0)
+ {
+ g_free (global->debug_flags);
+ global->debug_flags = g_strdup (debug_flags);
+ g_object_notify (G_OBJECT (global), "debug-flags");
+ }
+}
diff --git a/src/shell-global.h b/src/shell-global.h
index 8399330..683f75a 100644
--- a/src/shell-global.h
+++ b/src/shell-global.h
@@ -99,6 +99,10 @@ ShellAppSystem * shell_global_get_app_system (ShellGlobal *global);
ShellAppUsage * shell_global_get_app_usage (ShellGlobal *global);
+const char * shell_global_get_debug_flags (ShellGlobal *global);
+void shell_global_set_debug_flags (ShellGlobal *global,
+ const char *debug_flags);
+
G_END_DECLS
#endif /* __SHELL_GLOBAL_H__ */

View File

@ -1,172 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Wed, 27 Mar 2019 16:14:39 +0100
Subject: magnifier: Scale the sprite to match the current monitor scaling
Compute the sprite texture scale (unfortunately using a workaround, based on
mutter cursor size preferences, tying to figure out the closest texture integer
scaling), and use this value to compute the scaling that should be applied to
the sprite in order to match the current monitor scaling.
Origin: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/475
Applied-Upstream: no
Forwarded: yes
---
js/ui/layout.js | 24 ++++++++++++++++++++----
js/ui/magnifier.js | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 73 insertions(+), 6 deletions(-)
diff --git a/js/ui/layout.js b/js/ui/layout.js
index d7f73dc..e53ff9d 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -974,22 +974,38 @@ var LayoutManager = GObject.registerClass({
return ws.get_work_area_for_monitor(monitorIndex);
}
+ _findIndexForRect(x, y, width, height) {
+ let rect = new Meta.Rectangle({
+ x: Math.floor(x),
+ y: Math.floor(y),
+ width: Math.ceil(x + width) - Math.floor(x),
+ height: Math.ceil(y + height) - Math.floor(y)
+ });
+ return global.display.get_monitor_index_for_rect(rect);
+ }
+
// This call guarantees that we return some monitor to simplify usage of it
// In practice all tracked actors should be visible on some monitor anyway
findIndexForActor(actor) {
let [x, y] = actor.get_transformed_position();
let [w, h] = actor.get_transformed_size();
- let rect = new Meta.Rectangle({ x, y, width: w, height: h });
- return global.display.get_monitor_index_for_rect(rect);
+ return this._findIndexForRect(x, y, w, h);
}
- findMonitorForActor(actor) {
- let index = this.findIndexForActor(actor);
+ _findMonitorForIndex(index) {
if (index >= 0 && index < this.monitors.length)
return this.monitors[index];
return null;
}
+ findMonitorForActor(actor) {
+ return this._findMonitorForIndex(this.findIndexForActor(actor));
+ }
+
+ findMonitorForPoint(x, y) {
+ return this._findMonitorForIndex(this._findIndexForRect(x, y, 1, 1));
+ }
+
_queueUpdateRegions() {
if (!this._updateRegionIdle) {
const laters = global.compositor.get_laters();
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index f4012de..f8d235f 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -46,6 +46,8 @@ var MouseSpriteContent = GObject.registerClass({
}, class MouseSpriteContent extends GObject.Object {
_init() {
super._init();
+ this._scale = 1.0;
+ this._monitorScale = 1.0;
this._texture = null;
}
@@ -53,7 +55,10 @@ var MouseSpriteContent = GObject.registerClass({
if (!this._texture)
return [false, 0, 0];
- return [true, this._texture.get_width(), this._texture.get_height()];
+ let width = this._texture.get_width() / this._scale;
+ let height = this._texture.get_height() / this._scale;
+
+ return [true, width, height];
}
vfunc_paint_content(actor, node, _paintContext) {
@@ -70,6 +75,29 @@ var MouseSpriteContent = GObject.registerClass({
textureNode.add_rectangle(actor.get_content_box());
}
+ _textureScale() {
+ if (!this._texture)
+ return 1;
+
+ /* This is a workaround to guess the sprite scale; while it works file
+ * in normal scenarios, it's not guaranteed to work in all the cases,
+ * and so we should actually add an API to mutter that will allow us
+ * to know the real spirte texture scaling in order to adapt it to the
+ * wanted one. */
+ let avgSize = (this._texture.get_width() + this._texture.get_height()) / 2;
+ return Math.max (1, Math.floor (avgSize / Meta.prefs_get_cursor_size() + .1));
+ }
+
+ _recomputeScale() {
+ let scale = this._textureScale() / this._monitorScale;
+
+ if (this._scale != scale) {
+ this._scale = scale;
+ return true;
+ }
+ return false;
+ }
+
get texture() {
return this._texture;
}
@@ -84,7 +112,19 @@ var MouseSpriteContent = GObject.registerClass({
if (!oldTexture || !coglTexture ||
oldTexture.get_width() != coglTexture.get_width() ||
- oldTexture.get_height() != coglTexture.get_height())
+ oldTexture.get_height() != coglTexture.get_height()) {
+ this._recomputeScale();
+ this.invalidate_size();
+ }
+ }
+
+ get scale() {
+ return this._scale;
+ }
+
+ set monitorScale(monitorScale) {
+ this._monitorScale = monitorScale;
+ if (this._recomputeScale())
this.invalidate_size();
}
});
@@ -113,6 +153,8 @@ var Magnifier = class Magnifier extends Signals.EventEmitter {
this._settingsInit(aZoomRegion);
aZoomRegion.scrollContentsTo(this.xMouse, this.yMouse);
+ this._updateContentScale();
+
St.Settings.get().connect('notify::magnifier-active', () => {
this.setActive(St.Settings.get().magnifier_active);
});
@@ -120,6 +162,13 @@ var Magnifier = class Magnifier extends Signals.EventEmitter {
this.setActive(St.Settings.get().magnifier_active);
}
+ _updateContentScale() {
+ let monitor = Main.layoutManager.findMonitorForPoint(this.xMouse,
+ this.yMouse);
+ this._mouseSprite.content.monitorScale = monitor ?
+ monitor.geometry_scale : 1;
+ }
+
/**
* showSystemCursor:
* Show the system mouse pointer.
@@ -256,6 +305,8 @@ var Magnifier = class Magnifier extends Signals.EventEmitter {
this.xMouse = xMouse;
this.yMouse = yMouse;
+ this._updateContentScale();
+
let sysMouseOverAny = false;
this._zoomRegions.forEach(zoomRegion => {
if (zoomRegion.scrollToMousePos())

View File

@ -1,47 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Thu, 2 Aug 2018 16:17:39 +0200
Subject: main: add `backtrace-crashes-all` and `backtrace-all`
These are just convenient aliases to not to have to list all the types,
as having more granularity is cool, but it might also cause some annoyance.
https://bugzilla.gnome.org/show_bug.cgi?id=789377
Bug-GNOME: https://bugzilla.gnome.org/show_bug.cgi?id=789377
Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/6
---
src/main.c | 7 +++++++
src/shell-global.c | 2 ++
2 files changed, 9 insertions(+)
diff --git a/src/main.c b/src/main.c
index 0d56b23..88d0513 100644
--- a/src/main.c
+++ b/src/main.c
@@ -55,6 +55,13 @@ static const GDebugKey SHELL_DEBUG_KEYS[] = {
{ "backtrace-segfaults", SHELL_DEBUG_BACKTRACE_SEGFAULTS },
{ "backtrace-aborts", SHELL_DEBUG_BACKTRACE_ABORTS },
{ "backtrace-math-errors", SHELL_DEBUG_BACKTRACE_FPE },
+ { "backtrace-crashes-all", SHELL_DEBUG_BACKTRACE_SEGFAULTS |
+ SHELL_DEBUG_BACKTRACE_ABORTS |
+ SHELL_DEBUG_BACKTRACE_FPE },
+ { "backtrace-all", SHELL_DEBUG_BACKTRACE_WARNINGS |
+ SHELL_DEBUG_BACKTRACE_SEGFAULTS |
+ SHELL_DEBUG_BACKTRACE_ABORTS |
+ SHELL_DEBUG_BACKTRACE_FPE },
};
static int _default_debug_flags = SHELL_DEBUG_BACKTRACE_ABORTS |
SHELL_DEBUG_BACKTRACE_FPE;
diff --git a/src/shell-global.c b/src/shell-global.c
index b6e9ef9..f34dc3b 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -2029,6 +2029,8 @@ shell_global_get_debug_flags (ShellGlobal *global)
* - 'backtrace-segfaults'
* - 'backtrace-aborts'
* - 'backtrace-math-errors'
+ * - 'backtrace-crashes-all'
+ * - 'backtrace-all'
* - 'all'
*/
void

View File

@ -1,169 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Tue, 24 Oct 2017 03:20:34 +0200
Subject: main: increase the granularity of backtraces in SHELL_DEBUG
Add support for multiple debug-keys for getting the backtraces,
allowing more control using both SHELL_DEBUG and/or set_debug_flags
https://bugzilla.gnome.org/show_bug.cgi?id=789377
Bug-GNOME: https://bugzilla.gnome.org/show_bug.cgi?id=789377
Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/6
---
src/main.c | 76 +++++++++++++++++++++++++++++++++++++++++-------------
src/shell-global.c | 10 ++++---
2 files changed, 65 insertions(+), 21 deletions(-)
diff --git a/src/main.c b/src/main.c
index a9ea4e9..0d56b23 100644
--- a/src/main.c
+++ b/src/main.c
@@ -39,16 +39,26 @@ static gboolean is_gdm_mode = FALSE;
static char *session_mode = NULL;
static int caught_signal = 0;
static gboolean force_animations = FALSE;
+static gboolean _tracked_signals[NSIG] = { 0 };
#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1
#define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4
enum {
- SHELL_DEBUG_BACKTRACE_WARNINGS = 1,
- SHELL_DEBUG_BACKTRACE_SEGFAULTS = 2,
+ SHELL_DEBUG_BACKTRACE_WARNINGS = (1 << 0),
+ SHELL_DEBUG_BACKTRACE_SEGFAULTS = (1 << 1),
+ SHELL_DEBUG_BACKTRACE_ABORTS = (1 << 2),
+ SHELL_DEBUG_BACKTRACE_FPE = (1 << 3),
};
-static int _shell_debug;
-static gboolean _tracked_signals[NSIG] = { 0 };
+static const GDebugKey SHELL_DEBUG_KEYS[] = {
+ { "backtrace-warnings", SHELL_DEBUG_BACKTRACE_WARNINGS },
+ { "backtrace-segfaults", SHELL_DEBUG_BACKTRACE_SEGFAULTS },
+ { "backtrace-aborts", SHELL_DEBUG_BACKTRACE_ABORTS },
+ { "backtrace-math-errors", SHELL_DEBUG_BACKTRACE_FPE },
+};
+static int _default_debug_flags = SHELL_DEBUG_BACKTRACE_ABORTS |
+ SHELL_DEBUG_BACKTRACE_FPE;
+static int _shell_debug = 0;
static void
shell_dbus_acquire_name (GDBusProxy *bus,
@@ -355,13 +365,23 @@ shell_a11y_init (void)
static void
shell_update_debug (const char *debug_string)
{
- static const GDebugKey keys[] = {
- { "backtrace-warnings", SHELL_DEBUG_BACKTRACE_WARNINGS },
- { "backtrace-segfaults", SHELL_DEBUG_BACKTRACE_SEGFAULTS },
- };
+ _shell_debug = g_parse_debug_string (debug_string, SHELL_DEBUG_KEYS,
+ G_N_ELEMENTS (SHELL_DEBUG_KEYS));
+}
+
+static char *
+debug_flags_to_string (void)
+{
+ gsize i, j;
+ const char *enabled_flags[G_N_ELEMENTS (SHELL_DEBUG_KEYS) + 1] = { 0 };
+
+ for (i = 0, j = 0; i < G_N_ELEMENTS (SHELL_DEBUG_KEYS); ++i)
+ {
+ if ((_shell_debug & SHELL_DEBUG_KEYS[i].value))
+ enabled_flags[j++] = SHELL_DEBUG_KEYS[i].key;
+ }
- _shell_debug = g_parse_debug_string (debug_string, keys,
- G_N_ELEMENTS (keys));
+ return g_strjoinv (":", (char**) enabled_flags);
}
static GLogWriterOutput
@@ -472,10 +492,23 @@ reset_signal_handler_to_default (int signo)
static void
setup_debug_signal_listners (void)
{
- dump_gjs_stack_on_signal (SIGABRT);
- dump_gjs_stack_on_signal (SIGFPE);
- dump_gjs_stack_on_signal (SIGIOT);
- dump_gjs_stack_on_signal (SIGTRAP);
+ if ((_shell_debug & SHELL_DEBUG_BACKTRACE_ABORTS))
+ {
+ dump_gjs_stack_on_signal (SIGABRT);
+ dump_gjs_stack_on_signal (SIGIOT);
+ dump_gjs_stack_on_signal (SIGTRAP);
+ }
+ else
+ {
+ reset_signal_handler_to_default (SIGABRT);
+ reset_signal_handler_to_default (SIGIOT);
+ reset_signal_handler_to_default (SIGTRAP);
+ }
+
+ if ((_shell_debug & SHELL_DEBUG_BACKTRACE_FPE))
+ dump_gjs_stack_on_signal (SIGFPE);
+ else
+ reset_signal_handler_to_default (SIGFPE);
if ((_shell_debug & SHELL_DEBUG_BACKTRACE_SEGFAULTS))
{
@@ -620,8 +653,9 @@ int
main (int argc, char **argv)
{
g_autoptr (MetaContext) context = NULL;
+ g_autofree char *debug_flags_string = NULL;
GError *error = NULL;
- const char *debug_flags;
+ const char *shell_debug;
int ecode = EXIT_SUCCESS;
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
@@ -659,8 +693,14 @@ main (int argc, char **argv)
g_setenv ("GJS_DEBUG_OUTPUT", "stderr", TRUE);
g_setenv ("GJS_DEBUG_TOPICS", "JS ERROR;JS LOG", TRUE);
- debug_flags = g_getenv ("SHELL_DEBUG");
- shell_update_debug (debug_flags);
+ shell_debug = g_getenv ("SHELL_DEBUG");
+
+ if (shell_debug)
+ shell_update_debug (shell_debug);
+ else
+ _shell_debug = _default_debug_flags;
+
+ debug_flags_string = debug_flags_to_string ();
shell_dbus_init (meta_context_is_replacing (context));
shell_a11y_init ();
@@ -676,7 +716,7 @@ main (int argc, char **argv)
_shell_global_init ("session-mode", session_mode,
"force-animations", force_animations,
- "debug-flags", debug_flags,
+ "debug-flags", debug_flags_string,
NULL);
g_signal_connect (shell_global_get (), "notify::debug-flags",
diff --git a/src/shell-global.c b/src/shell-global.c
index e4565b3..b6e9ef9 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -2021,11 +2021,15 @@ shell_global_get_debug_flags (ShellGlobal *global)
/**
* shell_global_set_debug_flags:
* @global: a #ShellGlobal
- * @debug_flags: (nullable): A string for debugging flags
+ * @debug_flags: (nullable): A comma-separated string of debugging flags
*
* Updates the debugging flags at runtime as the one set using the SHELL_DEBUG
- * environment variables. Currently we support 'backtrace-warnings' and
- * 'backtrace-segfaults' keys.
+ * environment variables. Currently we support these keys:
+ * - 'backtrace-warnings'
+ * - 'backtrace-segfaults'
+ * - 'backtrace-aborts'
+ * - 'backtrace-math-errors'
+ * - 'all'
*/
void
shell_global_set_debug_flags (ShellGlobal *global,

View File

@ -1,30 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Thu, 2 Aug 2018 15:59:20 +0200
Subject: main: show an error message on gnome-shell crash
When we call the crash signal handler, write on log the reason of the
crash, also to make easier to parse the logs later on, and being able
to understand if a stacktrace is coming from a crash or a different
gjs error.
https://bugzilla.gnome.org/show_bug.cgi?id=789377
Bug-GNOME: https://bugzilla.gnome.org/show_bug.cgi?id=789377
Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/6
---
src/main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/main.c b/src/main.c
index e81f92c..d4988e9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -423,6 +423,8 @@ dump_gjs_stack_on_signal_handler (int signo)
struct sigaction sa = { .sa_handler = dump_gjs_stack_alarm_sigaction };
gsize i;
+ g_printerr ("GNOME Shell crashed with signal %d\n", signo);
+
/* Ignore all the signals starting this point, a part the one we'll raise
* (which is implicitly ignored here through SA_RESETHAND), this is needed
* not to get this handler being called by other signals that we were

27
debian/patches/series vendored
View File

@ -1,27 +0,0 @@
debian/gnome-shell-extension-prefs-Give-Debian-specific-advice.patch
debian/Revert-build-Port-to-gcr4.patch
debian/Revert-tests-Fail-on-warnings-too.patch
gdm-util-Only-start-fingerprint-service-synchronously-whe.patch
ubuntu/desktop_detect.patch
ubuntu/lightdm-user-switching.patch
ubuntu/lock_on_suspend.patch
ubuntu/background_login.patch
ubuntu/gdm_alternatives.patch
main-show-an-error-message-on-gnome-shell-crash.patch
global-make-possible-to-set-debug-flags-dynamically.patch
main-increase-the-granularity-of-backtraces-in-SHELL_DEBU.patch
main-add-backtrace-crashes-all-and-backtrace-all.patch
sessionMode-add-support-for-debugFlags-parameter.patch
magnifier-Show-cursor-when-magnifier-is-enabled-and-scale.patch
ubuntu/search-call-XUbuntuCancel-method-on-providers-when-no-dat.patch
ubuntu/resolve_alternate_theme_path.patch
ubuntu/secure_mode_extension.patch
ubuntu/keep-ubuntu-logo-bright-lp1867133-v1.patch
ubuntu/configure_login_screen.patch
ubuntu/layout-Try-to-allocate-before-getting-size-of-tracke.patch
Revert-st-Apply-css-foreground-color-to-text-as-a-PangoAt.patch
ubuntu/sessionMode-Add-support-for-configuring-an-icons-resource.patch
ubuntu/Revert-dash-Use-pin-instead-of-favorites.patch
ubuntu/main-Support-loading-multiple-Yaru-theme-variants.patch
ubuntu/darkMode-Add-support-to-Yaru-theme-color-variants.patch
ubuntu/shell-global-util-Do-not-move-snap-apps-to-gnome-apps-sco.patch

View File

@ -1,46 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Thu, 2 Aug 2018 16:05:13 +0200
Subject: sessionMode: add support for `debugFlags` parameter
A session can now define `debugFlags` from a json file, still leaving priority
to the environment variable.
https://bugzilla.gnome.org/show_bug.cgi?id=789377
Bug-GNOME: https://bugzilla.gnome.org/show_bug.cgi?id=789377
Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/6
---
js/ui/main.js | 7 +++++++
js/ui/sessionMode.js | 1 +
2 files changed, 8 insertions(+)
diff --git a/js/ui/main.js b/js/ui/main.js
index 6ecb1a0..5c3cb8e 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -139,6 +139,13 @@ function _sessionUpdated() {
_remoteAccessInhibited = true;
}
}
+
+ if (!GLib.getenv('SHELL_DEBUG')) {
+ if (typeof sessionMode.debugFlags === 'string')
+ global.set_debug_flags(sessionMode.debugFlags);
+ else if (Array.isArray(sessionMode.debugFlags))
+ global.set_debug_flags(sessionMode.debugFlags.join(':'))
+ }
}
/**
diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js
index 7831646..5478b2a 100644
--- a/js/ui/sessionMode.js
+++ b/js/ui/sessionMode.js
@@ -29,6 +29,7 @@ const _modes = {
showWelcomeDialog: false,
allowSettings: false,
allowScreencast: false,
+ debugFlags: [],
enabledExtensions: [],
hasRunDialog: false,
hasWorkspaces: false,

View File

@ -1,90 +0,0 @@
From: Gunnar Hjalmarsson <gunnarhj@ubuntu.com>
Date: Mon, 11 Apr 2022 21:10:37 +0200
Subject: Revert "dash: Use pin instead of favorites"
This effectively reverts this commit when using the ubuntu session:
https://gitlab.gnome.org/GNOME/gnome-shell/-/commit/a67877f5
We do that as a temporary measure in Ubuntu 22.04 in order to address
a translation issue. The issue was reported by Mitsuya Shibata:
* https://github.com/micheleg/dash-to-dock/issues/1697
* https://lists.ubuntu.com/archives/ubuntu-translators/2022-April/007829.html
In short: By using the old labels for those menu items, we can make use
of existing gnome-shell translations in Launchpad both for gnome-shell
and ubuntu-dock. Thanks Jeremy Bicha for the idea!
So even if it technically introduces new translatable strings very late,
it does not break the UIF spirit.
Forwarded: not-needed
---
js/ui/appFavorites.js | 12 ++++++++++--
js/ui/appMenu.js | 5 +++--
js/ui/dash.js | 3 +--
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/js/ui/appFavorites.js b/js/ui/appFavorites.js
index ca65695..93b8e24 100644
--- a/js/ui/appFavorites.js
+++ b/js/ui/appFavorites.js
@@ -164,7 +164,11 @@ class AppFavorites extends Signals.EventEmitter {
let app = Shell.AppSystem.get_default().lookup_app(appId);
- let msg = _('%s has been pinned to the dash.').format(app.get_name());
+ let msg;
+ if (imports.misc.desktop.is('ubuntu'))
+ msg = _('%s has been added to your favorites.').format(app.get_name());
+ else
+ msg = _('%s has been pinned to the dash.').format(app.get_name());
Main.overview.setMessage(msg, {
forFeedback: true,
undoCallback: () => this._removeFavorite(appId),
@@ -197,7 +201,11 @@ class AppFavorites extends Signals.EventEmitter {
if (!this._removeFavorite(appId))
return;
- let msg = _('%s has been unpinned from the dash.').format(app.get_name());
+ let msg;
+ if (imports.misc.desktop.is('ubuntu'))
+ msg = _('%s has been removed from your favorites.').format(app.get_name());
+ else
+ msg = _('%s has been unpinned from the dash.').format(app.get_name());
Main.overview.setMessage(msg, {
forFeedback: true,
undoCallback: () => this._addFavorite(appId, pos),
diff --git a/js/ui/appMenu.js b/js/ui/appMenu.js
index fec74cf..37f8012 100644
--- a/js/ui/appMenu.js
+++ b/js/ui/appMenu.js
@@ -153,9 +153,10 @@ var AppMenu = class AppMenu extends PopupMenu.PopupMenu {
return;
const { id } = this._app;
+ const isUbuntu = imports.misc.desktop.is('ubuntu');
this._toggleFavoriteItem.label.text = this._appFavorites.isFavorite(id)
- ? _('Unpin')
- : _('Pin to Dash');
+ ? (isUbuntu ? _('Remove from Favorites') : _('Unpin'))
+ : (isUbuntu ? _('Add to Favorites') : _('Pin to Dash'));
}
_updateGpuItem() {
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 1883088..e7cbe67 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -245,9 +245,8 @@ class ShowAppsIcon extends DashItemContainer {
this.toggleButton.set_hover(canRemove);
if (this._iconActor)
this._iconActor.set_hover(canRemove);
-
if (canRemove)
- this.setLabelText(_('Unpin'));
+ this.setLabelText(imports.misc.desktop.is('ubuntu') ? _('Remove from Favorites') : _('Unpin'));
else
this.setLabelText(_('Show Apps'));
}

View File

@ -1,199 +0,0 @@
From: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Date: Thu, 11 Mar 2021 10:12:06 +0200
Subject: Allow configuring login screen background
Configuring login screen backgound and properties is a recurring request
especially on corporate environment.
Allows to override the default embedded style in the theme with specific
gsettings keys.
Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/680
Bug: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1918613
Origin: ubuntu
---
data/com.ubuntu.login-screen.gschema.xml.in | 70 +++++++++++++++++++++++++++++
data/meson.build | 8 +++-
js/ui/background.js | 4 ++
js/ui/screenShield.js | 37 +++++++++++++++
4 files changed, 118 insertions(+), 1 deletion(-)
create mode 100644 data/com.ubuntu.login-screen.gschema.xml.in
diff --git a/data/com.ubuntu.login-screen.gschema.xml.in b/data/com.ubuntu.login-screen.gschema.xml.in
new file mode 100644
index 0000000..ee8b3a2
--- /dev/null
+++ b/data/com.ubuntu.login-screen.gschema.xml.in
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schemalist gettext-domain="@GETTEXT_PACKAGE@">
+ <enum id="com.ubuntu.login-screen.BackgroundRepeat">
+ <value value="1" nick="default"/>
+ <value value="2" nick="repeat"/>
+ <value value="3" nick="repeat-x"/>
+ <value value="4" nick="repeat-y"/>
+ <value value="5" nick="no-repeat"/>
+ <value value="6" nick="space"/>
+ <value value="7" nick="round"/>
+ </enum>
+ <enum id="com.ubuntu.login-screen.BackgroundSize">
+ <value value="1" nick="default"/>
+ <value value="2" nick="auto"/>
+ <value value="3" nick="cover"/>
+ <value value="4" nick="contain"/>
+ </enum>
+ <schema id="com.ubuntu.login-screen" path="/com/ubuntu/login-screen/">
+ <key name="background-picture-uri" type="s">
+ <default>''</default>
+ <summary>
+ Sets the background image for the login screen.
+ </summary>
+ <description>
+ URI to use for the background image. Note that the backend only
+ supports local (file://) URIs.
+ It overrides the value defined in the default style sheet.
+ </description>
+ </key>
+ <key name="background-color" type="s">
+ <default>''</default>
+ <summary>
+ The background-color property sets the background color.
+ </summary>
+ <description>
+ The background-color property sets the background color to use when
+ the background picture URI is missing or when it doesn't cover the whole background.
+ It overrides the value defined in the default style sheet.
+ </description>
+ </key>
+ <key name="background-repeat" enum="com.ubuntu.login-screen.BackgroundRepeat">
+ <default>'default'</default>
+ <summary>
+ The background-repeat property sets if/how the background image will be repeated.
+ </summary>
+ <description>
+ The background-repeat property sets if/how a background image will be repeated.
+ By default, a background-image is repeated both vertically and horizontally.
+
+ It overrides the value defined in the default style sheet.
+ </description>
+ </key>
+ <key name="background-size" enum="com.ubuntu.login-screen.BackgroundSize">
+ <default>'default'</default>
+ <summary>
+ The background-size property specifies the size of the background image.
+ </summary>
+ <description>
+ The background-size property specifies the size of the background images.
+
+ There are three keywords you can use with this property:
+ auto: The background image is displayed in its original size;
+ cover: Resize the background image to cover the entire container, even if it has to stretch the image or cut a little bit off one of the edges;
+ contain: Resize the background image to make sure the image is fully visible.
+
+ It overrides the value defined in the default style sheet.
+ </description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/data/meson.build b/data/meson.build
index a31efcc..07d6d4a 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -97,6 +97,12 @@ schema = configure_file(
configuration: schemaconf,
install_dir: schemadir
)
+schema_ubuntu_login = configure_file(
+ input: 'com.ubuntu.login-screen.gschema.xml.in',
+ output: 'com.ubuntu.login-screen.gschema.xml',
+ configuration: schemaconf,
+ install_dir: schemadir
+)
install_data('00_org.gnome.shell.gschema.override', install_dir: schemadir)
if have_systemd
@@ -125,7 +131,7 @@ endif
# for unit tests - gnome.compile_schemas() only looks in srcdir
custom_target('compile-schemas',
- input: schema,
+ input: [schema, schema_ubuntu_login],
output: 'gschemas.compiled',
command: [find_program('glib-compile-schemas'), data_builddir],
build_by_default: true)
diff --git a/js/ui/background.js b/js/ui/background.js
index 4717f46..a5be402 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -531,7 +531,11 @@ var SystemBackground = GObject.registerClass({
let backgroundColor = DEFAULT_BACKGROUND_COLOR;
if (imports.misc.desktop.is("ubuntu")) {
+ const loginSettings = new Gio.Settings({ schema_id: 'com.ubuntu.login-screen' });
+ const bgColor = loginSettings.get_string('background-color');
const dummyBgActor = new imports.gi.St.Widget({ name: 'lockDialogGroup' });
+ if (bgColor)
+ dummyBgActor.set_style(`background-color: ${bgColor};`);
Main.uiGroup.add_actor(dummyBgActor);
backgroundColor = dummyBgActor.get_theme_node().get_background_color();
dummyBgActor.destroy();
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 038c1df..df542d0 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -29,6 +29,12 @@ const DISABLE_LOCK_KEY = 'disable-lock-screen';
const LOCKED_STATE_STR = 'screenShield.locked';
+const LOGIN_SCREEN_SCHEMA = 'com.ubuntu.login-screen';
+const LOGIN_SCREEN_BACKGROUND_COLOR_KEY = 'background-color';
+const LOGIN_SCREEN_BACKGROUND_PICTURE_URI_KEY = 'background-picture-uri';
+const LOGIN_SCREEN_BACKGROUND_REPEAT_KEY = 'background-repeat';
+const LOGIN_SCREEN_BACKGROUND_SIZE_KEY = 'background-size';
+
// ScreenShield animation time
// - STANDARD_FADE_TIME is used when the session goes idle
// - MANUAL_FADE_TIME is used for lowering the shield when asked by the user,
@@ -112,6 +118,16 @@ var ScreenShield = class extends Signals.EventEmitter {
this._lockSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
this._lockSettings.connect(`changed::${DISABLE_LOCK_KEY}`, this._syncInhibitor.bind(this));
+ this._loginScreenSettings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA });
+ [
+ LOGIN_SCREEN_BACKGROUND_COLOR_KEY,
+ LOGIN_SCREEN_BACKGROUND_PICTURE_URI_KEY,
+ LOGIN_SCREEN_BACKGROUND_REPEAT_KEY,
+ LOGIN_SCREEN_BACKGROUND_SIZE_KEY,
+ ].forEach(schema => this._loginScreenSettings.connect(`changed::${schema}`,
+ () => this._refreshBackground()));
+ this._refreshBackground();
+
this._isModal = false;
this._isGreeter = false;
this._isActive = false;
@@ -212,6 +228,27 @@ var ScreenShield = class extends Signals.EventEmitter {
return this._isModal;
}
+ _refreshBackground() {
+ const inlineStyle = [];
+
+ const getSetting = s => this._loginScreenSettings.get_string(s);
+ const backgroundColor = getSetting(LOGIN_SCREEN_BACKGROUND_COLOR_KEY);
+ const backgroundPictureUri = getSetting(LOGIN_SCREEN_BACKGROUND_PICTURE_URI_KEY);
+ const backgroundRepeat = getSetting(LOGIN_SCREEN_BACKGROUND_REPEAT_KEY);
+ const backgroundSize = getSetting(LOGIN_SCREEN_BACKGROUND_SIZE_KEY);
+
+ if (backgroundColor)
+ inlineStyle.push(`background-color: ${backgroundColor}`);
+ if (backgroundPictureUri)
+ inlineStyle.push(`background-image: url("${backgroundPictureUri}")`);
+ if (backgroundRepeat !== 'default')
+ inlineStyle.push(`background-repeat: ${backgroundRepeat}`);
+ if (backgroundSize !== 'default')
+ inlineStyle.push(`background-size: ${backgroundSize}`);
+
+ this._lockDialogGroup.set_style(inlineStyle.join('; '));
+ }
+
async _syncInhibitor() {
const lockEnabled = this._settings.get_boolean(LOCK_ENABLED_KEY) ||
this._settings.get_boolean(SUSPEND_LOCK_ENABLED_KEY);

View File

@ -1,81 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Wed, 24 Aug 2022 19:15:36 +0200
Subject: darkMode: Add support to Yaru theme color variants
Support switching to dark mode when using the Yaru theme color accents.
---
js/ui/status/darkMode.js | 43 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/js/ui/status/darkMode.js b/js/ui/status/darkMode.js
index d4620f0..cf6fcf1 100644
--- a/js/ui/status/darkMode.js
+++ b/js/ui/status/darkMode.js
@@ -1,5 +1,5 @@
/* exported Indicator */
-const {Gio, GObject} = imports.gi;
+const {Gio, GObject, St} = imports.gi;
const Main = imports.ui.main;
const {QuickToggle, SystemIndicator} = imports.ui.quickSettings;
@@ -18,6 +18,9 @@ class DarkModeToggle extends QuickToggle {
this._changedId = this._settings.connect('changed::color-scheme',
() => this._sync());
+ St.Settings.get().connect('notify::gtk-theme', () => this._sync());
+ St.Settings.get().connect('notify::gtk-theme-variant', () => this._sync());
+
this.connectObject(
'destroy', () => this._settings.run_dispose(),
'clicked', () => this._toggleMode(),
@@ -27,13 +30,49 @@ class DarkModeToggle extends QuickToggle {
_toggleMode() {
Main.layoutManager.screenTransition.run();
+ const preferDark = !this.checked;
+ const {gtkTheme, gtkThemeVariant} = St.Settings.get();
+ const themeVariant = gtkThemeVariant?.toLowerCase();
this._settings.set_string('color-scheme',
this.checked ? 'default' : 'prefer-dark');
+
+ if (gtkTheme === 'Yaru')
+ this._setYaruSettings(themeVariant, preferDark);
+ }
+
+ _setYaruSettings(themeVariant, preferDark) {
+ const currentlyDark = themeVariant === 'dark' || themeVariant?.endsWith('-dark');
+ if (currentlyDark)
+ themeVariant = themeVariant.slice(0, -'-dark'.length);
+
+ if (currentlyDark !== preferDark) {
+ const newTheme = `Yaru${
+ themeVariant ? `-${themeVariant}` : ''}${
+ preferDark ? '-dark' : ''}`;
+
+ this._settings.set_string('gtk-theme', newTheme);
+ this._settings.set_string('icon-theme', newTheme);
+ }
+
+ const schemaSource = Gio.SettingsSchemaSource.get_default();
+ const geditSchema = schemaSource.lookup('org.gnome.gedit.preferences.editor', true);
+
+ if (geditSchema) {
+ const geditSettings = Gio.Settings.new_full(geditSchema, null, null);
+ const geditScheme = geditSettings.get_user_value('scheme')?.unpack();
+
+ if (geditScheme?.startsWith('Yaru') &&
+ geditScheme.endsWith('-dark') !== preferDark)
+ geditSettings.set_string('scheme', `Yaru${preferDark ? '-dark' : ''}`);
+ }
}
_sync() {
const colorScheme = this._settings.get_string('color-scheme');
- const checked = colorScheme === 'prefer-dark';
+ const {gtkTheme, gtkThemeVariant} = St.Settings.get();
+ let checked = colorScheme === 'prefer-dark';
+ if (gtkTheme === 'Yaru' && !gtkThemeVariant?.endsWith('dark'))
+ checked = false;
if (this.checked !== checked)
this.set({checked});
}

View File

@ -1,66 +0,0 @@
From: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Date: Wed, 20 Jun 2018 19:22:06 +0200
Subject: Add an helper to detect current desktop
We will differentiate some behavior depending on current desktop. Add an
helper to centralize the current desktop detection.
Forwarded: not-needed
Origin: ubuntu
===================================================================
---
js/js-resources.gresource.xml | 1 +
js/misc/desktop.js | 33 +++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
create mode 100644 js/misc/desktop.js
diff --git a/js/js-resources.gresource.xml b/js/js-resources.gresource.xml
index c6e4791..3fc5302 100644
--- a/js/js-resources.gresource.xml
+++ b/js/js-resources.gresource.xml
@@ -13,6 +13,7 @@
<file>misc/config.js</file>
<file>misc/extensionUtils.js</file>
+ <file>misc/desktop.js</file>
<file>misc/fileUtils.js</file>
<file>misc/dbusUtils.js</file>
<file>misc/gnomeSession.js</file>
diff --git a/js/misc/desktop.js b/js/misc/desktop.js
new file mode 100644
index 0000000..8bdca57
--- /dev/null
+++ b/js/misc/desktop.js
@@ -0,0 +1,33 @@
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
+
+const GLib = imports.gi.GLib;
+
+// current desktop doesn't change unless we restart the shell or control
+// the env variable. It's safe to cache matching result
+const _currentDesktopsMatches = new Map();
+
+// is:
+// @name: desktop string you want to assert if it matches the current desktop env
+//
+// The function examples XDG_CURRENT_DESKTOP and return if the current desktop
+// is part of that desktop string.
+//
+// Return value: if the environment isn't set or doesn't match, return False
+// otherwise, return True.
+function is(name) {
+ if (!_currentDesktopsMatches.size) {
+ const desktopsEnv = GLib.getenv('XDG_CURRENT_DESKTOP');
+ if (!desktopsEnv) {
+ _currentDesktopsMatches.set(name, false);
+ return false;
+ }
+
+ const desktops = desktopsEnv.split(':');
+ desktops.forEach(d => _currentDesktopsMatches.set(d, true));
+
+ if (!_currentDesktopsMatches.size)
+ _currentDesktopsMatches.set(name, _currentDesktopsMatches.has(name));
+ }
+
+ return !!_currentDesktopsMatches.get(name);
+}

View File

@ -1,42 +0,0 @@
From: Jeremy Soller <jeremy@system76.com>
Date: Wed, 20 Jun 2018 19:22:06 +0200
Subject: Add support for GDM theme alternatives
GNOME vanilla and systemd76 derivative ships their own GDM theme.
This allows to provide alternative gresource file for gdm3 that must contain
a `gdm3.css` stylesheet that will be applied.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=787454
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1715722
Last-Update: 2017-09-08
---
data/gnome-shell-theme.gresource.xml | 1 +
js/ui/sessionMode.js | 2 ++
2 files changed, 3 insertions(+)
diff --git a/data/gnome-shell-theme.gresource.xml b/data/gnome-shell-theme.gresource.xml
index 24b3be8..2632e5d 100644
--- a/data/gnome-shell-theme.gresource.xml
+++ b/data/gnome-shell-theme.gresource.xml
@@ -9,6 +9,7 @@
<file>checkbox-off-focused.svg</file>
<file>checkbox-off-light.svg</file>
<file>checkbox-off.svg</file>
+ <file alias="gdm.css">gnome-shell.css</file>
<file>gnome-shell.css</file>
<file>gnome-shell-high-contrast.css</file>
<file>gnome-shell-start.svg</file>
diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js
index c67b4a7..7831646 100644
--- a/js/ui/sessionMode.js
+++ b/js/ui/sessionMode.js
@@ -50,6 +50,8 @@ const _modes = {
'gdm': {
hasNotifications: true,
+ stylesheetName: 'gdm.css',
+ themeResourceName: 'gdm-theme.gresource',
isGreeter: true,
isPrimary: true,
unlockDialog: imports.gdm.loginDialog.LoginDialog,

View File

@ -1,36 +0,0 @@
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Thu, 2 Apr 2020 17:16:27 +0800
Subject: Keep the Ubuntu logo at full brightness during startup animation
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1867133
Forwarded: not-needed
Last-Update: 2020-03-18
---
js/gdm/loginDialog.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 7e7d884..52f3a56 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -1261,7 +1261,11 @@ var LoginDialog = GObject.registerClass({
{ sortGroup: CtrlAltTab.SortGroup.MIDDLE });
this.activate();
- this.opacity = 0;
+ // Clutter doesn't yet fully support invisible parents with forced
+ // visible children and will make everything invisible (flicker) on
+ // the first frame if we start at 0. So we start at 1 instead...
+ this.opacity = 1;
+ this._logoBin.set_opacity_override(255);
this._grab = Main.pushModal(global.stage, { actionMode: Shell.ActionMode.LOGIN_SCREEN });
@@ -1269,6 +1273,7 @@ var LoginDialog = GObject.registerClass({
opacity: 255,
duration: 1000,
mode: Clutter.AnimationMode.EASE_IN_QUAD,
+ onComplete: () => { this._logoBin.set_opacity_override(-1); },
});
return true;

View File

@ -1,34 +0,0 @@
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Wed, 31 Mar 2021 17:59:09 +0800
Subject: layout: Try to allocate before getting size of tracked actors
Because we're about to `get_transformed_{position,size}` of each,
which will return NaNs if not yet allocated. Those NaNs were finding
their way into the workspace strut definitions on startup and not
getting corrected until after the startup animation completed. This
meant any extensions depending on the `workareas-changed` signal were
getting an incorrect workarea (the whole workspace) and so were
rendered out of place during the login animation. Now they're not.
Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
Origin: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1785
Bug-Ubuntu: https://launchpad.net/bugs/1917939, https://launchpad.net/bugs/1919979
Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/-/issues/1627
Forwarded: yes
Last-Update: 2021-04-07
---
js/ui/layout.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/js/ui/layout.js b/js/ui/layout.js
index e53ff9d..6fa9566 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -1051,6 +1051,7 @@ var LayoutManager = GObject.registerClass({
if (!(actorData.affectsInputRegion && wantsInputRegion) && !actorData.affectsStruts)
continue;
+ actorData.actor.get_allocation_box();
let [x, y] = actorData.actor.get_transformed_position();
let [w, h] = actorData.actor.get_transformed_size();
x = Math.round(x);

View File

@ -1,93 +0,0 @@
From: Tim Lunn <tim@feathertop.org>
Date: Tue, 9 Oct 2012 11:18:28 +0200
Subject: [PATCH] userMenu: allow user switching when using lightdm
When running lightdm and gnome-shell, its currently not possible to
switch users via the usermenu. This commit adds a dbus call to
switch to the lightdm greeter.
https://bugzilla.gnome.org/show_bug.cgi?id=685794
---
js/misc/systemActions.js | 47 ++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 40 insertions(+), 7 deletions(-)
diff --git a/js/misc/systemActions.js b/js/misc/systemActions.js
index 759862a..6c84fe2 100644
--- a/js/misc/systemActions.js
+++ b/js/misc/systemActions.js
@@ -224,6 +224,34 @@ const SystemActions = GObject.registerClass({
return this._actions.get(LOCK_ORIENTATION_ACTION_ID).iconName;
}
+ _lightdmLoginSession() {
+ try {
+ let seat = GLib.getenv("XDG_SEAT_PATH");
+ let result = Gio.DBus.system.call_sync('org.freedesktop.DisplayManager',
+ seat,
+ 'org.freedesktop.DisplayManager.Seat',
+ 'SwitchToGreeter', null, null,
+ Gio.DBusCallFlags.NONE,
+ -1, null);
+ return result;
+ } catch(e) {
+ return false;
+ }
+ }
+
+ _sensorProxyAppeared() {
+ this._sensorProxy = new SensorProxy(Gio.DBus.system, SENSOR_BUS_NAME, SENSOR_OBJECT_PATH,
+ (proxy, error) => {
+ if (error) {
+ log(error.message);
+ return;
+ }
+ this._sensorProxy.connect('g-properties-changed',
+ () => { this._updateOrientationLock(); });
+ this._updateOrientationLock();
+ });
+ }
+
_updateOrientationLock() {
const available = this._monitorManager.get_panel_orientation_managed();
@@ -325,7 +353,7 @@ const SystemActions = GObject.registerClass({
_updateLockScreen() {
let showLock = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
let allowLockScreen = !this._lockdownSettings.get_boolean(DISABLE_LOCK_SCREEN_KEY);
- this._actions.get(LOCK_SCREEN_ACTION_ID).available = showLock && allowLockScreen && LoginManager.canLock();
+ this._actions.get(LOCK_SCREEN_ACTION_ID).available = showLock && allowLockScreen;
this.notify('can-lock-screen');
}
@@ -413,20 +441,25 @@ const SystemActions = GObject.registerClass({
if (!this._actions.get(LOCK_SCREEN_ACTION_ID).available)
throw new Error('The lock-screen action is not available!');
- Main.screenShield.lock(true);
+ if (Main.screenShield)
+ Main.screenShield.lock(true);
+ else
+ this._lightdmLoginSession();
}
activateSwitchUser() {
if (!this._actions.get(SWITCH_USER_ACTION_ID).available)
throw new Error('The switch-user action is not available!');
- if (Main.screenShield)
+ if (Main.screenShield) {
Main.screenShield.lock(false);
- Clutter.threads_add_repaint_func_full(Clutter.RepaintFlags.POST_PAINT, () => {
- Gdm.goto_login_session_sync(null);
- return false;
- });
+ Clutter.threads_add_repaint_func_full(Clutter.RepaintFlags.POST_PAINT, () => {
+ Gdm.goto_login_session_sync(null);
+ return false;
+ });
+ } else
+ this._lightdmLoginSession();
}
activateLogout() {

View File

@ -1,48 +0,0 @@
From: Tim Lunn <tim@feathertop.org>
Date: Wed, 20 Jun 2018 19:22:06 +0200
Subject: add support for the ubuntu lock on suspend option
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1063110
---
js/ui/screenShield.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index b6c3c55..038c1df 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -22,6 +22,7 @@ const { adjustAnimationTime } = imports.ui.environment;
const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
const LOCK_ENABLED_KEY = 'lock-enabled';
const LOCK_DELAY_KEY = 'lock-delay';
+const SUSPEND_LOCK_ENABLED_KEY = 'ubuntu-lock-on-suspend';
const LOCKDOWN_SCHEMA = 'org.gnome.desktop.lockdown';
const DISABLE_LOCK_KEY = 'disable-lock-screen';
@@ -106,6 +107,7 @@ var ScreenShield = class extends Signals.EventEmitter {
this._settings = new Gio.Settings({ schema_id: SCREENSAVER_SCHEMA });
this._settings.connect(`changed::${LOCK_ENABLED_KEY}`, this._syncInhibitor.bind(this));
+ this._settings.connect(`changed::${SUSPEND_LOCK_ENABLED_KEY}`, this._syncInhibitor.bind(this));
this._lockSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
this._lockSettings.connect(`changed::${DISABLE_LOCK_KEY}`, this._syncInhibitor.bind(this));
@@ -211,7 +213,8 @@ var ScreenShield = class extends Signals.EventEmitter {
}
async _syncInhibitor() {
- const lockEnabled = this._settings.get_boolean(LOCK_ENABLED_KEY);
+ const lockEnabled = this._settings.get_boolean(LOCK_ENABLED_KEY) ||
+ this._settings.get_boolean(SUSPEND_LOCK_ENABLED_KEY);
const lockLocked = this._lockSettings.get_boolean(DISABLE_LOCK_KEY);
const inhibit = !!this._loginSession && this._loginSession.Active &&
!this._isActive && lockEnabled && !lockLocked &&
@@ -242,7 +245,7 @@ var ScreenShield = class extends Signals.EventEmitter {
_prepareForSleep(loginManager, aboutToSuspend) {
if (aboutToSuspend) {
- if (this._settings.get_boolean(LOCK_ENABLED_KEY))
+ if (this._settings.get_boolean(SUSPEND_LOCK_ENABLED_KEY))
this.lock(true);
} else {
this._wakeUpScreen();

View File

@ -1,50 +0,0 @@
From: Didier Roche <didrocks@ubuntu.com>
Date: Tue, 22 Oct 2019 11:22:06 +0200
Subject: Resolve real path name for theme file
We are using alternative theme paths. Some of them are symlinks like
gdm3.css. It points to a different directory and we need to ensure
assets are loaded from the real theme path then (assets path are
relative to it).
Resolve them symlinks to ensure we use the original file itself when
loading the stylesheet.
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1798747
Forwarded: Not-needed (upstream doesn't support officially theming)
---
js/ui/main.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/js/ui/main.js b/js/ui/main.js
index 5c3cb8e..1b4c9fd 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -404,6 +404,14 @@ async function _handleLockScreenWarning() {
}
}
+function _realpath(path) {
+ try {
+ while (GLib.file_test(path, GLib.FileTest.IS_SYMLINK))
+ path = GLib.file_read_link(path);
+ } catch (e) { }
+ return path;
+}
+
function _getStylesheet(name) {
let stylesheet;
@@ -414,12 +422,12 @@ function _getStylesheet(name) {
let dataDirs = GLib.get_system_data_dirs();
for (let i = 0; i < dataDirs.length; i++) {
let path = GLib.build_filenamev([dataDirs[i], 'gnome-shell', 'theme', name]);
- stylesheet = Gio.file_new_for_path(path);
+ stylesheet = Gio.file_new_for_path(_realpath(path));
if (stylesheet.query_exists(null))
return stylesheet;
}
- stylesheet = Gio.File.new_for_path(`${global.datadir}/theme/${name}`);
+ stylesheet = Gio.File.new_for_path(_realpath(`${global.datadir}/theme/${name}`));
if (stylesheet.query_exists(null))
return stylesheet;

View File

@ -1,163 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Thu, 23 Aug 2018 20:00:57 +0200
Subject: search: call XUbuntuCancel method on providers when no data is
needed
Add XUbuntuCancel method to search providers and call it when a search provider
is still doing operations.
Ignore the result when the method does not exist or is cancelled.
This will allow to stop operations on providers.
Fixes LP: #1756826
Bug-GNOME: https://gitlab.gnome.org/GNOME/gnome-shell/issues/183
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/bionic/+source/gnome-shell/+bug/1756826
Forwarded: not-needed
---
.../org.gnome.ShellSearchProvider.xml | 6 ++++
.../org.gnome.ShellSearchProvider2.xml | 6 ++++
js/ui/remoteSearch.js | 12 ++++++++
js/ui/search.js | 33 ++++++++++++++++++++++
4 files changed, 57 insertions(+)
diff --git a/data/dbus-interfaces/org.gnome.ShellSearchProvider.xml b/data/dbus-interfaces/org.gnome.ShellSearchProvider.xml
index 78ad305..393cb01 100644
--- a/data/dbus-interfaces/org.gnome.ShellSearchProvider.xml
+++ b/data/dbus-interfaces/org.gnome.ShellSearchProvider.xml
@@ -69,5 +69,11 @@
<method name="ActivateResult">
<arg type="s" name="identifier" direction="in" />
</method>
+
+ <!--
+ XUbuntuCancel:
+ Cancel the current search operation
+ -->
+ <method name="XUbuntuCancel" />
</interface>
</node>
diff --git a/data/dbus-interfaces/org.gnome.ShellSearchProvider2.xml b/data/dbus-interfaces/org.gnome.ShellSearchProvider2.xml
index 9502340..8141bc0 100644
--- a/data/dbus-interfaces/org.gnome.ShellSearchProvider2.xml
+++ b/data/dbus-interfaces/org.gnome.ShellSearchProvider2.xml
@@ -83,5 +83,11 @@
<arg type="as" name="terms" direction="in" />
<arg type="u" name="timestamp" direction="in" />
</method>
+
+ <!--
+ XUbuntuCancel:
+ Cancel the current search operation
+ -->
+ <method name="XUbuntuCancel" />
</interface>
</node>
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index 592dfe1..e50ded6 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -26,6 +26,7 @@ const SearchProviderIface = `
<method name="ActivateResult">
<arg type="s" direction="in" />
</method>
+<method name="XUbuntuCancel" />
</interface>
</node>`;
@@ -54,6 +55,7 @@ const SearchProvider2Iface = `
<arg type="as" direction="in" />
<arg type="u" direction="in" />
</method>
+<method name="XUbuntuCancel" />
</interface>
</node>`;
@@ -299,6 +301,16 @@ var RemoteSearchProvider = class {
return resultMetas;
}
+ async XUbuntuCancel(cancellable) {
+ try {
+ await this.proxy.XUbuntuCancelAsync(cancellable);
+ } catch (error) {
+ if (!error.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD) &&
+ !error.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
+ log(`Received error from D-Bus search provider ${this.id} during XUbuntuCancel: ${error}`);
+ }
+ }
+
activateResult(id) {
this.proxy.ActivateResultAsync(id).catch(logError);
}
diff --git a/js/ui/search.js b/js/ui/search.js
index 7d50ef2..53a812b 100644
--- a/js/ui/search.js
+++ b/js/ui/search.js
@@ -218,7 +218,9 @@ var SearchResultsBase = GObject.registerClass({
this._cancellable.cancel();
this._cancellable.reset();
+ this.provider.resultsMetasInProgress = true;
const metas = await this.provider.getResultMetas(metasNeeded, this._cancellable);
+ this.provider.resultsMetasInProgress = this._cancellable.is_cancelled();
if (this._cancellable.is_cancelled()) {
if (metas.length > 0)
@@ -596,6 +598,10 @@ var SearchResultsView = GObject.registerClass({
this._searchTimeoutId = 0;
this._cancellable = new Gio.Cancellable();
+ this._searchCancelCancellable = new Gio.Cancellable();
+ const cancellableCancelledId = this._cancellable.connect(() =>
+ this._cancelSearchProviderRequest());
+ this.connect('destroy', () => this._cancellable.disconnect(cancellableCancelledId));
this._registerProvider(new AppDisplay.AppSearchProvider());
@@ -644,11 +650,31 @@ var SearchResultsView = GObject.registerClass({
}
}
+ _cancelSearchProviderRequest() {
+ if (this._terms.length !== 0 || this._searchCancelTimeoutId)
+ return;
+
+ this._searchCancelTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 100, () => {
+ Promise.all(this._providers.map(async provider => {
+ if (provider.isRemoteProvider &&
+ (provider.searchInProgress || provider.resultsMetasInProgress)) {
+ await provider.XUbuntuCancel(this._searchCancelCancellable);
+ provider.searchInProgress = false;
+ provider.resultsMetasInProgress = false;
+ }
+ })).catch(logError);
+
+ delete this._searchCancelTimeoutId;
+ return GLib.SOURCE_REMOVE;
+ });
+ }
+
_reset() {
this._terms = [];
this._results = {};
this._clearDisplay();
this._clearSearchTimeout();
+ this._cancelSearchProviderRequest();
this._defaultResult = null;
this._startingSearch = false;
@@ -720,6 +746,13 @@ var SearchResultsView = GObject.registerClass({
if (this._terms.length > 0)
isSubSearch = searchString.indexOf(previousSearchString) == 0;
+ this._searchCancelCancellable.cancel();
+ this._searchCancelCancellable.reset();
+ if (this._searchCancelTimeoutId) {
+ GLib.source_remove(this._searchCancelTimeoutId);
+ delete this._searchCancelTimeoutId;
+ }
+
this._terms = terms;
this._isSubSearch = isSubSearch;
this._updateSearchProgress();

View File

@ -1,89 +0,0 @@
From: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Date: Wed, 20 Jun 2018 19:22:06 +0200
Subject: Don't allow ubuntu mode extension to update
Ensure that no update is proposed or loaded if sideloaded (always
prefer system version) on the ubuntu session.
We want to ensure that the default code running is going through
our QA and security team process than being loaded from a 3rd
party website.
Also, that will enable us to upload newer versions on GNOME
extension website while still letting older ubuntu release versions
running expected extension version.
Origin: ubuntu
Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=789852
---
js/ui/extensionDownloader.js | 11 +++++++++++
js/ui/extensionSystem.js | 9 +++++++++
2 files changed, 20 insertions(+)
diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js
index 197cc1c..2c92a6c 100644
--- a/js/ui/extensionDownloader.js
+++ b/js/ui/extensionDownloader.js
@@ -4,6 +4,7 @@
const { Clutter, Gio, GLib, GObject, Soup } = imports.gi;
const Config = imports.misc.config;
+const Desktop = imports.misc.desktop;
const Dialog = imports.ui.dialog;
const ExtensionUtils = imports.misc.extensionUtils;
const FileUtils = imports.misc.fileUtils;
@@ -32,6 +33,13 @@ async function installExtension(uuid, invocation) {
shell_version: Config.PACKAGE_VERSION,
};
+ if (Desktop.is('ubuntu') && Main.extensionManager.isModeExtension(uuid)) {
+ const msg = _("This is an extension enabled by your current mode, you can't install manually any update in that session.");
+ Main.notifyError(_("Can't install “%s”:").format(uuid), msg);
+ invocation.return_dbus_error('org.gnome.Shell.ExtensionError', msg);
+ return;
+ }
+
const message = Soup.Message.new_from_encoded_form('GET',
REPOSITORY_URL_INFO,
Soup.form_encode_hash(params));
@@ -188,6 +196,9 @@ async function checkForUpdates() {
return;
if (extension.hasUpdate)
return;
+ // don't updates out of repository mode extension
+ if (Desktop.is("ubuntu") && Main.extensionManager.isModeExtension(uuid))
+ return;
metadatas[uuid] = {
version: extension.metadata.version,
};
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index d9cdf77..4cc2ca3 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -4,6 +4,7 @@
const { GLib, Gio, GObject, Shell, St } = imports.gi;
const Signals = imports.misc.signals;
+const Desktop = imports.misc.desktop;
const ExtensionDownloader = imports.ui.extensionDownloader;
const ExtensionUtils = imports.misc.extensionUtils;
const FileUtils = imports.misc.fileUtils;
@@ -446,6 +447,10 @@ var ExtensionManager = class extends Signals.EventEmitter {
await this.loadExtension(newExtension);
}
+ isModeExtension(uuid) {
+ return this._getModeExtensions().indexOf(uuid) !== -1;
+ }
+
async _callExtensionInit(uuid) {
if (!this._extensionSupportsSessionMode(uuid))
return false;
@@ -662,6 +667,10 @@ var ExtensionManager = class extends Signals.EventEmitter {
let type = dir.has_prefix(perUserDir)
? ExtensionType.PER_USER
: ExtensionType.SYSTEM;
+ if (Desktop.is("ubuntu") && this.isModeExtension(uuid) && type === ExtensionType.PER_USER) {
+ log(`Found user extension ${uuid}, but not loading from ${dir.get_path()} directory as part of session mode.`);
+ return;
+ }
try {
extension = this.createExtensionObject(uuid, dir, type);
} catch (error) {

View File

@ -1,38 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Thu, 24 Feb 2022 04:22:32 +0100
Subject: sessionMode: Add support for configuring an icons resource name
Similar to what we did (and upstreamed) for the theme, in this case
however there's very likely no interest from upstream for this.
Forwarded: not-needed
---
js/ui/main.js | 2 +-
js/ui/sessionMode.js | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/js/ui/main.js b/js/ui/main.js
index 1b4c9fd..b39bcf4 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -491,7 +491,7 @@ function reloadThemeResource() {
/** @private */
function _loadIcons() {
- _iconResource = Gio.Resource.load(`${global.datadir}/gnome-shell-icons.gresource`);
+ _iconResource = Gio.Resource.load(`${global.datadir}/${sessionMode.iconsResourceName}`);
_iconResource._register();
}
diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js
index 5478b2a..863df7c 100644
--- a/js/ui/sessionMode.js
+++ b/js/ui/sessionMode.js
@@ -24,6 +24,7 @@ const _modes = {
parentMode: null,
stylesheetName: 'gnome-shell.css',
themeResourceName: 'gnome-shell-theme.gresource',
+ iconsResourceName: 'gnome-shell-icons.gresource',
hasOverview: false,
showCalendarEvents: false,
showWelcomeDialog: false,

View File

@ -1,75 +0,0 @@
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Mon, 27 Mar 2023 21:02:02 +0200
Subject: shell-global, util: Do not move snap apps to gnome-apps scope
Snap applications already have their own scope so we must not move them.
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2011806
---
js/misc/util.js | 20 ++++++++++++++++++--
src/shell-global.c | 7 +++++++
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/js/misc/util.js b/js/misc/util.js
index e6065c4..c3c2dc7 100644
--- a/js/misc/util.js
+++ b/js/misc/util.js
@@ -110,6 +110,20 @@ function spawnApp(argv) {
// this will throw an error.
function trySpawn(argv) {
var success_, pid;
+ let path = argv[0];
+
+ if (!path?.includes('/')) {
+ path = GLib.find_program_in_path(argv[0]);
+ if (!path) {
+ throw new GLib.SpawnError({
+ code: GLib.SpawnError.NOENT,
+ message: _('Command not found'),
+ });
+ }
+
+ argv = [path, ...argv.slice(1)];
+ }
+
try {
[success_, pid] = GLib.spawn_async(
null, argv, null,
@@ -141,8 +155,10 @@ function trySpawn(argv) {
}
}
- // Async call, we don't need the reply though
- GnomeDesktop.start_systemd_scope(argv[0], pid, null, null, null, () => {});
+ if (!path?.includes('/snap/bin') && !argv?.join(' ').includes('snap run')) {
+ // Async call, we don't need the reply though
+ GnomeDesktop.start_systemd_scope(argv[0], pid, null, null, null, () => {});
+ }
// Dummy child watch; we don't want to double-fork internally
// because then we lose the parent-child relationship, which
diff --git a/src/shell-global.c b/src/shell-global.c
index f34dc3b..fc475cd 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -1485,6 +1485,7 @@ shell_global_app_launched_cb (GAppLaunchContext *context,
{
gint32 pid;
const gchar *app_name;
+ const gchar *command_line;
if (!g_variant_lookup (platform_data, "pid", "i", &pid))
return;
@@ -1498,6 +1499,12 @@ shell_global_app_launched_cb (GAppLaunchContext *context,
if (app_name == NULL)
app_name = g_app_info_get_executable (info);
+ command_line = g_app_info_get_commandline (info);
+ if (command_line &&
+ (strstr (command_line, "/snap/bin") ||
+ strstr (command_line, "snap run")))
+ return;
+
/* Start async request; we don't care about the result */
gnome_start_systemd_scope (app_name,
pid,

View File

@ -3,15 +3,16 @@ DEBIAN_FRONTEND=noninteractive
apt install gnome-pkg-tools -y
# Clone Upstream
git clone https://gitlab.gnome.org/GNOME/gnome-shell -b 44.2 gnome-shell-vrr
git clone https://gitlab.gnome.org/GNOME/gnome-shell -b 45.0 gnome-shell-vrr
cp -rvf ./debian ./gnome-shell-vrr
cd ./gnome-shell-vrr
for i in $(cat ../patches/series) ; do echo "Applying Patch: $i" && patch -Np1 -i ../patches/$i || bash -c "echo "Applying Patch $i Failed!" && exit 2"; done
# Get build deps
apt-get build-dep ./ -y
# Build package
LOGNAME=root dh_make --createorig -y -l -p gnome-shell-vrr_44.2
LOGNAME=root dh_make --createorig -y -l -p gnome-shell-vrr_45.0
dpkg-buildpackage --no-sign
# Move the debs to output