[openbox] window matching

Grzegorz Kusnierz koniu at bezkitu.com
Sun Jan 4 16:35:34 EST 2004


On Sun, Jan 04, 2004 at 03:06:32PM -0500, Ben Jansens wrote:
> > Will Openbox3 ever have window matching functionality 
> 
> No. It can load sessions so you can keep your windows where they were when
> you shutdown. I feel that is all a Window Manager needs to do.

Ok, if you choose this kind of minimalistic way, let it be then.

> Then why not add them? It would be muh easier to add it to devil's pie than
> to add all of that all over again to Openbox.

I thought "Hey, this guy might be right" so here it is, in the attached
patch against wmctrl-1.04. Hope somebody will find it useful :)

example usage:

   % wmctrl -r aterm -b toggle,undecorated


greets
k

-- 
 ___________________________________________________
|                                                   /)/)
|  Grzegorz Kuśnierz  |  JID: koniu at bezkitu.com |  ( ^^\
|  koniu at bezkitu.com  |  ICQ: 213689452         |  /'-._)
|   www.bezkitu.com   |   GG: 1799993             /#/  
 \_______________________________________________/#/
-------------- next part --------------
--- main.org.c	2003-10-04 02:19:23.000000000 +0200
+++ main.c	2004-01-04 22:26:26.724016128 +0100
@@ -144,6 +144,8 @@
 "                           shaded, skip_taskbar, skip_pager, hidden,\n" \
 "                           fullscreen, above, below\n" \
 "\n" \
+"                       With Openbox3 you can additionaly use \"undecorated\".\n" \
+"\n" \
 "Workarounds:\n" \
 "\n" \
 "  DESKTOP_TITLES_INVALID_UTF8      Print non-ASCII desktop titles correctly\n" \
@@ -731,7 +733,12 @@
                 fputs("Invalid zero length property.\n", stderr);
                 return EXIT_FAILURE;
             }
-            tmp_prop2 = g_strdup_printf("_NET_WM_STATE_%s", tmp2 = g_ascii_strup(p2, -1));
+            if (strcmp(p2,"undecorated") == 0) {
+                tmp_prop2 = g_strdup_printf("_OB_WM_STATE_%s", tmp2 = g_ascii_strup(p2, -1));
+            }
+            else {
+                tmp_prop2 = g_strdup_printf("_NET_WM_STATE_%s", tmp2 = g_ascii_strup(p2, -1));
+            }
             p_verbose("State 2: %s\n", tmp_prop2); 
             prop2 = XInternAtom(disp, tmp_prop2, False);
             g_free(tmp2);
@@ -743,7 +750,12 @@
             fputs("Invalid zero length property.\n", stderr);
             return EXIT_FAILURE;
         }
-        tmp_prop1 = g_strdup_printf("_NET_WM_STATE_%s", tmp1 = g_ascii_strup(p1, -1));
+        if (strcmp(p1,"undecorated") == 0) {
+            tmp_prop1 = g_strdup_printf("_OB_WM_STATE_%s", tmp1 = g_ascii_strup(p1, -1));
+        }
+        else {
+            tmp_prop1 = g_strdup_printf("_NET_WM_STATE_%s", tmp1 = g_ascii_strup(p1, -1));
+        }
         p_verbose("State 1: %s\n", tmp_prop1); 
         prop1 = XInternAtom(disp, tmp_prop1, False);
         g_free(tmp1);


More information about the openbox mailing list