diff options
author | Thomas Thurman <tthurman@gnome.org> | 2009-07-10 08:11:47 -0400 |
---|---|---|
committer | Thomas Thurman <tthurman@gnome.org> | 2009-07-10 08:11:47 -0400 |
commit | 7dec05b7341261457b65f0cf35337e7551e4153c (patch) | |
tree | 8e27e84d6f877151ac2058e7111ce627fcc9ed77 | |
parent | af0cf76df3eea6d6857a07a0193fd5bd0234c75e (diff) | |
download | metacity-7dec05b7341261457b65f0cf35337e7551e4153c.tar.gz |
split out role finding
-rw-r--r-- | src/core/matching.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/matching.c b/src/core/matching.c index 5a001e63..619e532b 100644 --- a/src/core/matching.c +++ b/src/core/matching.c @@ -41,6 +41,17 @@ load_matching_data (void) /* FIXME: would be helpful to add a leading comment */ } +static gchar* +get_window_role (MetaWindow *window) +{ + if (window->role) + return window->role; + else if (window->title) /* hacky fallback */ + return window->title; + else /* give up */ + return NULL; +} + void meta_matching_load_from_role (MetaWindow *window) { @@ -53,10 +64,7 @@ void meta_matching_save_to_role (MetaWindow *window) { gint x, y, w, h; - gchar *role = window->role; - - if (!role) /* hacky fallback */ - role = window->title; + gchar *role = get_window_role (window); if (!role) return; |