summaryrefslogtreecommitdiff
path: root/src/core/prefs.c
diff options
context:
space:
mode:
authorIllia Danko <[email protected]>2016-10-28 19:27:37 +0300
committerraveit65 <[email protected]>2017-01-17 20:22:29 +0100
commit238373df58d4ba275b7aead36f4d47971fbed18d (patch)
tree975bdff6ecfd6f57bb1755afc6f36544f9532596 /src/core/prefs.c
parentfc8b044ed84265918f10674fc5a502bfada367bb (diff)
downloadmarco-238373df58d4ba275b7aead36f4d47971fbed18d.tar.bz2
marco-238373df58d4ba275b7aead36f4d47971fbed18d.tar.xz
Added functionality to ignore applications while show-desktop is triggered
Diffstat (limited to 'src/core/prefs.c')
-rw-r--r--src/core/prefs.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 8dd1008a..61c957ad 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -121,6 +121,7 @@ static gboolean show_tab_border = FALSE;
static gboolean center_new_windows = FALSE;
static gboolean force_fullscreen = TRUE;
static gboolean side_by_side_tiling = FALSE;
+static GList *show_desktop_skip_list = NULL;
static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH;
static MetaButtonLayout button_layout;
@@ -159,6 +160,7 @@ static void titlebar_handler (MetaPreference, const gchar*, gboolean*);
static void theme_name_handler (MetaPreference, const gchar*, gboolean*);
static void mouse_button_mods_handler (MetaPreference, const gchar*, gboolean*);
static void button_layout_handler (MetaPreference, const gchar*, gboolean*);
+static void show_desktop_skip_list_handler (MetaPreference, const gchar*, gboolean*);
static gboolean update_binding (MetaKeyPref *binding,
gchar *value);
@@ -467,6 +469,12 @@ static MetaStringPreference preferences_string[] =
NULL,
&cursor_theme,
},
+ { "show-desktop-skip-list",
+ KEY_GENERAL_SCHEMA,
+ META_PREF_SHOW_DESKTOP_SKIP_LIST,
+ &show_desktop_skip_list_handler,
+ NULL,
+ },
{ NULL, NULL, 0, NULL, NULL },
};
@@ -1085,6 +1093,18 @@ meta_prefs_get_cursor_size (void)
return cursor_size;
}
+gboolean
+meta_prefs_is_in_skip_list (char *class)
+{
+ GList *item;
+
+ for (item = show_desktop_skip_list; item; item = item->next)
+ {
+ if (!g_ascii_strcasecmp (class, item->data))
+ return TRUE;
+ }
+ return FALSE;
+}
/****************************************************************************/
/* Handlers for string preferences. */
@@ -1172,6 +1192,33 @@ mouse_button_mods_handler (MetaPreference pref,
}
}
+static void
+show_desktop_skip_list_handler (MetaPreference pref,
+ const gchar *string_value,
+ gboolean *inform_listeners)
+{
+ gchar **tokens;
+ gchar **tok;
+ GList *item;
+
+ if (show_desktop_skip_list)
+ {
+ for (item = show_desktop_skip_list; item; item = item->next)
+ g_free (item->data);
+ g_list_free (show_desktop_skip_list);
+ show_desktop_skip_list = NULL;
+ }
+
+ if (!(tokens = g_strsplit (string_value, ",", -1)))
+ return;
+ for (tok = tokens; tok && *tok; tok++)
+ {
+ gchar *stripped = g_strstrip (g_strdup (*tok));
+ show_desktop_skip_list = g_list_prepend (show_desktop_skip_list, stripped);
+ }
+ g_strfreev (tokens);
+}
+
static gboolean
button_layout_equal (const MetaButtonLayout *a,
const MetaButtonLayout *b)
@@ -1576,6 +1623,9 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_PLACEMENT_MODE:
return "PLACEMENT_MODE";
+
+ case META_PREF_SHOW_DESKTOP_SKIP_LIST:
+ return "SHOW_DESKTOP_SKIP_LIST";
}
return "(unknown)";