Change "plain" to "exact" for If's <title>

This commit is contained in:
Mikael Magnusson 2013-08-11 19:26:52 +02:00 committed by Dana Jansens
parent eae7a57088
commit 7c4fae0312
2 changed files with 8 additions and 8 deletions

View file

@ -15,7 +15,7 @@
* Correctly interface with latest gnome-session for Gnome/Openbox X sessions. * Correctly interface with latest gnome-session for Gnome/Openbox X sessions.
* Allow third-party control of window opacity in compositing managers. * Allow third-party control of window opacity in compositing managers.
* Improved themeing options. Contributed by Dave Foster. * Improved themeing options. Contributed by Dave Foster.
* Add <monitor>, <title type="regex">, <title type="plain"> and * Add <monitor>, <title type="regex">, <title type="exact"> and
<activedesktop> options to If action. <activedesktop> options to If action.
* Addresses bugs #4661, #5506, #5186, #5758, #5410, #5228, #5277, #5731, * Addresses bugs #4661, #5506, #5186, #5758, #5410, #5228, #5277, #5731,
#5746, #5737, #5419, #5721, #5711, #5385, #5500, #4992, #5443, #5518, #5746, #5737, #5419, #5721, #5711, #5385, #5500, #4992, #5443, #5518,

View file

@ -32,7 +32,7 @@ typedef struct {
guint client_monitor; guint client_monitor;
GPatternSpec *matchtitle; GPatternSpec *matchtitle;
GRegex *regextitle; GRegex *regextitle;
gchar *plaintitle; gchar *exacttitle;
GSList *thenacts; GSList *thenacts;
GSList *elseacts; GSList *elseacts;
} Options; } Options;
@ -102,8 +102,8 @@ static gpointer setup_func(xmlNodePtr node)
o->matchtitle = g_pattern_spec_new(s); o->matchtitle = g_pattern_spec_new(s);
} else if (type && !g_ascii_strcasecmp(type, "regex")) { } else if (type && !g_ascii_strcasecmp(type, "regex")) {
o->regextitle = g_regex_new(s, 0, 0, NULL); o->regextitle = g_regex_new(s, 0, 0, NULL);
} else if (type && !g_ascii_strcasecmp(type, "plain")) { } else if (type && !g_ascii_strcasecmp(type, "exact")) {
o->plaintitle = g_strdup(s); o->exacttitle = g_strdup(s);
} }
g_free(s); g_free(s);
} }
@ -152,8 +152,8 @@ static void free_func(gpointer options)
g_pattern_spec_free(o->matchtitle); g_pattern_spec_free(o->matchtitle);
if (o->regextitle) if (o->regextitle)
g_regex_unref(o->regextitle); g_regex_unref(o->regextitle);
if (o->plaintitle) if (o->exacttitle)
g_free(o->plaintitle); g_free(o->exacttitle);
g_slice_free(Options, o); g_slice_free(Options, o);
} }
@ -195,8 +195,8 @@ static gboolean run_func(ObActionsData *data, gpointer options)
(g_pattern_match_string(o->matchtitle, c->original_title))) && (g_pattern_match_string(o->matchtitle, c->original_title))) &&
(!o->regextitle || (!o->regextitle ||
(g_regex_match(o->regextitle, c->original_title, 0, NULL))) && (g_regex_match(o->regextitle, c->original_title, 0, NULL))) &&
(!o->plaintitle || (!o->exacttitle ||
(!strcmp(o->plaintitle, c->original_title))) && (!strcmp(o->exacttitle, c->original_title))) &&
(!o->client_monitor || (!o->client_monitor ||
(o->client_monitor == client_monitor(c) + 1))) (o->client_monitor == client_monitor(c) + 1)))
{ {