[metacity] prefs: add alt-tab-thumbnails preference



commit cdc5bf4621ec4ef5931a4c1e8522e6ad62da6a45
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Feb 19 02:07:02 2015 +0200

    prefs: add alt-tab-thumbnails preference

 src/core/prefs.c                      |   18 ++++++++++++++++++
 src/core/screen.c                     |    5 ++++-
 src/include/prefs.h                   |    5 ++++-
 src/org.gnome.metacity.gschema.xml.in |    8 ++++++++
 4 files changed, 34 insertions(+), 2 deletions(-)
---
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 1e197ab..49fa86c 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -90,6 +90,7 @@ static gboolean compositing_manager = FALSE;
 static gboolean resize_with_right_button = FALSE;
 static gboolean edge_tiling = FALSE;
 static gboolean force_fullscreen = TRUE;
+static gboolean alt_tab_thumbnails = FALSE;
 
 static GDesktopVisualBellType visual_bell_type = G_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH;
 static MetaButtonLayout button_layout;
@@ -354,6 +355,14 @@ static MetaBoolPreference preferences_bool[] =
       &edge_tiling,
       FALSE,
     },
+    {
+      { "alt-tab-thumbnails",
+        SCHEMA_METACITY,
+        META_PREF_ALT_TAB_THUMBNAILS,
+      },
+      &alt_tab_thumbnails,
+      FALSE,
+    },
     { { NULL, 0, 0 }, NULL, FALSE },
   };
 
@@ -1422,6 +1431,9 @@ meta_preference_to_string (MetaPreference pref)
 
     case META_PREF_PLACEMENT_MODE:
       return "PLACEMENT_MODE";
+
+    case META_PREF_ALT_TAB_THUMBNAILS:
+      return "ALT_TAB_THUMBNAILS";
     }
 
   return "(unknown)";
@@ -1844,6 +1856,12 @@ meta_prefs_get_placement_mode (void)
   return placement_mode;
 }
 
+gboolean
+meta_prefs_get_alt_tab_thumbnails (void)
+{
+  return alt_tab_thumbnails;
+}
+
 void
 meta_prefs_set_compositing_manager (gboolean whether)
 {
diff --git a/src/core/screen.c b/src/core/screen.c
index 8384dd0..a3db88c 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -1294,7 +1294,10 @@ meta_screen_ensure_tab_popup (MetaScreen      *screen,
       entries[i].key = (MetaTabEntryKey) window->xwindow;
       entries[i].title = window->title;
 
-      win_pixbuf = get_window_pixbuf (window, &width, &height);
+      win_pixbuf = NULL;
+      if (meta_prefs_get_alt_tab_thumbnails ())
+        win_pixbuf = get_window_pixbuf (window, &width, &height);
+
       if (win_pixbuf == NULL)
         entries[i].icon = g_object_ref (window->icon);
       else
diff --git a/src/include/prefs.h b/src/include/prefs.h
index ba57be0..b03557e 100644
--- a/src/include/prefs.h
+++ b/src/include/prefs.h
@@ -60,7 +60,8 @@ typedef enum
   META_PREF_RESIZE_WITH_RIGHT_BUTTON,
   META_PREF_EDGE_TILING,
   META_PREF_FORCE_FULLSCREEN,
-  META_PREF_PLACEMENT_MODE
+  META_PREF_PLACEMENT_MODE,
+  META_PREF_ALT_TAB_THUMBNAILS
 } MetaPreference;
 
 typedef enum
@@ -128,6 +129,8 @@ gboolean    meta_prefs_get_force_fullscreen  (void);
 
 MetaPlacementMode meta_prefs_get_placement_mode (void);
 
+gboolean    meta_prefs_get_alt_tab_thumbnails (void);
+
 /**
  * Sets whether the compositor is turned on.
  *
diff --git a/src/org.gnome.metacity.gschema.xml.in b/src/org.gnome.metacity.gschema.xml.in
index 430af80..8f0fc6c 100644
--- a/src/org.gnome.metacity.gschema.xml.in
+++ b/src/org.gnome.metacity.gschema.xml.in
@@ -54,6 +54,14 @@
         their workspaces.
       </_description>
     </key>
+    <key name="alt-tab-thumbnails" type="b">
+      <default>false</default>
+      <_summary>Show window content thumbnail in alt-tab</_summary>
+      <_description>
+        If set to true Metacity will show window content thumbnails in alt-tab
+        window instead of only icons.
+      </_description>
+    </key>
   </schema>
 
 </schemalist>


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