]> Dogcows Code - chaz/openbox/commitdiff
Set hints that remember the WM_WINDOW_ROLE and WM_CLASS properties for our users.
authorDana Jansens <danakj@orodu.net>
Fri, 11 Dec 2009 23:27:46 +0000 (18:27 -0500)
committerDana Jansens <danakj@orodu.net>
Fri, 11 Dec 2009 23:58:39 +0000 (18:58 -0500)
The hints are _OB_ROLE, _OB_NAME, and _OB_CLASS.

openbox/client.c
openbox/prop.c
openbox/prop.h
openbox/screen.c

index fcbe7cd97a6484be58a9e4c2cbfe80c45370e6d4..e3a7d6ecd2ef7bf25dd363ee4106c74abbf57827 100644 (file)
@@ -76,6 +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_get_area(ObClient *self);
 static void client_get_desktop(ObClient *self);
 static void client_get_state(ObClient *self);
@@ -1159,6 +1160,7 @@ 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);
 
     /* now we got everything that can affect the decorations */
     if (!real)
@@ -2367,6 +2369,15 @@ 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)
+{
+    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)
 {
     gulong state[2];
index ec1ce3db9dd30f19b5877ef07cdc756e8ea92a70..b21b3f533fbf3809f9872d25ae8a2aed26bdbce7 100644 (file)
@@ -179,6 +179,9 @@ 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");
 }
 
 #include <X11/Xutil.h>
index 644717a2af816ed905cedd166e3fb025c68ccb91..419aa512b91ee4e3c05017393b2ad3b349721e33 100644 (file)
@@ -202,6 +202,9 @@ typedef struct Atoms {
     Atom ob_theme;
     Atom ob_config_file;
     Atom ob_control;
+    Atom ob_role;
+    Atom ob_name;
+    Atom ob_class;
 } Atoms;
 extern Atoms prop_atoms;
 
index 4412027e0845bf80020c43f8b52b54f920fa5aca..8d0460d570a7a70daecaefa9bc7dc35956c9735c 100644 (file)
@@ -302,6 +302,9 @@ 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;
     g_assert(i == num_support);
 
     PROP_SETA32(RootWindow(ob_display, ob_screen),
This page took 0.034793 seconds and 4 git commands to generate.