]> Dogcows Code - chaz/openbox/commitdiff
complete the root property get functions
authorDana Jansens <danakj@orodu.net>
Sat, 12 Apr 2003 02:24:03 +0000 (02:24 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 12 Apr 2003 02:24:03 +0000 (02:24 +0000)
cwmcc/root_props.c
cwmcc/root_props.h

index ef03e4454f2ca28f178f5dccd03371f65fc41aad..bc963c83bcfcd08d9127972c4084853979eaf2d8 100644 (file)
@@ -112,9 +112,32 @@ void cwmcc_root_get_active_window(Window win, Window *window)
     }
 }
 
-/*void cwmcc_root_get_workarea(Window win, Rect a)
+void cwmcc_root_get_workarea(Window win, int **x, int **y, int **w, int **h)
 {
-}*/
+    gulong *data = NULL, num;
+    gulong desks, i;
+
+    /* need the number of desktops */
+    cwmcc_root_get_number_of_desktops(win, &desks);
+
+    if (!prop_get_array32(win, CWMCC_ATOM(root, net_workarea),
+                    CWMCC_ATOM(type, cardinal), &data, &num)) {
+        g_warning("Failed to read NET_DESKTOP_LAYOUT from 0x%lx", win);
+    } else if (num != 4 * desks) {
+        g_warning("Read invalid NET_DESKTOP_LAYOUT from 0x%lx", win);
+    } else {
+        *x = g_new(int, desks);
+        *y = g_new(int, desks);
+        *w = g_new(int, desks);
+        *h = g_new(int, desks);
+        for (i = 0; i < desks; ++i) {
+            (*x)[i] = data[i * 4];
+            (*y)[i] = data[i * 4 + 1];
+            (*w)[i] = data[i * 4 + 2];
+            (*h)[i] = data[i * 4 + 3];
+        }
+    }
+}
 
 void cwmcc_root_get_supporting_wm_check(Window win, Window *window)
 {
index ca43f1364620c99b6a623e50f3bc3aae38c2d060..13b06010b36273f4847f94286bf2699b53d267c7 100644 (file)
@@ -22,7 +22,7 @@ void cwmcc_root_get_desktop_names(Window win, char ***names);
 
 void cwmcc_root_get_active_window(Window win, Window *window);
 
-/*void cwmcc_root_get_workarea(Window win, Rect a)*/
+void cwmcc_root_get_workarea(Window win, int **x, int **y, int **w, int **h);
 
 void cwmcc_root_get_supporting_wm_check(Window win, Window *window);
 
This page took 0.025872 seconds and 4 git commands to generate.