shell/window-tracker: Track windows getting unmanaged

It makes sense to not rely on workspaces' ::window-removed
signal, and we already do that in ShellApp.

However it is odd to remove a tracked window from the app,
but still track it in the window tracker. Move the code
to remove unmanaged windows from both.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4751

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2029>
This commit is contained in:
Florian Müllner
2021-11-16 20:52:11 +01:00
parent 4f91cfb5a6
commit f8e531b52d
2 changed files with 9 additions and 9 deletions

View File

@ -942,13 +942,6 @@ shell_app_state_transition (ShellApp *app,
g_object_notify (G_OBJECT (app), "state");
}
static void
shell_app_on_unmanaged (MetaWindow *window,
ShellApp *app)
{
_shell_app_remove_window (app, window);
}
static void
shell_app_on_user_time_changed (MetaWindow *window,
GParamSpec *pspec,
@ -1115,7 +1108,6 @@ _shell_app_add_window (ShellApp *app,
app->running_state->window_sort_stale = TRUE;
app->running_state->windows = g_slist_prepend (app->running_state->windows, g_object_ref (window));
g_signal_connect_object (window, "unmanaged", G_CALLBACK(shell_app_on_unmanaged), app, 0);
g_signal_connect_object (window, "notify::user-time", G_CALLBACK(shell_app_on_user_time_changed), app, 0);
g_signal_connect_object (window, "notify::skip-taskbar", G_CALLBACK(shell_app_on_skip_taskbar_changed), app, 0);
@ -1144,7 +1136,6 @@ _shell_app_remove_window (ShellApp *app,
if (!g_slist_find (app->running_state->windows, window))
return;
g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_unmanaged), app);
g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_user_time_changed), app);
g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_skip_taskbar_changed), app);
app->running_state->windows = g_slist_remove (app->running_state->windows, window);