[gnome-shell] ShellApp: Ensure we set the size of returned texture for window backed apps



commit b9edb1dc018805136a625a4538538fdf1012a062
Author: Colin Walters <walters verbum org>
Date:   Thu Aug 11 05:56:00 2011 -0400

    ShellApp: Ensure we set the size of returned texture for window backed apps
    
    Unify the two code paths too.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=648149

 src/shell-app.c |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index 1ff9894..0d20f3a 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -123,6 +123,18 @@ window_backed_app_get_window (ShellApp     *app)
   return app->running_state->windows->data;
 }
 
+static ClutterActor *
+window_backed_app_get_icon (ShellApp *app,
+                            int       size)
+{
+  MetaWindow *window = window_backed_app_get_window (app);
+  ClutterActor *actor = st_texture_cache_bind_pixbuf_property (st_texture_cache_get_default (),
+                                                               G_OBJECT (window),
+                                                               "icon");
+  g_object_set (actor, "width", (float) size, "height", (float) size, NULL);
+  return actor;
+}
+
 /**
  * shell_app_create_icon_texture:
  *
@@ -141,12 +153,7 @@ shell_app_create_icon_texture (ShellApp   *app,
   ret = NULL;
 
   if (app->entry == NULL)
-    {
-      MetaWindow *window = window_backed_app_get_window (app);
-      return st_texture_cache_bind_pixbuf_property (st_texture_cache_get_default (),
-                                                    G_OBJECT (window),
-                                                    "icon");
-    }
+    return window_backed_app_get_icon (app, size);
 
   icon = g_app_info_get_icon (G_APP_INFO (gmenu_tree_entry_get_app_info (app->entry)));
   if (icon != NULL)
@@ -285,13 +292,7 @@ shell_app_get_faded_icon (ShellApp *app, int size)
    * app-tracked from not.
    */
   if (!app->entry)
-    {
-      MetaWindow *window = window_backed_app_get_window (app);
-      return st_texture_cache_bind_pixbuf_property (st_texture_cache_get_default (),
-                                                    G_OBJECT (window),
-                                                    "icon");
-    }
-    
+    return window_backed_app_get_icon (app, size);
 
   cache_key = g_strdup_printf ("faded-icon:%s,size=%d", shell_app_get_id (app), size);
   data.app = app;



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