summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/prefs.c38
-rw-r--r--src/core/screen.c8
-rw-r--r--src/include/prefs.h4
-rw-r--r--src/marco.schemas.in.in15
4 files changed, 64 insertions, 1 deletions
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 5b546f57..816c80f0 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -50,6 +50,7 @@
#define KEY_TITLEBAR_FONT "/apps/marco/general/titlebar_font"
#define KEY_NUM_WORKSPACES "/apps/marco/general/num_workspaces"
#define KEY_COMPOSITOR "/apps/marco/general/compositing_manager"
+#define KEY_COMPOSITOR_FAST_ALT_TAB "/apps/marco/general/compositing_fast_alt_tab"
#define KEY_MATE_ACCESSIBILITY "/desktop/mate/interface/accessibility"
#define KEY_COMMAND_DIRECTORY "/apps/marco/keybinding_commands"
@@ -97,6 +98,7 @@ static gboolean mate_animations = TRUE;
static char *cursor_theme = NULL;
static int cursor_size = 24;
static gboolean compositing_manager = FALSE;
+static gboolean compositing_fast_alt_tab = FALSE;
static gboolean resize_with_right_button = FALSE;
static gboolean force_fullscreen = TRUE;
@@ -421,6 +423,11 @@ static MetaBoolPreference preferences_bool[] =
&compositing_manager,
FALSE,
},
+ { "/apps/marco/general/compositing_fast_alt_tab",
+ META_PREF_COMPOSITING_FAST_ALT_TAB,
+ &compositing_fast_alt_tab,
+ FALSE,
+ },
{ "/apps/marco/general/resize_with_right_button",
META_PREF_RESIZE_WITH_RIGHT_BUTTON,
&resize_with_right_button,
@@ -1775,6 +1782,9 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_COMPOSITING_MANAGER:
return "COMPOSITING_MANAGER";
+ case META_PREF_COMPOSITING_FAST_ALT_TAB:
+ return "COMPOSITING_FAST_ALT_TAB";
+
case META_PREF_RESIZE_WITH_RIGHT_BUTTON:
return "RESIZE_WITH_RIGHT_BUTTON";
@@ -2730,6 +2740,12 @@ meta_prefs_get_compositing_manager (void)
return compositing_manager;
}
+gboolean
+meta_prefs_get_compositing_fast_alt_tab(void)
+{
+ return compositing_fast_alt_tab;
+}
+
guint
meta_prefs_get_mouse_button_resize (void)
{
@@ -2770,6 +2786,28 @@ meta_prefs_set_compositing_manager (gboolean whether)
#endif
}
+void
+meta_prefs_set_compositing_fast_alt_tab(gboolean whether)
+{
+#ifdef HAVE_MATECONF
+ GError *err = NULL;
+
+ mateconf_client_set_bool (default_client,
+ KEY_COMPOSITOR_FAST_ALT_TAB,
+ whether,
+ &err);
+
+ if (err)
+ {
+ meta_warning (_("Error setting compositor fast alt-tab status: %s\n"),
+ err->message);
+ g_error_free (err);
+ }
+#else
+ compositing_fast_alt_tab = whether;
+#endif
+}
+
#ifndef HAVE_MATECONF
static void
init_button_layout(void)
diff --git a/src/core/screen.c b/src/core/screen.c
index f9db9c71..9c3e2b1f 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -1280,7 +1280,13 @@ 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);
+ /* Only get the pixbuf if the user does NOT have
+ /apps/marco/general/compositing_fast_alt_tab set to true
+ in mateconf. There is an obvious lag when the pixbuf is
+ retrieved. */
+ if (!meta_prefs_get_compositing_fast_alt_tab())
+ 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 58814130..e2179595 100644
--- a/src/include/prefs.h
+++ b/src/include/prefs.h
@@ -60,6 +60,7 @@ typedef enum
META_PREF_CURSOR_THEME,
META_PREF_CURSOR_SIZE,
META_PREF_COMPOSITING_MANAGER,
+ META_PREF_COMPOSITING_FAST_ALT_TAB,
META_PREF_RESIZE_WITH_RIGHT_BUTTON,
META_PREF_FORCE_FULLSCREEN
} MetaPreference;
@@ -117,6 +118,7 @@ void meta_prefs_change_workspace_name (int i,
const char* meta_prefs_get_cursor_theme (void);
int meta_prefs_get_cursor_size (void);
gboolean meta_prefs_get_compositing_manager (void);
+gboolean meta_prefs_get_compositing_fast_alt_tab (void);
gboolean meta_prefs_get_force_fullscreen (void);
/**
@@ -126,6 +128,8 @@ gboolean meta_prefs_get_force_fullscreen (void);
*/
void meta_prefs_set_compositing_manager (gboolean whether);
+void meta_prefs_set_compositing_fast_alt_tab (gboolean whether);
+
void meta_prefs_set_force_fullscreen (gboolean whether);
/* XXX FIXME This should be x-macroed, but isn't yet because it would be
diff --git a/src/marco.schemas.in.in b/src/marco.schemas.in.in
index ca03ab70..818ba47c 100644
--- a/src/marco.schemas.in.in
+++ b/src/marco.schemas.in.in
@@ -397,6 +397,21 @@
</schema>
<schema>
+ <key>/schemas/apps/marco/general/compositing_fast_alt_tab</key>
+ <applyto>/apps/marco/general/compositing_fast_alt_tab</applyto>
+ <owner>marco</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Fast Alt-Tab Enabled</short>
+ <long>
+ Whether or not fast alt-tabbing is used when the compositing
+ manager is enabled.
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/marco/workspace_names/name</key>
<applyto>/apps/marco/workspace_names/name_1</applyto>
<applyto>/apps/marco/workspace_names/name_2</applyto>