window-tracker: remove now unused launched_pid_to_app

https://bugzilla.gnome.org/show_bug.cgi?id=736527
This commit is contained in:
Sebastian Keller
2014-12-08 20:12:03 +01:00
committed by Jasper St. Pierre
parent 186f9b2e2c
commit 01c6392c13
2 changed files with 2 additions and 60 deletions

View File

@ -47,9 +47,6 @@ struct _ShellWindowTracker
/* <MetaWindow * window, ShellApp *app> */
GHashTable *window_to_app;
/* <int, ShellApp *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)