[windowTracker] Only remove "interesting" windows
Windows are only added to an application if they are considered "interesting". If we keep it that way, we cannot unconditionally call _shell_app_remove_window() - applications without interesting windows are not considered running, so the call crashes the shell. https://bugzilla.gnome.org/show_bug.cgi?id=622236
This commit is contained in:
parent
04ecde9f8e
commit
4b1fea2fa4
@ -757,12 +757,11 @@ void
|
|||||||
_shell_app_remove_window (ShellApp *app,
|
_shell_app_remove_window (ShellApp *app,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
g_assert (app->running_state != NULL);
|
||||||
|
|
||||||
if (!g_slist_find (app->running_state->windows, window))
|
if (!g_slist_find (app->running_state->windows, window))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_assert (app->running_state != NULL);
|
|
||||||
|
|
||||||
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_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_user_time_changed), app);
|
||||||
g_object_unref (window);
|
g_object_unref (window);
|
||||||
|
@ -542,6 +542,7 @@ disassociate_window (ShellWindowTracker *self,
|
|||||||
|
|
||||||
g_hash_table_remove (self->window_to_app, window);
|
g_hash_table_remove (self->window_to_app, window);
|
||||||
|
|
||||||
|
if (shell_window_tracker_is_window_interesting (window))
|
||||||
_shell_app_remove_window (app, window);
|
_shell_app_remove_window (app, window);
|
||||||
|
|
||||||
g_signal_emit (self, signals[TRACKED_WINDOWS_CHANGED], 0);
|
g_signal_emit (self, signals[TRACKED_WINDOWS_CHANGED], 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user