diff --git a/src/shell-app.c b/src/shell-app.c index f9ddd2b31..24362394b 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -1300,24 +1300,6 @@ shell_app_request_quit (ShellApp *app) return TRUE; } -static void -_gather_pid_callback (GDesktopAppInfo *gapp, - GPid pid, - gpointer data) -{ - ShellApp *app; - ShellWindowTracker *tracker; - - g_return_if_fail (data != NULL); - - app = SHELL_APP (data); - tracker = shell_window_tracker_get_default (); - - _shell_window_tracker_add_child_process_app (tracker, - pid, - app); -} - #ifdef HAVE_SYSTEMD /* This sets up the launched application to log to the journal * using its own identifier, instead of just "gnome-session". @@ -1369,13 +1351,13 @@ shell_app_launch (ShellApp *app, ret = g_desktop_app_info_launch_uris_as_manager (app->info, NULL, context, - G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, + G_SPAWN_SEARCH_PATH, #ifdef HAVE_SYSTEMD app_child_setup, (gpointer)shell_app_get_id (app), #else NULL, NULL, #endif - _gather_pid_callback, app, + NULL, NULL, error); g_object_unref (context); diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index deef1b46f..a4d804df0 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -47,9 +47,6 @@ struct _ShellWindowTracker /* */ GHashTable *window_to_app; - - /* */ - GHashTable *launched_pid_to_app; }; G_DEFINE_TYPE (ShellWindowTracker, shell_window_tracker, G_TYPE_OBJECT); @@ -631,8 +628,6 @@ shell_window_tracker_init (ShellWindowTracker *self) self->window_to_app = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) g_object_unref); - self->launched_pid_to_app = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_object_unref); - screen = shell_global_get_screen (shell_global_get ()); g_signal_connect (G_OBJECT (screen), "startup-sequence-changed", @@ -648,7 +643,6 @@ shell_window_tracker_finalize (GObject *object) ShellWindowTracker *self = SHELL_WINDOW_TRACKER (object); g_hash_table_destroy (self->window_to_app); - g_hash_table_destroy (self->launched_pid_to_app); G_OBJECT_CLASS (shell_window_tracker_parent_class)->finalize(object); } @@ -717,40 +711,6 @@ shell_window_tracker_get_app_from_pid (ShellWindowTracker *tracker, return result; } -static void -on_child_exited (GPid pid, - gint status, - gpointer unused_data) -{ - ShellWindowTracker *tracker; - - tracker = shell_window_tracker_get_default (); - - g_hash_table_remove (tracker->launched_pid_to_app, GINT_TO_POINTER((gint)pid)); -} - -void -_shell_window_tracker_add_child_process_app (ShellWindowTracker *tracker, - GPid pid, - ShellApp *app) -{ - gpointer pid_ptr = GINT_TO_POINTER((int)pid); - - if (g_hash_table_lookup (tracker->launched_pid_to_app, - &pid_ptr)) - return; - - g_hash_table_insert (tracker->launched_pid_to_app, - pid_ptr, - g_object_ref (app)); - g_child_watch_add (pid, on_child_exited, NULL); - /* TODO: rescan unassociated windows - * Unlikely in practice that the launched app gets ahead of us - * enough to map an X window before we get scheduled after the fork(), - * but adding this note for future reference. - */ -} - static void set_focus_app (ShellWindowTracker *tracker, ShellApp *new_focus_app)