From: Mikael Magnusson Date: Sat, 9 Oct 2010 22:41:10 +0000 (+0200) Subject: Add screendesktop to If X-Git-Tag: mikabox-3.5-7~32 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=90626ad7c4a88aabecfd3c9aa060b1605f5b5885;p=mikachu%2Fopenbox.git Add screendesktop to If Conflicts: openbox/actions/if.c --- diff --git a/openbox/actions/if.c b/openbox/actions/if.c index 68beb9f8..6ac25409 100644 --- a/openbox/actions/if.c +++ b/openbox/actions/if.c @@ -30,6 +30,7 @@ typedef struct { gboolean desktop_current; gboolean desktop_other; guint desktop_number; + guint screendesktop_number; GPatternSpec *matchtitle; GRegex *regextitle; GSList *thenacts; @@ -119,13 +120,13 @@ static gpointer setup_func(xmlNodePtr node) if ((n = obt_xml_find_node(node, "desktop"))) { gchar *s; if ((s = obt_xml_node_string(n))) { - if (!g_ascii_strcasecmp(s, "current")) - o->desktop_current = TRUE; - if (!g_ascii_strcasecmp(s, "other")) - o->desktop_other = TRUE; - else - o->desktop_number = atoi(s); - g_free(s); + if (!g_ascii_strcasecmp(s, "current")) + o->desktop_current = TRUE; + if (!g_ascii_strcasecmp(s, "other")) + o->desktop_other = TRUE; + else + o->desktop_number = atoi(s); + g_free(s); } } if ((n = obt_xml_find_node(node, "omnipresent"))) { @@ -133,6 +134,12 @@ static gpointer setup_func(xmlNodePtr node) o->omnipresent_on = TRUE; else o->omnipresent_off = TRUE; + if ((n = obt_xml_find_node(node, "screendesktop"))) { + gchar *s; + if ((s = obt_xml_node_string(n))) { + o->screendesktop_number = atoi(s); + g_free(s); + } } if ((n = obt_xml_find_node(node, "title"))) { gchar *s; @@ -227,6 +234,7 @@ static gboolean run_func_if(ObActionsData *data, gpointer options) (c->desktop != DESKTOP_ALL))) && (!o->desktop_number || ((c->desktop == o->desktop_number - 1) || (c->desktop == DESKTOP_ALL))) && + (!o->screendesktop_number || screen_desktop == o->screendesktop_number - 1) && (!o->matchtitle || (g_pattern_match_string(o->matchtitle, c->original_title))) && (!o->regextitle ||