X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fif.c;h=a99435272ad27d82b2687b1aaa69d09b47978c83;hb=9614dd8da2cd34475d84bf9b5366f6e73481ca6c;hp=28010d388b43b0479417bdb1c2d188528a03de29;hpb=46ca54fd81096b466e51eace79d0761b2c4923f7;p=chaz%2Fopenbox diff --git a/openbox/actions/if.c b/openbox/actions/if.c index 28010d38..a9943527 100644 --- a/openbox/actions/if.c +++ b/openbox/actions/if.c @@ -28,6 +28,7 @@ typedef struct { gboolean desktop_current; gboolean desktop_other; guint desktop_number; + guint screendesktop_number; GPatternSpec *matchtitle; GSList *thenacts; GSList *elseacts; @@ -98,19 +99,24 @@ static gpointer setup_func(xmlNodePtr node) o->decor_on = TRUE; } if ((n = obt_xml_find_node(node, "desktop"))) { - gchar *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); + 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 ((n = obt_xml_find_node(node, "omnipresent"))) { if (obt_xml_node_bool(n)) o->omnipresent_on = TRUE; else o->omnipresent_off = TRUE; + if ((n = obt_xml_find_node(node, "activedesktop"))) { + o->screendesktop_number = obt_xml_node_int(n); } if ((n = obt_xml_find_node(node, "title"))) { gchar *s; @@ -194,6 +200,7 @@ static gboolean run_func(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)))) {