all repos — openbox @ 9ba2b04e96449fea5b6bd212aa3d431638754bdd

openbox fork - make it a bit more like ryudo

Set hints that remember the WM_WINDOW_ROLE and WM_CLASS properties for our users.

The hints are _OB_ROLE, _OB_NAME, and _OB_CLASS.
Dana Jansens danakj@orodu.net
commit

9ba2b04e96449fea5b6bd212aa3d431638754bdd

parent

5c01dc651a220ad1ccce9502da577d81f1877388

4 files changed, 20 insertions(+), 0 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -76,6 +76,7 @@

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_get_area(ObClient *self); static void client_get_desktop(ObClient *self); static void client_get_state(ObClient *self);

@@ -1159,6 +1160,7 @@

/* get the session related properties, these can change decorations from per-app settings */ client_get_session_ids(self); + client_save_session_ids(self); /* now we got everything that can affect the decorations */ if (!real)

@@ -2365,6 +2367,15 @@ WM_CLIENT_MACHINE be set) */

if (PROP_GET32(self->window, net_wm_pid, cardinal, &pid)) self->pid = pid; } +} + +/*! 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) +{ + PROP_SETS(self->window, ob_role, self->role); + PROP_SETS(self->window, ob_name, self->name); + PROP_SETS(self->window, ob_class, self->class); } static void client_change_wm_state(ObClient *self)
M openbox/prop.copenbox/prop.c

@@ -179,6 +179,9 @@ CREATE(ob_config_file, "_OB_CONFIG_FILE");

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"); } #include <X11/Xutil.h>
M openbox/prop.hopenbox/prop.h

@@ -202,6 +202,9 @@ Atom openbox_pid; /* this is depreecated in favour of ob_control */

Atom ob_theme; Atom ob_config_file; Atom ob_control; + Atom ob_role; + Atom ob_name; + Atom ob_class; } Atoms; extern Atoms prop_atoms;
M openbox/screen.copenbox/screen.c

@@ -302,6 +302,9 @@ supported[i++] = prop_atoms.openbox_pid;

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; g_assert(i == num_support); PROP_SETA32(RootWindow(ob_display, ob_screen),