ShellWindowTracker: don't create ShellApps for non-interesting windows

If a process does not have any "interesting" windows, then it can't be
considered a running app. (Previously we were calling
get_app_for_window() before ruling out non-interesting windows, which
ended up calling _shell_app_new_for_window(), which would add the
window to the ShellApp directly, bypassing the is_interesting check.)

https://bugzilla.gnome.org/show_bug.cgi?id=642221
This commit is contained in:
Dan Winship 2011-03-09 08:58:27 -05:00
parent 0a3d80b86e
commit 43020b20b7

View File

@ -225,23 +225,6 @@ get_appid_from_window (MetaWindow *window)
return appid_guess; return appid_guess;
} }
/**
* window_is_tracked:
*
* We don't attempt to associate override-redirect windows with applications
* at all, since there's no reason to do so yet.
*
* Returns: %TRUE iff we want to scan this window for application association
*/
static gboolean
window_is_tracked (MetaWindow *window)
{
if (meta_window_is_override_redirect (window))
return FALSE;
return TRUE;
}
/** /**
* shell_window_tracker_is_window_interesting: * shell_window_tracker_is_window_interesting:
* *
@ -529,7 +512,7 @@ track_window (ShellWindowTracker *self,
{ {
ShellApp *app; ShellApp *app;
if (!window_is_tracked (window)) if (!shell_window_tracker_is_window_interesting (window))
return; return;
app = get_app_for_window (self, window); app = get_app_for_window (self, window);
@ -539,10 +522,6 @@ track_window (ShellWindowTracker *self,
/* At this point we've stored the association from window -> application */ /* At this point we've stored the association from window -> application */
g_hash_table_insert (self->window_to_app, window, app); g_hash_table_insert (self->window_to_app, window, app);
/* However, only put interesting windows in the window list for an app. */
if (!shell_window_tracker_is_window_interesting (window))
return;
if (shell_app_is_transient (app)) if (shell_app_is_transient (app))
{ {
/* For a transient application, it's possible one of our title regexps /* For a transient application, it's possible one of our title regexps