<!--
# this is an example with comments through out. use these to make your
# own rules, but without the comments of course.
- # you may use one or more of the name/class/role/type rules to specify
+ # you may use one or more of the name/class/role/title/type rules to specify
# windows to match
<application name="the window's _OB_APP_NAME property (see obxprop)"
class="the window's _OB_APP_CLASS property (see obxprop)"
role="the window's _OB_APP_ROLE property (see obxprop)"
+ title="the window's _OB_APP_TITLE property (see obxprop)"
type="the window's _OB_APP_TYPE property (see obxprob)..
(if unspecified, then it is 'dialog' for child windows)">
- # you may set only one of name/class/role/type, or you may use more than one
- # together to restrict your matches.
+ # you may set only one of name/class/role/title/type, or you may use more
+ # than one together to restrict your matches.
- # the name, class, and role use simple wildcard matching such as those
+ # the name, class, role, and title use simple wildcard matching such as those
# used by a shell. you can use * to match any characters and ? to match
# any single character.
<xsd:element minOccurs="0" name="fullscreen" type="ob:bool"/>
<xsd:element minOccurs="0" name="maximized" type="ob:maximization"/>
</xsd:all>
+ <!-- at least one of these must be present -->
<xsd:attribute name="role" type="xsd:string"/>
+ <xsd:attribute name="title" type="xsd:string"/>
<xsd:attribute name="type" type="ob:clienttype"/>
- <!-- at least one of these must be present -->
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="class" type="xsd:string"/>
</xsd:complexType>
CREATE_(OB_CONTROL);
CREATE_(OB_VERSION);
CREATE_(OB_APP_ROLE);
+ CREATE_(OB_APP_TITLE);
CREATE_(OB_APP_NAME);
CREATE_(OB_APP_CLASS);
CREATE_(OB_APP_TYPE);
OBT_PROP_OB_CONTROL,
OBT_PROP_OB_VERSION,
OBT_PROP_OB_APP_ROLE,
+ OBT_PROP_OB_APP_TITLE,
OBT_PROP_OB_APP_NAME,
OBT_PROP_OB_APP_CLASS,
OBT_PROP_OB_APP_TYPE,
ob_debug("Window type: %d", self->type);
ob_debug("Window group: 0x%x", self->group?self->group->leader:0);
- ob_debug("Window name: %s class: %s role: %s", self->name, self->class, self->role);
+ ob_debug("Window name: %s class: %s role: %s title: %s",
+ self->name, self->class, self->role, self->title);
/* per-app settings override stuff from client_get_all, and return the
settings for other uses too. the returned settings is a shallow copy,
gboolean match = TRUE;
g_assert(app->name != NULL || app->class != NULL ||
- app->role != NULL || (signed)app->type >= 0);
+ app->role != NULL || app->title != NULL ||
+ (signed)app->type >= 0);
if (app->name &&
!g_pattern_match(app->name, strlen(self->name), self->name, NULL))
!g_pattern_match(app->role,
strlen(self->role), self->role, NULL))
match = FALSE;
+ else if (app->title &&
+ !g_pattern_match(app->title,
+ strlen(self->title), self->title, NULL))
+ match = FALSE;
else if ((signed)app->type >= 0 && app->type != self->type) {
match = FALSE;
}
from per-app settings */
client_get_session_ids(self);
- /* save the values of the variables used for app rule matching */
- client_save_app_rule_values(self);
-
/* now we got everything that can affect the decorations */
if (!real)
return;
/* get this early so we have it for debugging */
client_update_title(self);
+ /* save the values of the variables used for app rule matching */
+ client_save_app_rule_values(self);
+
client_update_protocols(self);
client_update_wmhints(self);
OBT_PROP_SETS(self->window, OB_APP_ROLE, utf8, self->role);
OBT_PROP_SETS(self->window, OB_APP_NAME, utf8, self->name);
OBT_PROP_SETS(self->window, OB_APP_CLASS, utf8, self->class);
+ OBT_PROP_SETS(self->window, OB_APP_TITLE, utf8, self->original_title);
switch (self->type) {
case OB_CLIENT_TYPE_NORMAL:
static void parse_per_app_settings(xmlNodePtr node, gpointer d)
{
xmlNodePtr app = obt_xml_find_node(node->children, "application");
- gchar *name = NULL, *class = NULL, *role = NULL, *type_str = NULL;
- gboolean name_set, class_set, type_set, role_set;
+ gchar *name = NULL, *class = NULL, *role = NULL, *title = NULL,
+ *type_str = NULL;
+ gboolean name_set, class_set, type_set, role_set, title_set;
ObClientType type;
gboolean x_pos_given;
name_set = obt_xml_attr_string(app, "name", &name);
type_set = obt_xml_attr_string(app, "type", &type_str);
role_set = obt_xml_attr_string(app, "role", &role);
+ title_set = obt_xml_attr_string(app, "title", &title);
/* validate the type tho */
if (type_set) {
type_set = FALSE; /* not valid! */
}
- if (class_set || name_set || role_set || type_set) {
+ if (class_set || name_set || role_set || title_set || type_set) {
xmlNodePtr n, c;
ObAppSettings *settings = config_create_app_settings();;
if (role_set)
settings->role = g_pattern_spec_new(role);
+ if (title_set)
+ settings->title = g_pattern_spec_new(title);
+
if (type_set)
settings->type = type;
g_free(name);
g_free(class);
g_free(role);
- name = class = role = NULL;
+ g_free(title);
+ name = class = role = title = NULL;
}
app = obt_xml_find_node(app->next, "application");
ObAppSettings *itd = (ObAppSettings *)it->data;
if (itd->name) g_pattern_spec_free(itd->name);
if (itd->role) g_pattern_spec_free(itd->role);
+ if (itd->title) g_pattern_spec_free(itd->title);
if (itd->class) g_pattern_spec_free(itd->class);
g_free(it->data);
}
GPatternSpec *class;
GPatternSpec *name;
GPatternSpec *role;
+ GPatternSpec *title;
ObClientType type;
GravityPoint position;
supported[i++] = OBT_PROP_ATOM(OB_CONTROL);
supported[i++] = OBT_PROP_ATOM(OB_VERSION);
supported[i++] = OBT_PROP_ATOM(OB_APP_ROLE);
+ supported[i++] = OBT_PROP_ATOM(OB_APP_TITLE);
supported[i++] = OBT_PROP_ATOM(OB_APP_NAME);
supported[i++] = OBT_PROP_ATOM(OB_APP_CLASS);
supported[i++] = OBT_PROP_ATOM(OB_APP_TYPE);