Avoid broken app instances with remote clients

Resolves: RHEL-68825
This commit is contained in:
Jonas Ådahl 2025-11-27 15:08:38 +01:00
parent 926a37291c
commit 2795be07c1
2 changed files with 91 additions and 1 deletions

View File

@ -0,0 +1,85 @@
From 8f6fe1b2290c112e2b4b75812e67ea82bdf7660d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 27 Nov 2025 14:28:16 +0100
Subject: [PATCH] shell/window-tracker: Track windows when finding app info
already
We'd get the Shell.App from the window, in order to get the app info for
find-app-info signal, but that had the side effect of creating and
starting the Shell.App instance, without tracking the window.
Fix this by simply fully tracking the window already at this stage.
---
src/shell-window-tracker.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c
index 2f2bd10eed..3d7c6bb2de 100644
--- a/src/shell-window-tracker.c
+++ b/src/shell-window-tracker.c
@@ -65,7 +65,7 @@ static void set_focus_app (ShellWindowTracker *tracker,
ShellApp *new_focus_app);
static void on_focus_window_changed (MetaDisplay *display, GParamSpec *spec, ShellWindowTracker *tracker);
-static void track_window (ShellWindowTracker *tracker, MetaWindow *window);
+static ShellApp * track_window (ShellWindowTracker *tracker, MetaWindow *window);
static void disassociate_window (ShellWindowTracker *tracker, MetaWindow *window);
static ShellApp * shell_startup_sequence_get_app (MetaStartupSequence *sequence);
@@ -543,7 +543,7 @@ on_window_unmanaged (MetaWindow *window,
disassociate_window (SHELL_WINDOW_TRACKER (user_data), window);
}
-static void
+static ShellApp *
track_window (ShellWindowTracker *self,
MetaWindow *window)
{
@@ -551,7 +551,7 @@ track_window (ShellWindowTracker *self,
app = get_app_for_window (self, window);
if (!app)
- return;
+ return NULL;
/* At this point we've stored the association from window -> application */
g_hash_table_insert (self->window_to_app, window, app);
@@ -564,6 +564,8 @@ track_window (ShellWindowTracker *self,
_shell_app_add_window (app, window);
g_signal_emit (self, signals[TRACKED_WINDOWS_CHANGED], 0);
+
+ return app;
}
static void
@@ -582,7 +584,10 @@ shell_window_tracker_on_window_added (MetaWorkspace *workspace,
MetaWindow *window,
gpointer user_data)
{
- track_window (SHELL_WINDOW_TRACKER (user_data), window);
+ ShellWindowTracker *self = user_data;
+
+ if (!g_hash_table_contains (self->window_to_app, window))
+ track_window (self, window);
}
static void
@@ -656,9 +661,12 @@ on_find_app_info (MetaDisplay *display,
MetaWindow *window,
ShellWindowTracker *tracker)
{
- g_autoptr (ShellApp) app = NULL;
+ ShellApp *app;
+
+ app = g_hash_table_lookup (tracker->window_to_app, window);
+ if (!app)
+ app = track_window (tracker, window);
- app = get_app_for_window (tracker, window);
if (!app)
return NULL;
--
2.47.3

View File

@ -8,7 +8,7 @@
Name: gnome-shell
Version: 40.10
Release: 31%{?dist}
Release: 32%{?dist}
Summary: Window management and application launching for GNOME
License: GPLv2+
@ -76,6 +76,7 @@ Patch63: 0001-shell-window-tracker-Help-mutter-finding-app-info-s-.patch
Patch64: 0001-dnd-Don-t-leak-a-signal-connection.patch
Patch65: 0001-st-theme-Reuse-stylesheets-if-possible.patch
Patch66: 0001-Support-conflicting-session-dialog.patch
Patch67: 0001-shell-window-tracker-Track-windows-when-finding-app-.patch
%define eds_version 3.33.1
%define gnome_desktop_version 3.35.91
@ -305,6 +306,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/evolution-calendar.de
%endif
%changelog
* Thu Nov 27 2025 Jonas Ådahl <jadahl@redhat.com> - 40.10-32
- Avoid broken app instances with remote clients
Resolves: RHEL-68825
* Wed Oct 22 2025 Joan Torres <joantolo@redhat.com> - 40.10-31
- Don't fail if disable-show-password doesn't exist
Related: RHEL-109190