Add _OB_VERSION property on the root window.
Change _OB_ROLE/CLASS/NAME to _OB_APP_*.
Add _OB_APP_TYPE which has a string for the type chosen for the window on
mapping by Openbox.
Adjust the rc.xml to match these changes.
OB_MICRO_VERSION=16
OB_INTERFACE_AGE=0
OB_BINARY_AGE=0
-OB_VERSION=$OB_MAJOR_VERSION.$OB_MINOR_VERSION
+OB_VERSION=$PACKAGE_VERSION
AC_SUBST(OB_MAJOR_VERSION)
AC_SUBST(OB_MINOR_VERSION)
# this is an example with comments through out. use these to make your
# own rules, but without the comments of course.
- <application name="the window's _OB_NAME property (see obxprop)"
- class="the window's _OB_CLASS property (see obxprop)"
- role="the window's _OB_ROLE property (see obxprop)"
- type="the window's _NET_WM_WINDOW_TYPE (see obxprob)..
+ <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)"
+ type="the window's _OB_APP_TYPE property (see obxprob)..
(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.
+ # you may set only one of name/class/role/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
# used by a shell. you can use * to match any characters and ? to match
# order that they appear in this list
- # each element can be left out or set to 'default' to specify to not
+ # each rule element can be left out or set to 'default' to specify to not
# change that attribute of the window
<decor>yes</decor>
static void client_get_all(ObClient *self, gboolean real);
static void client_get_startup_id(ObClient *self);
static void client_get_session_ids(ObClient *self);
-static void client_save_session_ids(ObClient *self);
+static void client_save_app_rule_values(ObClient *self);
static void client_get_area(ObClient *self);
static void client_get_desktop(ObClient *self);
static void client_get_state(ObClient *self);
/* get the session related properties, these can change decorations
from per-app settings */
client_get_session_ids(self);
- client_save_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)
}
}
-/*! Save the session IDs as seen by Openbox when the window mapped, so that
- users can still access them later if the app changes them */
-static void client_save_session_ids(ObClient *self)
+/*! Save the properties used for app matching rules, as seen by Openbox when
+ the window mapped, so that users can still access them later if the app
+ changes them */
+static void client_save_app_rule_values(ObClient *self)
{
- PROP_SETS(self->window, ob_role, self->role);
- PROP_SETS(self->window, ob_name, self->name);
- PROP_SETS(self->window, ob_class, self->class);
+ const gchar *type;
+
+ PROP_SETS(self->window, ob_app_role, self->role);
+ PROP_SETS(self->window, ob_app_name, self->name);
+ PROP_SETS(self->window, ob_app_class, self->class);
+
+ switch (self->type) {
+ case OB_CLIENT_TYPE_NORMAL:
+ type = "normal"; break;
+ case OB_CLIENT_TYPE_DIALOG:
+ type = "dialog"; break;
+ case OB_CLIENT_TYPE_UTILITY:
+ type = "utility"; break;
+ case OB_CLIENT_TYPE_MENU:
+ type = "menu"; break;
+ case OB_CLIENT_TYPE_TOOLBAR:
+ type = "toolbar"; break;
+ case OB_CLIENT_TYPE_SPLASH:
+ type = "splash"; break;
+ case OB_CLIENT_TYPE_DESKTOP:
+ type = "desktop"; break;
+ case OB_CLIENT_TYPE_DOCK:
+ type = "dock"; break;
+ }
+ PROP_SETS(self->window, ob_app_type, type);
}
static void client_change_wm_state(ObClient *self)
CREATE(ob_wm_action_undecorate, "_OB_WM_ACTION_UNDECORATE");
CREATE(ob_wm_state_undecorated, "_OB_WM_STATE_UNDECORATED");
CREATE(ob_control, "_OB_CONTROL");
- CREATE(ob_role, "_OB_ROLE");
- CREATE(ob_name, "_OB_NAME");
- CREATE(ob_class, "_OB_CLASS");
+ CREATE(ob_version, "_OB_VERSION");
+ CREATE(ob_app_role, "_OB_APP_ROLE");
+ CREATE(ob_app_name, "_OB_APP_NAME");
+ CREATE(ob_app_class, "_OB_APP_CLASS");
+ CREATE(ob_app_type, "_OB_APP_TYPE");
}
#include <X11/Xutil.h>
Atom ob_theme;
Atom ob_config_file;
Atom ob_control;
- Atom ob_role;
- Atom ob_name;
- Atom ob_class;
+ Atom ob_version;
+ Atom ob_app_role;
+ Atom ob_app_name;
+ Atom ob_app_class;
+ Atom ob_app_type;
} Atoms;
extern Atoms prop_atoms;
supported[i++] = prop_atoms.ob_theme;
supported[i++] = prop_atoms.ob_config_file;
supported[i++] = prop_atoms.ob_control;
- supported[i++] = prop_atoms.ob_role;
- supported[i++] = prop_atoms.ob_name;
- supported[i++] = prop_atoms.ob_class;
+ supported[i++] = prop_atoms.ob_version;
+ supported[i++] = prop_atoms.ob_app_role;
+ supported[i++] = prop_atoms.ob_app_name;
+ supported[i++] = prop_atoms.ob_app_class;
+ supported[i++] = prop_atoms.ob_app_type;
g_assert(i == num_support);
PROP_SETA32(RootWindow(ob_display, ob_screen),
net_supported, atom, supported, num_support);
g_free(supported);
+ PROP_SETS(RootWindow(ob_display, ob_screen), ob_version,
+ OB_VERSION);
+
screen_tell_ksplash();
return TRUE;
#define OB_MAJOR_VERSION @OB_MAJOR_VERSION@
#define OB_MINOR_VERSION @OB_MINOR_VERSION@
#define OB_MICRO_VERSION @OB_MICRO_VERSION@
-#define OB_VERSION OB_MAJOR_VERSION.OB_MINOR_VERSION.OB_MICRO_VERSION
+#define OB_VERSION "@OB_VERSION@"
#define OB_CHECK_VERSION(major,minor,micro) \
(OB_MAJOR_VERSION > (major) || \