import gnome-shell-47~alpha-4.el10

c10-beta imports/c10-beta/gnome-shell-47%7ealpha-4.el10
MSVSphere Packaging Team 4 weeks ago
commit 67b18f63f3
Signed by: sys_gitsync
GPG Key ID: B2B0B9F29E528FE8

1
.gitignore vendored

@ -0,0 +1 @@
SOURCES/gnome-shell-47.alpha.tar.xz

@ -0,0 +1 @@
e38a2e3b7dc71883a73c6be7fef1ce83f2c8d83c SOURCES/gnome-shell-47.alpha.tar.xz

@ -0,0 +1,28 @@
From 55c1dfed04084e9dbaf034263172bc745f905718 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 20 May 2015 16:44:00 +0200
Subject: [PATCH] app: Fall back to window title instead of WM_CLASS
It's a bad fallback as it's clearly window-specific (rather than
app-specific), but it likely looks prettier when we fail to associate
a .desktop file ...
---
src/shell-app.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shell-app.c b/src/shell-app.c
index 04d0ab508b..4a55daf809 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -247,7 +247,7 @@ shell_app_get_name (ShellApp *app)
const char *name = NULL;
if (window)
- name = meta_window_get_wm_class (window);
+ name = meta_window_get_title (window);
if (!name)
name = C_("program", "Unknown");
return name;
--
2.45.2

@ -0,0 +1,56 @@
From 170ccbd3d237bf980f46ae87e3da8238df9f8a3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 16 Apr 2024 20:49:40 +0200
Subject: [PATCH] data: Update generated stylesheets
---
data/theme/gnome-shell-dark.css | 3 +++
data/theme/gnome-shell-high-contrast.css | 3 +++
data/theme/gnome-shell-light.css | 3 +++
3 files changed, 9 insertions(+)
diff --git a/data/theme/gnome-shell-dark.css b/data/theme/gnome-shell-dark.css
index 339adf7e7b..5dd7d29a3a 100644
--- a/data/theme/gnome-shell-dark.css
+++ b/data/theme/gnome-shell-dark.css
@@ -1720,6 +1720,9 @@ StScrollBar {
min-width: 0.5455em;
min-height: 0.5455em;
background-color: #ffffff; }
+ #panel .panel-button#panelActivities .activities-logo {
+ icon-size: 1.36375em;
+ padding: 0 6px; }
#panel .panel-button.screen-recording-indicator StBoxLayout, #panel .panel-button.screen-sharing-indicator StBoxLayout {
spacing: 0.409em; }
#panel .panel-button.screen-recording-indicator StIcon, #panel .panel-button.screen-sharing-indicator StIcon {
diff --git a/data/theme/gnome-shell-high-contrast.css b/data/theme/gnome-shell-high-contrast.css
index 4bb622aa26..8f94fa4101 100644
--- a/data/theme/gnome-shell-high-contrast.css
+++ b/data/theme/gnome-shell-high-contrast.css
@@ -1897,6 +1897,9 @@ StScrollBar {
min-width: 0.5455em;
min-height: 0.5455em;
background-color: #ffffff; }
+ #panel .panel-button#panelActivities .activities-logo {
+ icon-size: 1.36375em;
+ padding: 0 6px; }
#panel .panel-button.screen-recording-indicator StBoxLayout, #panel .panel-button.screen-sharing-indicator StBoxLayout {
spacing: 0.409em; }
#panel .panel-button.screen-recording-indicator StIcon, #panel .panel-button.screen-sharing-indicator StIcon {
diff --git a/data/theme/gnome-shell-light.css b/data/theme/gnome-shell-light.css
index 82a5b0bc18..128aa93dea 100644
--- a/data/theme/gnome-shell-light.css
+++ b/data/theme/gnome-shell-light.css
@@ -1720,6 +1720,9 @@ StScrollBar {
min-width: 0.5455em;
min-height: 0.5455em;
background-color: #282828; }
+ #panel .panel-button#panelActivities .activities-logo {
+ icon-size: 1.36375em;
+ padding: 0 6px; }
#panel .panel-button.screen-recording-indicator StBoxLayout, #panel .panel-button.screen-sharing-indicator StBoxLayout {
spacing: 0.409em; }
#panel .panel-button.screen-recording-indicator StIcon, #panel .panel-button.screen-sharing-indicator StIcon {
--
2.45.2

