window-tracker: Always enable transient_for redirection

It is possible to associate an application's window with a different
application using the transient_for hint. However we currently only
consider the hint in get_window_app() and not when making the original
association, which opens the door to some confusing inconsistencies;
for instance, get_window_app() will not necessarily return the same
value for all windows retrieved via shell_app_get_windows().
Fix this by looking at the transient_for hint when making the original
association, not just in get_window_app().

https://bugzilla.gnome.org/show_bug.cgi?id=722434
This commit is contained in:
Florian Müllner 2014-01-17 10:54:13 -05:00
parent 1118cf1810
commit 6b34937ead

View File

@ -384,8 +384,13 @@ get_app_for_window (ShellWindowTracker *tracker,
MetaWindow *window)
{
ShellApp *result = NULL;
MetaWindow *transient_for;
const char *startup_id;
transient_for = meta_window_get_transient_for (window);
if (transient_for != NULL)
return get_app_for_window (tracker, transient_for);
/* First, we check whether we already know about this window,
* if so, just return that.
*/
@ -681,13 +686,8 @@ ShellApp *
shell_window_tracker_get_window_app (ShellWindowTracker *tracker,
MetaWindow *metawin)
{
MetaWindow *transient_for;
ShellApp *app;
transient_for = meta_window_get_transient_for (metawin);
if (transient_for != NULL)
metawin = transient_for;
app = g_hash_table_lookup (tracker->window_to_app, metawin);
if (app)
g_object_ref (app);