[metacity/matching] split out role finding



commit 7dec05b7341261457b65f0cf35337e7551e4153c
Author: Thomas Thurman <tthurman gnome org>
Date:   Fri Jul 10 08:11:47 2009 -0400

    split out role finding

 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 5a001e6..619e532 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]