Add activedesktop to If
This commit is contained in:
parent
2b1a53cd73
commit
9614dd8da2
1 changed files with 11 additions and 7 deletions
|
@ -28,6 +28,7 @@ typedef struct {
|
||||||
gboolean desktop_current;
|
gboolean desktop_current;
|
||||||
gboolean desktop_other;
|
gboolean desktop_other;
|
||||||
guint desktop_number;
|
guint desktop_number;
|
||||||
|
guint screendesktop_number;
|
||||||
GPatternSpec *matchtitle;
|
GPatternSpec *matchtitle;
|
||||||
GSList *thenacts;
|
GSList *thenacts;
|
||||||
GSList *elseacts;
|
GSList *elseacts;
|
||||||
|
@ -100,13 +101,13 @@ static gpointer setup_func(xmlNodePtr node)
|
||||||
if ((n = obt_xml_find_node(node, "desktop"))) {
|
if ((n = obt_xml_find_node(node, "desktop"))) {
|
||||||
gchar *s;
|
gchar *s;
|
||||||
if ((s = obt_xml_node_string(n))) {
|
if ((s = obt_xml_node_string(n))) {
|
||||||
if (!g_ascii_strcasecmp(s, "current"))
|
if (!g_ascii_strcasecmp(s, "current"))
|
||||||
o->desktop_current = TRUE;
|
o->desktop_current = TRUE;
|
||||||
if (!g_ascii_strcasecmp(s, "other"))
|
if (!g_ascii_strcasecmp(s, "other"))
|
||||||
o->desktop_other = TRUE;
|
o->desktop_other = TRUE;
|
||||||
else
|
else
|
||||||
o->desktop_number = atoi(s);
|
o->desktop_number = atoi(s);
|
||||||
g_free(s);
|
g_free(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((n = obt_xml_find_node(node, "omnipresent"))) {
|
if ((n = obt_xml_find_node(node, "omnipresent"))) {
|
||||||
|
@ -114,6 +115,8 @@ static gpointer setup_func(xmlNodePtr node)
|
||||||
o->omnipresent_on = TRUE;
|
o->omnipresent_on = TRUE;
|
||||||
else
|
else
|
||||||
o->omnipresent_off = TRUE;
|
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"))) {
|
if ((n = obt_xml_find_node(node, "title"))) {
|
||||||
gchar *s;
|
gchar *s;
|
||||||
|
@ -197,6 +200,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
|
||||||
(c->desktop != DESKTOP_ALL))) &&
|
(c->desktop != DESKTOP_ALL))) &&
|
||||||
(!o->desktop_number || ((c->desktop == o->desktop_number - 1) ||
|
(!o->desktop_number || ((c->desktop == o->desktop_number - 1) ||
|
||||||
(c->desktop == DESKTOP_ALL))) &&
|
(c->desktop == DESKTOP_ALL))) &&
|
||||||
|
(!o->screendesktop_number || screen_desktop == o->screendesktop_number - 1) &&
|
||||||
(!o->matchtitle ||
|
(!o->matchtitle ||
|
||||||
(g_pattern_match_string(o->matchtitle, c->original_title))))
|
(g_pattern_match_string(o->matchtitle, c->original_title))))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue