diff options
| author | Dana Jansens <danakj@orodu.net> | 2010-01-11 13:42:50 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2010-01-11 13:42:50 -0500 |
| commit | 91af4d5bc9e04b766735aaa3ac098233ba103959 (patch) | |
| tree | ed9bff5f878eeeac6c3cd9844b0d9c54214ff614 /openbox | |
| parent | b8e994e837d260860a4dc0a1ee3a680e2cdfc75a (diff) | |
Add _OB_VERSION and _OB_APP_ROLE/CLASS/NAME/TYPE
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.
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/client.c | 41 | ||||
| -rw-r--r-- | openbox/prop.c | 8 | ||||
| -rw-r--r-- | openbox/prop.h | 8 | ||||
| -rw-r--r-- | openbox/screen.c | 11 |
4 files changed, 51 insertions, 17 deletions
diff --git a/openbox/client.c b/openbox/client.c index ae87ff0b..6799654e 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -76,7 +76,7 @@ static RrImage *client_default_icon = NULL; 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); @@ -1163,7 +1163,9 @@ static void client_get_all(ObClient *self, gboolean real) /* 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) @@ -2372,13 +2374,36 @@ static void client_get_session_ids(ObClient *self) } } -/*! 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) diff --git a/openbox/prop.c b/openbox/prop.c index b21b3f53..5184edae 100644 --- a/openbox/prop.c +++ b/openbox/prop.c @@ -179,9 +179,11 @@ void prop_startup(void) 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> diff --git a/openbox/prop.h b/openbox/prop.h index 419aa512..71645673 100644 --- a/openbox/prop.h +++ b/openbox/prop.h @@ -202,9 +202,11 @@ typedef struct Atoms { 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; diff --git a/openbox/screen.c b/openbox/screen.c index 075d3074..5ae07907 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -303,15 +303,20 @@ gboolean screen_annex(void) 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; |