@ -0,0 +1,37 @@
From 7e82f0a73a1d1576e94b17e21d07fd3978ba7c33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Mon, 1 Feb 2021 18:26:00 +0100
Subject: [PATCH] extensionDownloader: Refuse to override system extensions
The website allows to "update" system extensions by installing the
upstream version into the user's home directory.
Prevent that by refusing to download and install extensions that are
already installed system-wide.
---
js/ui/extensionDownloader.js | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js
index 0366c5dfa8..5b27543aa6 100644
--- a/js/ui/extensionDownloader.js
+++ b/js/ui/extensionDownloader.js
@@ -39,6 +39,15 @@ export async function installExtension(uuid, invocation) {
return;
}
+ const oldExt = Main.extensionManager.lookup(uuid);
+ if (oldExt && oldExt.type === ExtensionUtils.ExtensionType.SYSTEM) {
+ log('extensionDownloader: Trying to replace system extension %s'.format(uuid));
+ invocation.return_error_literal(
+ ExtensionErrors, ExtensionError.NOT_ALLOWED,
+ 'System extensions cannot be replaced');
+ return;
+ }
+
const params = {
uuid,
shell_version: Config.PACKAGE_VERSION,
--
2.45.2

@ -0,0 +1,67 @@
From ff73f820b1398e5d60b8984b0003db46ad70b8ec Mon Sep 17 00:00:00 2001
From: Benjamin Berg <bberg@redhat.com>
Date: Wed, 28 Apr 2021 16:50:03 +0200
Subject: [PATCH] gdm: Work around failing fingerprint auth
On Fedora we have the problem that fingerprint auth fails immediately if
the PAM configuration has not been updated and no prints are enrolled.
So, consider a verification failure within one second to be a service
failure instead.
---
js/gdm/util.js | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 97df6d687e..371953cb25 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -109,6 +109,7 @@ export class ShellUserVerifier extends Signals.EventEmitter {
this._defaultService = null;
this._preemptingService = null;
this._fingerprintReaderType = FingerprintReaderType.NONE;
+ this._fprintStartTime = -1;
this._messageQueue = [];
this._messageQueueTimeoutId = 0;
@@ -669,6 +670,10 @@ export class ShellUserVerifier extends Signals.EventEmitter {
this._hold.acquire();
try {
this._activeServices.add(serviceName);
+
+ if (serviceName == FINGERPRINT_SERVICE_NAME)
+ this._fprintStartTime = GLib.get_monotonic_time();
+
if (this._userName) {
await this._userVerifier.call_begin_verification_for_user(
serviceName, this._userName, this._cancellable);
@@ -763,6 +768,7 @@ export class ShellUserVerifier extends Signals.EventEmitter {
const cancellable = this._cancellable;
this._fingerprintFailedId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
FINGERPRINT_ERROR_TIMEOUT_WAIT, () => {
+ log("Generating _verificationFailed!");
this._fingerprintFailedId = 0;
if (!cancellable.is_cancelled())
this._verificationFailed(serviceName, false);
@@ -829,6 +835,18 @@ export class ShellUserVerifier extends Signals.EventEmitter {
if (serviceName === FINGERPRINT_SERVICE_NAME) {
if (this._fingerprintFailedId)
GLib.source_remove(this._fingerprintFailedId);
+
+ // On Fedora we have the problem that fingerprint auth fails
+ // immediately if the PAM configuration has not been updated and no
+ // prints are enrolled.
+ // So, consider a verification failure within one second to be a service
+ // failure instead.
+ if (this._fprintStartTime > GLib.get_monotonic_time() - GLib.USEC_PER_SEC) {
+ log("Fingerprint service failed almost immediately, considering it unavailable.");
+ log("Please fix your configuration by running: authselect select --force sssd with-fingerprint with-silent-lastlog");
+ this._onServiceUnavailable(this._client, serviceName, null);
+ return;
+ }
}
// For Not Listed / enterprise logins, immediately reset
--
2.43.2

@ -0,0 +1,38 @@
From 2060b040f91c3751861a1c1b985c5fe8cc891d58 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 29 Oct 2020 18:21:06 +0100
Subject: [PATCH] main: Dump stack on segfaults by default
---
src/main.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/main.c b/src/main.c
index 4be47258eb..b324b6b96a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -47,6 +47,7 @@ static char *script_path = NULL;
#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1
#define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4
+#define DEFAULT_SHELL_DEBUG SHELL_DEBUG_BACKTRACE_SEGFAULTS
enum {
SHELL_DEBUG_BACKTRACE_WARNINGS = 1,
SHELL_DEBUG_BACKTRACE_SEGFAULTS = 2,
@@ -381,8 +382,11 @@ shell_init_debug (const char *debug_env)
{ "backtrace-segfaults", SHELL_DEBUG_BACKTRACE_SEGFAULTS },
};
- _shell_debug = g_parse_debug_string (debug_env, keys,
- G_N_ELEMENTS (keys));
+ if (debug_env)
+ _shell_debug = g_parse_debug_string (debug_env, keys,
+ G_N_ELEMENTS (keys));
+ else
+ _shell_debug = DEFAULT_SHELL_DEBUG;
}
static GLogWriterOutput
--
2.45.2

@ -0,0 +1,51 @@
From c0b2f60108e7b8cffa10306ef54c620fe71a6735 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 22 May 2024 18:42:06 +0200
Subject: [PATCH] panel: Use branding in activities button
Replace the upstream workspace dots with a red hat.
---
data/theme/gnome-shell-sass/widgets/_panel.scss | 5 +++++
js/ui/panel.js | 10 +++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/data/theme/gnome-shell-sass/widgets/_panel.scss b/data/theme/gnome-shell-sass/widgets/_panel.scss
index 2a29eee9da..02f8232de6 100644
--- a/data/theme/gnome-shell-sass/widgets/_panel.scss
+++ b/data/theme/gnome-shell-sass/widgets/_panel.scss
@@ -58,6 +58,11 @@ $panel_transition_duration: 250ms; // same as the overview transition duration
min-height: $scalable_icon_size * 0.5;
background-color: $panel_fg_color;
}
+
+ & .activities-logo {
+ icon-size: $scalable_icon_size * 1.25;
+ padding: 0 $base_padding;
+ }
}
// screen activity indicators
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 62c8ebb31a..1d11cc1b5f 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -425,7 +425,15 @@ class ActivitiesButton extends PanelMenu.Button {
accessible_name: _('Activities'),
});
- this.add_child(new WorkspaceIndicators());
+ if (GLib.get_os_info('ID') === 'rhel') {
+ const logoIcon = new St.Icon({
+ icon_name: 'fedora-logo-icon',
+ style_class: 'activities-logo',
+ });
+ this.add_child(logoIcon);
+ } else {
+ this.add_child(new WorkspaceIndicators());
+ }
Main.overview.connectObject('showing',
() => this.add_style_pseudo_class('checked'),
--
2.45.2

@ -0,0 +1,33 @@
From 17e77f1729b8542c46d5020d55edce4daf7ab24a Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Fri, 3 Jul 2015 13:54:36 -0400
Subject: [PATCH] screenShield: unblank when inserting smartcard
If a user inserts the smartcard when the screen is locked/blanked
we should ask them their pin right away.
At the moment they have to wiggle the mouse or do some other
action to get the screen to unblank.
---
js/ui/screenShield.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index d2236fb900..b62440dff6 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -94,8 +94,10 @@ export class ScreenShield extends Signals.EventEmitter {
this._smartcardManager = SmartcardManager.getSmartcardManager();
this._smartcardManager.connect('smartcard-inserted',
(manager, token) => {
- if (this._isLocked && token.UsedToLogin)
+ if (this._isLocked && token.UsedToLogin) {
+ this._wakeUpScreen();
this._activateDialog();
+ }
});
this._credentialManagers = {};
--
2.45.2

@ -0,0 +1,66 @@
From 5ddabd342d8016b5b1c8a56ecca7de21e91feb3c Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 15 Jan 2019 12:54:32 -0500
Subject: [PATCH] st-texture-cache: purge on resume
With the proprietary nvidia driver, textures get garbled on suspend,
so the texture cache needs to evict all textures in that situation.
---
js/ui/main.js | 6 +++++-
src/st/st-texture-cache.c | 10 ++++++++++
src/st/st-texture-cache.h | 1 +
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/js/ui/main.js b/js/ui/main.js
index ad0ea962f1..d9646fea52 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -265,7 +265,11 @@ async function _initializeUI() {
return true;
});
- global.display.connect('gl-video-memory-purged', loadTheme);
+ global.display.connect('gl-video-memory-purged', () => {
+ let cache = St.TextureCache.get_default();
+ cache.clear();
+ loadTheme();
+ });
global.context.connect('notify::unsafe-mode', () => {
if (!global.context.unsafe_mode)
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index a137480ad1..2e5c6c689a 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -129,6 +129,16 @@ st_texture_cache_class_init (StTextureCacheClass *klass)
G_TYPE_NONE, 1, G_TYPE_FILE);
}
+/* Evicts all cached textures */
+void
+st_texture_cache_clear (StTextureCache *cache)
+{
+ g_return_if_fail (ST_IS_TEXTURE_CACHE (cache));
+
+ g_hash_table_remove_all (cache->priv->keyed_cache);
+ g_signal_emit (cache, signals[ICON_THEME_CHANGED], 0);
+}
+
/* Evicts all cached textures for named icons */
static void
st_texture_cache_evict_icons (StTextureCache *cache)
diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h
index 1c5be957c4..1a4bfde73f 100644
--- a/src/st/st-texture-cache.h
+++ b/src/st/st-texture-cache.h
@@ -52,6 +52,7 @@ typedef enum {
} StTextureCachePolicy;
StTextureCache* st_texture_cache_get_default (void);
+void st_texture_cache_clear (StTextureCache *cache);
ClutterActor *
st_texture_cache_load_sliced_image (StTextureCache *cache,
--
2.45.2

File diff suppressed because one or more lines are too long

@ -0,0 +1,45 @@
From 15df1086028087e5a81830323137a8730d2c5888 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 14 Mar 2017 17:04:36 +0100
Subject: [PATCH] windowMenu: Bring back workspaces submenu for static
workspaces
When the titlebar context menu was moved to the shell, the submenu for
moving to a specific workspace was intentionally left out; some people
are quite attached to it though, so bring it back when static workspaces
are used.
---
js/ui/windowMenu.js | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js
index c69c183d7c..2db3962012 100644
--- a/js/ui/windowMenu.js
+++ b/js/ui/windowMenu.js
@@ -153,6 +153,23 @@ export class WindowMenu extends PopupMenu.PopupMenu {
window.change_workspace(workspace.get_neighbor(dir));
});
}
+
+ let { workspaceManager } = global;
+ let nWorkspaces = workspaceManager.n_workspaces;
+ if (nWorkspaces > 1 && !Meta.prefs_get_dynamic_workspaces()) {
+ item = new PopupMenu.PopupSubMenuMenuItem(_("Move to another workspace"));
+ this.addMenuItem(item);
+
+ let currentIndex = workspaceManager.get_active_workspace_index();
+ for (let i = 0; i < nWorkspaces; i++) {
+ let index = i;
+ let name = Meta.prefs_get_workspace_name(i);
+ let subitem = item.menu.addAction(name, () => {
+ window.change_workspace_by_index(index, false);
+ });
+ subitem.setSensitive(currentIndex != i);
+ }
+ }
}
}
--
2.45.2

@ -0,0 +1,170 @@
From 8a4efef39a0f48371c632d449688f29d06b9eed7 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 30 Sep 2015 12:51:24 -0400
Subject: [PATCH 1/3] authPrompt: don't fade out auth messages if user types
password up front
Right now we fade out any stale auth messages as soon as the user starts
typing. This behavior doesn't really make sense if the user is typing up
front, before a password is asked.
---
js/gdm/authPrompt.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 8a46559d90..9309f60886 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -211,7 +211,7 @@ export const AuthPrompt = GObject.registerClass({
[this._textEntry, this._passwordEntry].forEach(entry => {
entry.clutter_text.connect('text-changed', () => {
- if (!this._userVerifier.hasPendingMessages)
+ if (!this._userVerifier.hasPendingMessages && this._queryingService && !this._preemptiveAnswer)
this._fadeOutMessage();
});
--
2.45.2
From 007bbb694d4f30175caecbc9ada91515634bfd0b Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 30 Sep 2015 14:36:33 -0400
Subject: [PATCH 2/3] authPrompt: don't spin unless answering question
---
js/gdm/authPrompt.js | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 9309f60886..3e72668967 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -275,13 +275,14 @@ export const AuthPrompt = GObject.registerClass({
this.verificationStatus = AuthPromptStatus.VERIFICATION_IN_PROGRESS;
this.updateSensitivity(false);
- if (shouldSpin)
- this.startSpinning();
+ if (this._queryingService) {
+ if (shouldSpin)
+ this.startSpinning();
- if (this._queryingService)
this._userVerifier.answerQuery(this._queryingService, this._entry.text);
- else
+ } else {
this._preemptiveAnswer = this._entry.text;
+ }
this.emit('next');
}
--
2.45.2
From 92f66a5ff91e47d46a48d7ee51c0808f7ce1eaf9 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 5 Oct 2015 15:26:18 -0400
Subject: [PATCH 3/3] authPrompt: stop accepting preemptive answer if user
stops typing
We only want to allow the user to type the preemptive password in
one smooth motion. If they start to type, and then stop typing,
we should discard their preemptive password as expired.
Typing ahead the password is just a convenience for users who don't
want to manually lift the shift before typing their passwords, after
all.
---
js/gdm/authPrompt.js | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 3e72668967..254b4dbb88 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -70,6 +70,8 @@ export const AuthPrompt = GObject.registerClass({
this._defaultButtonWellActor = null;
this._cancelledRetries = 0;
+ this._idleMonitor = global.backend.get_core_idle_monitor();
+
let reauthenticationOnly;
if (this._mode === AuthPromptMode.UNLOCK_ONLY)
reauthenticationOnly = true;
@@ -127,8 +129,14 @@ export const AuthPrompt = GObject.registerClass({
}
_onDestroy() {
+ if (this._preemptiveAnswerWatchId) {
+ this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
+ this._preemptiveAnswerWatchId = 0;
+ }
+
this._inactiveEntry.destroy();
this._inactiveEntry = null;
+
this._userVerifier.destroy();
this._userVerifier = null;
}
@@ -282,6 +290,11 @@ export const AuthPrompt = GObject.registerClass({
this._userVerifier.answerQuery(this._queryingService, this._entry.text);
} else {
this._preemptiveAnswer = this._entry.text;
+
+ if (this._preemptiveAnswerWatchId) {
+ this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
+ this._preemptiveAnswerWatchId = 0;
+ }
}
this.emit('next');
@@ -493,6 +506,11 @@ export const AuthPrompt = GObject.registerClass({
}
setQuestion(question) {
+ if (this._preemptiveAnswerWatchId) {
+ this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
+ this._preemptiveAnswerWatchId = 0;
+ }
+
this._entry.hint_text = question;
this._authList.hide();
@@ -614,6 +632,19 @@ export const AuthPrompt = GObject.registerClass({
this._updateEntry(false);
}
+ _onUserStoppedTypePreemptiveAnswer() {
+ if (!this._preemptiveAnswerWatchId ||
+ this._preemptiveAnswer ||
+ this._queryingService)
+ return;
+
+ this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
+ this._preemptiveAnswerWatchId = 0;
+
+ this._entry.text = '';
+ this.updateSensitivity(false);
+ }
+
reset() {
let oldStatus = this.verificationStatus;
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
@@ -621,6 +652,11 @@ export const AuthPrompt = GObject.registerClass({
this.cancelButton.can_focus = this._hasCancelButton;
this._preemptiveAnswer = null;
+ if (this._preemptiveAnswerWatchId)
+ this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
+ this._preemptiveAnswerWatchId = this._idleMonitor.add_idle_watch(500,
+ this._onUserStoppedTypePreemptiveAnswer.bind(this));
+
if (this._userVerifier)
this._userVerifier.cancel();
--
2.45.2

@ -0,0 +1,105 @@
From eaa7217db15a28e88ce0b5a84827c306148561ca Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 28 Sep 2015 10:57:02 -0400
Subject: [PATCH 1/3] smartcardManager: add way to detect if user logged using
(any) token
If a user uses a token at login time, we need to make sure they continue
to use the token at unlock time.
As a prerequisite for addressing that problem we need to know up front
if a user logged in with a token at all.
This commit adds the necessary api to detect that case.
---
js/misc/smartcardManager.js | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/js/misc/smartcardManager.js b/js/misc/smartcardManager.js
index 32573cd384..6c48c80a19 100644
--- a/js/misc/smartcardManager.js
+++ b/js/misc/smartcardManager.js
@@ -118,4 +118,11 @@ class SmartcardManager extends Signals.EventEmitter {
return true;
}
+
+ loggedInWithToken() {
+ if (this._loginToken)
+ return true;
+
+ return false;
+ }
}
--
2.45.2
From d7ef26d7b9d352232c9e0a24a04bcfcf6eee7d9a Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 28 Sep 2015 19:56:53 -0400
Subject: [PATCH 2/3] gdm: only unlock with smartcard, if smartcard used for
login
If a smartcard is used for login, we need to make sure the smartcard
gets used for unlock, too.
---
js/gdm/util.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/js/gdm/util.js b/js/gdm/util.js
index c9c040beb7..c0d8852880 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -465,6 +465,8 @@ export class ShellUserVerifier extends Signals.EventEmitter {
this.smartcardDetected = false;
this._checkForSmartcard();
+ this._updateDefaultService();
+
this._smartcardManager.connectObject(
'smartcard-inserted', () => this._checkForSmartcard(),
'smartcard-removed', () => this._checkForSmartcard(), this);
@@ -643,7 +645,9 @@ export class ShellUserVerifier extends Signals.EventEmitter {
}
_getDetectedDefaultService() {
- if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
+ if (this._smartcardManager?.loggedInWithToken())
+ return SMARTCARD_SERVICE_NAME;
+ else if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
return PASSWORD_SERVICE_NAME;
else if (this._smartcardManager)
return SMARTCARD_SERVICE_NAME;
--
2.45.2
From 9bff98c2757e4591035e408aa9cee703cec74bdf Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 28 Sep 2015 19:57:36 -0400
Subject: [PATCH 3/3] gdm: update default service when smartcard inserted
Early on at start up we may not know if a smartcard is
available. Make sure we reupdate the default service
after we get a smartcard insertion event.
---
js/gdm/util.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/js/gdm/util.js b/js/gdm/util.js
index c0d8852880..430af4d8ef 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -490,6 +490,8 @@ export class ShellUserVerifier extends Signals.EventEmitter {
else if (this._preemptingService === SMARTCARD_SERVICE_NAME)
this._preemptingService = null;
+ this._updateDefaultService();
+
this.emit('smartcard-status-changed');
}
}
--
2.45.2

@ -0,0 +1,62 @@
From 04bf0729ed6ae75736e297a10603bcb0a564cb28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 9 Jun 2020 19:42:21 +0200
Subject: [PATCH 1/2] popupMenu: Guard against non-menu-item children
This avoid a harmless but annoying warning.
---
js/ui/popupMenu.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index b6ad545087..cbbcfea1ff 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -951,7 +951,8 @@ export class PopupMenuBase extends Signals.EventEmitter {
}
_getMenuItems() {
- return this.box.get_children().map(a => a._delegate).filter(item => {
+ const children = this.box.get_children().filter(a => a._delegate !== undefined);
+ return children.map(a => a._delegate).filter(item => {
return item instanceof PopupBaseMenuItem || item instanceof PopupMenuSection;
});
}
--
2.45.2
From cffe984d9b85494fcf34500e78875b66c1cec534 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 9 Jun 2020 19:48:06 +0200
Subject: [PATCH 2/2] st/shadow: Check pipeline when painting
We shouldn't simply assume that st_shadow_helper_update() has been
called before paint() or that the pipeline was created successfully.
---
src/st/st-shadow.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/st/st-shadow.c b/src/st/st-shadow.c
index a406b61532..574445aeac 100644
--- a/src/st/st-shadow.c
+++ b/src/st/st-shadow.c
@@ -294,9 +294,10 @@ st_shadow_helper_paint (StShadowHelper *helper,
ClutterActorBox *actor_box,
uint8_t paint_opacity)
{
- _st_paint_shadow_with_opacity (helper->shadow,
- node,
- helper->pipeline,
- actor_box,
- paint_opacity);
+ if (helper->pipeline != NULL)
+ _st_paint_shadow_with_opacity (helper->shadow,
+ node,
+ helper->pipeline,
+ actor_box,
+ paint_opacity);
}
--
2.45.2

@ -0,0 +1,29 @@
From 8fcaf1708fee86b1c16c9749dc1794be5a2a86fd Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Mon, 28 Feb 2022 10:27:09 -0500
Subject: [PATCH] data: Enable logo extension out of the box
Our brand team would like the logo extension to be used on new
installs.
This commit makes sure it gets enabled out of the box.
---
data/org.gnome.shell.gschema.xml.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in
index 3dd9d2d86b..fe1e266f8c 100644
--- a/data/org.gnome.shell.gschema.xml.in
+++ b/data/org.gnome.shell.gschema.xml.in
@@ -12,7 +12,7 @@
</description>
</key>
<key name="enabled-extensions" type="as">
- <default>[]</default>
+ <default>['background-logo@fedorahosted.org']</default>
<summary>UUIDs of extensions to enable</summary>
<description>
GNOME Shell extensions have a UUID property; this key lists extensions
--
2.45.2

@ -0,0 +1,38 @@
From 9bb33b1c8d0dba0d5c9e98d98b1063a1d0408414 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 17 Sep 2014 07:11:12 +0200
Subject: [PATCH] Replace Web with Firefox in default favorites
---
data/org.gnome.shell.gschema.xml.in | 2 +-
js/ui/appFavorites.js | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in
index 3cd37692a7..bd2bd5ead8 100644
--- a/data/org.gnome.shell.gschema.xml.in
+++ b/data/org.gnome.shell.gschema.xml.in
@@ -61,7 +61,7 @@
</description>
</key>
<key name="favorite-apps" type="as">
- <default>[ 'org.gnome.Epiphany.desktop', 'org.gnome.Calendar.desktop', 'org.gnome.Music.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop', 'org.gnome.TextEditor.desktop']</default>
+ <default>[ 'org.mozilla.firefox.desktop', 'org.gnome.Calendar.desktop', 'org.gnome.Music.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop', 'org.gnome.TextEditor.desktop']</default>
<summary>List of desktop file IDs for favorite applications</summary>
<description>
The applications corresponding to these identifiers
diff --git a/js/ui/appFavorites.js b/js/ui/appFavorites.js
index 576df3800d..a1deabde37 100644
--- a/js/ui/appFavorites.js
+++ b/js/ui/appFavorites.js
@@ -51,6 +51,7 @@ const RENAMED_DESKTOP_IDS = {
'gnotski.desktop': 'org.gnome.Klotski.desktop',
'gtali.desktop': 'org.gnome.Tali.desktop',
'iagno.desktop': 'org.gnome.Reversi.desktop',
+ 'firefox.desktop': 'org.mozilla.firefox.desktop',
'nautilus.desktop': 'org.gnome.Nautilus.desktop',
'org.gnome.gnome-2048.desktop': 'org.gnome.TwentyFortyEight.desktop',
'org.gnome.taquin.desktop': 'org.gnome.Taquin.desktop',
--
2.45.2

@ -0,0 +1,25 @@
From d4d39560f1694f06c3594f8d34eaa4b038804920 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 9 Mar 2017 14:44:32 +0100
Subject: [PATCH] appFavorites: Add terminal
---
data/org.gnome.shell.gschema.xml.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in
index bd2bd5ead8..4827fa5b79 100644
--- a/data/org.gnome.shell.gschema.xml.in
+++ b/data/org.gnome.shell.gschema.xml.in
@@ -61,7 +61,7 @@
</description>
</key>
<key name="favorite-apps" type="as">
- <default>[ 'org.mozilla.firefox.desktop', 'org.gnome.Calendar.desktop', 'org.gnome.Music.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop', 'org.gnome.TextEditor.desktop']</default>
+ <default>[ 'org.mozilla.firefox.desktop', 'org.gnome.Calendar.desktop', 'org.gnome.Music.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop', 'org.gnome.Ptyxis.desktop', 'org.gnome.TextEditor.desktop']</default>
<summary>List of desktop file IDs for favorite applications</summary>
<description>
The applications corresponding to these identifiers
--
2.45.2

@ -0,0 +1,511 @@
From d77ed9ad5fdadcdefcc41fecf8200bd2bf47282d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 12 Jun 2024 13:13:41 +0200
Subject: [PATCH 1/3] network: Split out CaptivePortalHandler class
The handling of captive portals is going to be extended a bit,
so split out a proper class instead of mixing it in with the
indicator code.
---
js/ui/status/network.js | 151 +++++++++++++++++++++++-----------------
1 file changed, 87 insertions(+), 64 deletions(-)
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 404733b74c..d34e947073 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -14,6 +14,7 @@ import * as Main from '../main.js';
import * as PopupMenu from '../popupMenu.js';
import * as MessageTray from '../messageTray.js';
import * as ModemManager from '../../misc/modemManager.js';
+import * as Signals from '../../misc/signals.js';
import * as Util from '../../misc/util.js';
import {Spinner} from '../animation.js';
@@ -1944,12 +1945,84 @@ class NMModemToggle extends NMDeviceToggle {
}
});
+class CaptivePortalHandler extends Signals.EventEmitter {
+ constructor(checkUri) {
+ super();
+
+ this._checkUri = checkUri;
+ this._connectivityQueue = new Set();
+ this._portalHelperProxy = null;
+ }
+
+ addConnection(path) {
+ if (this._connectivityQueue.has(path))
+ return;
+
+ this._launchPortalHelper(path).catch(logError);
+ }
+
+ removeConnection(path) {
+ if (this._connectivityQueue.delete(path))
+ this._portalHelperProxy?.CloseAsync(path);
+ }
+
+ _portalHelperDone(parameters) {
+ const [path, result] = parameters;
+
+ if (result === PortalHelperResult.CANCELLED) {
+ // Keep the connection in the queue, so the user is not
+ // spammed with more logins until we next flush the queue,
+ // which will happen once they choose a better connection
+ // or we get to full connectivity through other means
+ } else if (result === PortalHelperResult.COMPLETED) {
+ this.removeConnection(path);
+ } else if (result === PortalHelperResult.RECHECK) {
+ this.emit('recheck', path);
+ } else {
+ log(`Invalid result from portal helper: ${result}`);
+ }
+ }
+
+ async _launchPortalHelper(path) {
+ const timestamp = global.get_current_time();
+ if (!this._portalHelperProxy) {
+ this._portalHelperProxy = new Gio.DBusProxy({
+ g_connection: Gio.DBus.session,
+ g_name: 'org.gnome.Shell.PortalHelper',
+ g_object_path: '/org/gnome/Shell/PortalHelper',
+ g_interface_name: PortalHelperInfo.name,
+ g_interface_info: PortalHelperInfo,
+ });
+ this._portalHelperProxy.connectSignal('Done',
+ (proxy, emitter, params) => {
+ this._portalHelperDone(params);
+ });
+
+ try {
+ await this._portalHelperProxy.init_async(
+ GLib.PRIORITY_DEFAULT, null);
+ } catch (e) {
+ console.error(`Error launching the portal helper: ${e.message}`);
+ }
+ }
+
+ this._portalHelperProxy?.AuthenticateAsync(path, this._checkUri, timestamp).catch(logError);
+ this._connectivityQueue.add(path);
+ }
+
+ clear() {
+ for (const item of this._connectivityQueue)
+ this._portalHelperProxy?.CloseAsync(item);
+ this._connectivityQueue.clear();
+ }
+}
+
export const Indicator = GObject.registerClass(
class Indicator extends SystemIndicator {
_init() {
super._init();
- this._connectivityQueue = new Set();
+ this._portalHandler = null;
this._mainConnection = null;
@@ -2004,6 +2077,16 @@ class Indicator extends SystemIndicator {
this, 'visible',
GObject.BindingFlags.SYNC_CREATE);
+ const {connectivityCheckUri} = this._client;
+ this._portalHandler = new CaptivePortalHandler(connectivityCheckUri);
+ this._portalHandler.connect('recheck', async (o, path) => {
+ try {
+ const state = await this._client.check_connectivity_async(null);
+ if (state >= NM.ConnectivityState.FULL)
+ this._portalHandler.removeConnection(path);
+ } catch (e) { }
+ });
+
this._client.connectObject(
'notify::primary-connection', () => this._syncMainConnection(),
'notify::activating-connection', () => this._syncMainConnection(),
@@ -2066,42 +2149,10 @@ class Indicator extends SystemIndicator {
this._notification?.destroy();
}
- _flushConnectivityQueue() {
- for (let item of this._connectivityQueue)
- this._portalHelperProxy?.CloseAsync(item);
- this._connectivityQueue.clear();
- }
-
- _closeConnectivityCheck(path) {
- if (this._connectivityQueue.delete(path))
- this._portalHelperProxy?.CloseAsync(path);
- }
-
- async _portalHelperDone(parameters) {
- let [path, result] = parameters;
-
- if (result === PortalHelperResult.CANCELLED) {
- // Keep the connection in the queue, so the user is not
- // spammed with more logins until we next flush the queue,
- // which will happen once they choose a better connection
- // or we get to full connectivity through other means
- } else if (result === PortalHelperResult.COMPLETED) {
- this._closeConnectivityCheck(path);
- } else if (result === PortalHelperResult.RECHECK) {
- try {
- const state = await this._client.check_connectivity_async(null);
- if (state >= NM.ConnectivityState.FULL)
- this._closeConnectivityCheck(path);
- } catch (e) { }
- } else {
- log(`Invalid result from portal helper: ${result}`);
- }
- }
-
- async _syncConnectivity() {
+ _syncConnectivity() {
if (this._mainConnection == null ||
this._mainConnection.state !== NM.ActiveConnectionState.ACTIVATED) {
- this._flushConnectivityQueue();
+ this._portalHandler.clear();
return;
}
@@ -2116,35 +2167,7 @@ class Indicator extends SystemIndicator {
if (!isPortal || Main.sessionMode.isGreeter)
return;
- let path = this._mainConnection.get_path();
- if (this._connectivityQueue.has(path))
- return;
-
- let timestamp = global.get_current_time();
- if (!this._portalHelperProxy) {
- this._portalHelperProxy = new Gio.DBusProxy({
- g_connection: Gio.DBus.session,
- g_name: 'org.gnome.Shell.PortalHelper',
- g_object_path: '/org/gnome/Shell/PortalHelper',
- g_interface_name: PortalHelperInfo.name,
- g_interface_info: PortalHelperInfo,
- });
- this._portalHelperProxy.connectSignal('Done',
- (proxy, emitter, params) => {
- this._portalHelperDone(params).catch(logError);
- });
-
- try {
- await this._portalHelperProxy.init_async(
- GLib.PRIORITY_DEFAULT, null);
- } catch (e) {
- console.error(`Error launching the portal helper: ${e.message}`);
- }
- }
-
- this._portalHelperProxy?.AuthenticateAsync(path, this._client.connectivity_check_uri, timestamp).catch(logError);
-
- this._connectivityQueue.add(path);
+ this._portalHandler.addConnection(this._mainConnection.get_path());
}
_updateIcon() {
--
2.45.2
From cd489e54948e3f2900a1f4e354fd4bb43c62db6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 12 Jun 2024 13:13:41 +0200
Subject: [PATCH 2/3] status/network: Show notification when detecting captive
portal
When NetworkManager detects limited connectivity, we currently
pop up the portal helper window immediately. This can both be
disruptive when it happens unexpectedly, and unnoticeable
when it happens during screen lock.
In any case, it seems better to not pop up a window without
explicit user action, so instead show a notification that
launches the portal window when activated.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7688
---
js/ui/status/network.js | 38 ++++++++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index d34e947073..5d1e168fb5 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1951,19 +1951,43 @@ class CaptivePortalHandler extends Signals.EventEmitter {
this._checkUri = checkUri;
this._connectivityQueue = new Set();
+ this._notifications = new Map();
this._portalHelperProxy = null;
}
- addConnection(path) {
- if (this._connectivityQueue.has(path))
+ addConnection(name, path) {
+ if (this._connectivityQueue.has(path) || this._notifications.has(path))
return;
- this._launchPortalHelper(path).catch(logError);
+ const source = MessageTray.getSystemSource();
+
+ const notification = new MessageTray.Notification({
+ title: _('Sign Into WiFi Network'),
+ body: name,
+ source,
+ });
+ notification.connect('activated',
+ () => this._onNotificationActivated(path).catch(logError));
+ notification.connect('destroy',
+ () => this._notifications.delete(path));
+ this._notifications.set(path, notification);
+ source.addNotification(notification);
}
+
removeConnection(path) {
if (this._connectivityQueue.delete(path))
this._portalHelperProxy?.CloseAsync(path);
+ this._notifications.get(path)?.destroy(
+ MessageTray.NotificationDestroyedReason.SOURCE_CLOSED);
+ this._notifications.delete(path);
+ }
+
+ _onNotificationActivated(path) {
+ this._launchPortalHelper(path).catch(logError);
+
+ Main.overview.hide();
+ Main.panel.closeCalendar();
}
_portalHelperDone(parameters) {
@@ -2014,6 +2038,10 @@ class CaptivePortalHandler extends Signals.EventEmitter {
for (const item of this._connectivityQueue)
this._portalHelperProxy?.CloseAsync(item);
this._connectivityQueue.clear();
+
+ for (const n of this._notifications.values())
+ n.destroy(MessageTray.NotificationDestroyedReason.SOURCE_CLOSED);
+ this._notifications.clear();
}
}
@@ -2167,7 +2195,9 @@ class Indicator extends SystemIndicator {
if (!isPortal || Main.sessionMode.isGreeter)
return;
- this._portalHandler.addConnection(this._mainConnection.get_path());
+ this._portalHandler.addConnection(
+ this._mainConnection.get_id(),
+ this._mainConnection.get_path());
}
_updateIcon() {
--
2.45.2
From 52b8a150dd96086a48ba2ac7668b22e6429767fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 12 Jun 2024 13:13:41 +0200
Subject: [PATCH 3/3] build: Add option to disable portal-helper
The portal login window uses WebKit, which is a security-sensitive
component that not all vendors want to support.
Support that case with a build option, and update the captive
portal handler to use the user's default browser if the portal-helper
is disabled.
---
data/icons/meson.build | 10 +++++++++-
data/meson.build | 2 +-
js/meson.build | 14 ++++++++------
js/misc/config.js.in | 2 ++
js/misc/meson.build | 1 +
js/ui/status/network.js | 15 +++++++++++----
meson.build | 5 +++++
meson_options.txt | 6 ++++++
src/meson.build | 2 +-
9 files changed, 44 insertions(+), 13 deletions(-)
diff --git a/data/icons/meson.build b/data/icons/meson.build
index eff6e4b530..277df017b2 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -1 +1,9 @@
-install_subdir('hicolor', install_dir: icondir)
+excluded_icons=[]
+if not have_portal_helper
+ excluded_icons += [
+ 'scalable/apps/org.gnome.Shell.CaptivePortal.svg',
+ 'symbolic/apps/org.gnome.Shell.CaptivePortal-symbolic.svg',
+ ]
+endif
+install_subdir('hicolor',
+ install_dir: icondir, exclude_files: excluded_icons)
diff --git a/data/meson.build b/data/meson.build
index 8654dfeca7..ed13b6baea 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -6,7 +6,7 @@ desktop_files = [
]
service_files = []
-if have_networkmanager
+if have_portal_helper
desktop_files += 'org.gnome.Shell.PortalHelper.desktop'
service_files += 'org.gnome.Shell.PortalHelper.service'
endif
diff --git a/js/meson.build b/js/meson.build
index 4809f82b83..e594e23627 100644
--- a/js/meson.build
+++ b/js/meson.build
@@ -8,9 +8,11 @@ js_resources = gnome.compile_resources(
dependencies: [config_js]
)
-portal_resources = gnome.compile_resources(
- 'portal-resources', 'portal-resources.gresource.xml',
- source_dir: ['.', meson.current_build_dir()],
- c_name: 'portal_js_resources',
- dependencies: [config_js]
-)
+if have_portal_helper
+ portal_resources = gnome.compile_resources(
+ 'portal-resources', 'portal-resources.gresource.xml',
+ source_dir: ['.', meson.current_build_dir()],
+ c_name: 'portal_js_resources',
+ dependencies: [config_js]
+ )
+endif
diff --git a/js/misc/config.js.in b/js/misc/config.js.in
index ad8d46d841..ce319e0f84 100644
--- a/js/misc/config.js.in
+++ b/js/misc/config.js.in
@@ -7,6 +7,8 @@ export const PACKAGE_NAME = '@PACKAGE_NAME@';
export const PACKAGE_VERSION = '@PACKAGE_VERSION@';
/* 1 if networkmanager is available, 0 otherwise */
export const HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@;
+/* 1 if portal helper is enabled, 0 otherwise */
+export const HAVE_PORTAL_HELPER = @HAVE_PORTAL_HELPER@;
/* gettext package */
export const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
/* locale dir */
diff --git a/js/misc/meson.build b/js/misc/meson.build
index 5aceefac42..5fc8ca433f 100644
--- a/js/misc/meson.build
+++ b/js/misc/meson.build
@@ -4,6 +4,7 @@ jsconf.set('PACKAGE_VERSION', meson.project_version())
jsconf.set('GETTEXT_PACKAGE', meson.project_name())
jsconf.set('LIBMUTTER_API_VERSION', mutter_api_version)
jsconf.set10('HAVE_NETWORKMANAGER', have_networkmanager)
+jsconf.set10('HAVE_PORTAL_HELPER', have_portal_helper)
jsconf.set('datadir', datadir)
jsconf.set('libexecdir', libexecdir)
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 5d1e168fb5..cdc9ba8928 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -10,6 +10,7 @@ import Polkit from 'gi://Polkit';
import Shell from 'gi://Shell';
import St from 'gi://St';
+import * as Config from '../../misc/config.js';
import * as Main from '../main.js';
import * as PopupMenu from '../popupMenu.js';
import * as MessageTray from '../messageTray.js';
@@ -1967,7 +1968,7 @@ class CaptivePortalHandler extends Signals.EventEmitter {
source,
});
notification.connect('activated',
- () => this._onNotificationActivated(path).catch(logError));
+ () => this._onNotificationActivated(path));
notification.connect('destroy',
() => this._notifications.delete(path));
this._notifications.set(path, notification);
@@ -1984,7 +1985,13 @@ class CaptivePortalHandler extends Signals.EventEmitter {
}
_onNotificationActivated(path) {
- this._launchPortalHelper(path).catch(logError);
+ const context = global.create_app_launch_context(
+ global.get_current_time(), -1);
+
+ if (Config.HAVE_PORTAL_HELPER)
+ this._launchPortalHelper(path, context).catch(logError);
+ else
+ Gio.AppInfo.launch_default_for_uri(this._checkUri, context);
Main.overview.hide();
Main.panel.closeCalendar();
@@ -2007,8 +2014,7 @@ class CaptivePortalHandler extends Signals.EventEmitter {
}
}
- async _launchPortalHelper(path) {
- const timestamp = global.get_current_time();
+ async _launchPortalHelper(path, context) {
if (!this._portalHelperProxy) {
this._portalHelperProxy = new Gio.DBusProxy({
g_connection: Gio.DBus.session,
@@ -2030,6 +2036,7 @@ class CaptivePortalHandler extends Signals.EventEmitter {
}
}
+ const {timestamp} = context;
this._portalHelperProxy?.AuthenticateAsync(path, this._checkUri, timestamp).catch(logError);
this._connectivityQueue.add(path);
}
diff --git a/meson.build b/meson.build
index 035f54732a..4721bd6017 100644
--- a/meson.build
+++ b/meson.build
@@ -107,6 +107,11 @@ else
have_networkmanager = false
endif
+have_portal_helper = get_option('portal_helper')
+if have_portal_helper and not have_networkmanager
+ error('Portal helper requires networkmanager support')
+endif
+
if get_option('camera_monitor')
libpipewire_dep = dependency('libpipewire-0.3', version: pipewire_req)
have_pipewire = true
diff --git a/meson_options.txt b/meson_options.txt
index 6e83d92f2e..01e0d5803b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -40,6 +40,12 @@ option('networkmanager',
description: 'Enable NetworkManager support'
)
+option('portal_helper',
+ type: 'boolean',
+ value: true,
+ description: 'Enable build-in network portal login'
+)
+
option('systemd',
type: 'boolean',
value: true,
diff --git a/src/meson.build b/src/meson.build
index 752104e120..a3bf542480 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -286,7 +286,7 @@ executable('gnome-shell', 'main.c',
install: true
)
-if have_networkmanager
+if have_portal_helper
executable('gnome-shell-portal-helper',
'gnome-shell-portal-helper.c', portal_resources,
c_args: tools_cflags,
--
2.45.2

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save