<application name="first element of window's WM_CLASS property (see xprop)"
class="second element of window's WM_CLASS property (see xprop)"
- role="the window's WM_WINDOW_ROLE property (see xprop)">
+ role="the window's WM_WINDOW_ROLE property (see xprop)"
+ type="the window's _NET_WM_WINDOW_TYPE (if unspecified, then
+ it is dialog for child windows)">
# the name or the class can be set, or both. this is used to match
# windows when they appear. role can optionally be set as well, to
# further restrict your matches.
# used by a shell. you can use * to match any characters and ? to match
# any single character.
+ # the type is one of: normal, dialog, splash, utility, menu, toolbar, dock,
+ # or desktop
+
# when multiple rules match a window, they will all be applied, in the
# order that they appear in this list
<xsd:element minOccurs="0" name="skip_taskbar" type="ob:bool"/>
<xsd:element minOccurs="0" name="fullscreen" type="ob:bool"/>
<xsd:element minOccurs="0" name="maximized" type="ob:maximization"/>
+ <xsd:attribute name="role" 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:attribute name="role" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="applications">
<xsd:element minOccurs="0" maxOccurs="unbounded" name="application" type="ob:application"/>
<xsd:enumeration value="Unshade"/>
</xsd:restriction>
</xsd:simpleType>
+ <xsd:simpleType name="clienttype">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="desktop"/>
+ <xsd:enumeration value="dock"/>
+ <xsd:enumeration value="toolbar"/>
+ <xsd:enumeration value="menu"/>
+ <xsd:enumeration value="splash"/>
+ <xsd:enumeration value="utility"/>
+ <xsd:enumeration value="dialog"/>
+ <xsd:enumeration value="normal"/>
+ </xsd:restriction>
+ </xsd:simpleType>
<xsd:simpleType name="bool">
<!-- this is copied to maximization. Keep that in sync. -->
<xsd:restriction base="xsd:string">
!g_pattern_match(app->name, strlen(self->name), self->name, NULL))
match = FALSE;
else if (app->class &&
- !g_pattern_match(app->class,
- strlen(self->class), self->class, NULL))
+ !g_pattern_match(app->class,
+ strlen(self->class), self->class, NULL))
match = FALSE;
else if (app->role &&
!g_pattern_match(app->role,
strlen(self->role), self->role, NULL))
match = FALSE;
+ else if ((signed)app->type >= 0 && app->type != self->type)
+ match = FALSE;
if (match) {
ob_debug("Window matching: %s\n", app->name);
ObAppSettings* config_create_app_settings(void)
{
ObAppSettings *settings = g_new0(ObAppSettings, 1);
+ settings->type = -1;
settings->decor = -1;
settings->shade = -1;
settings->monitor = -1;
g_assert(src != NULL);
g_assert(dst != NULL);
+ copy_if(type, -1);
copy_if(decor, -1);
copy_if(shade, -1);
copy_if(focus, -1);
xmlNodePtr node, gpointer data)
{
xmlNodePtr app = parse_find_node("application", node->children);
- gchar *name = NULL, *class = NULL, *role = NULL;
- gboolean name_set, class_set;
+ gchar *name = NULL, *class = NULL, *role = NULL, *type = NULL;
+ gboolean name_set, class_set, type_set;
gboolean x_pos_given;
while (app) {
- name_set = class_set = x_pos_given = FALSE;
+ name_set = class_set = type_set = x_pos_given = FALSE;
class_set = parse_attr_string("class", app, &class);
name_set = parse_attr_string("name", app, &name);
+ type_set = parse_attr_string("type", app, &type);
if (class_set || name_set) {
xmlNodePtr n, c;
ObAppSettings *settings = config_create_app_settings();;
if (class_set)
settings->class = g_pattern_spec_new(class);
+ if (type_set) {
+ if (!g_ascii_strcasecmp(type, "normal"))
+ settings->type = OB_CLIENT_TYPE_NORMAL;
+ else if (!g_ascii_strcasecmp(type, "dialog"))
+ settings->type = OB_CLIENT_TYPE_DIALOG;
+ else if (!g_ascii_strcasecmp(type, "splash"))
+ settings->type = OB_CLIENT_TYPE_SPLASH;
+ else if (!g_ascii_strcasecmp(type, "utility"))
+ settings->type = OB_CLIENT_TYPE_UTILITY;
+ else if (!g_ascii_strcasecmp(type, "menu"))
+ settings->type = OB_CLIENT_TYPE_MENU;
+ else if (!g_ascii_strcasecmp(type, "toolbar"))
+ settings->type = OB_CLIENT_TYPE_TOOLBAR;
+ else if (!g_ascii_strcasecmp(type, "dock"))
+ settings->type = OB_CLIENT_TYPE_DOCK;
+ else if (!g_ascii_strcasecmp(type, "desktop"))
+ settings->type = OB_CLIENT_TYPE_DESKTOP;
+ }
+
if (parse_attr_string("role", app, &role))
settings->role = g_pattern_spec_new(role);
#include "misc.h"
#include "stacking.h"
#include "place.h"
+#include "client.h"
#include "geom.h"
#include "moveresize.h"
#include "render/render.h"
GPatternSpec *class;
GPatternSpec *name;
GPatternSpec *role;
+ ObClientType type;
GravityPoint position;
gboolean pos_given;