]> Dogcows Code - chaz/openbox/commitdiff
add partial struts tho they arent useful eyt
authorDana Jansens <danakj@orodu.net>
Sat, 2 Aug 2003 06:25:32 +0000 (06:25 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 2 Aug 2003 06:25:32 +0000 (06:25 +0000)
openbox/client.h
openbox/dock.c
openbox/dock.h
openbox/geom.h
openbox/prop.c
openbox/prop.h

index 610c8cd4f93e59a03ee3b68bbf5ae9b7d2a35be7..954b7424acece579c27ccacde16fc8736d22b7df 100644 (file)
@@ -106,13 +106,13 @@ struct _ObClient
       is, rather, the position requested by the client, to which the window's
       gravity is applied.
     */
-    Rect    area;
+    Rect area;
 
     /*! The window's strut
       The strut defines areas of the screen that are marked off-bounds for
       window placement. In theory, where this window exists.
     */
-    Strut   strut;
+    StrutPartial strut;
      
     /*! The logical size of the window
       The "logical" size of the window is refers to the user's perception of
@@ -120,7 +120,7 @@ struct _ObClient
       user. For example, with xterms, this value it the number of characters
       being displayed in the terminal, instead of the number of pixels.
     */
-    Size   logical_size;
+    Size logical_size;
 
     /*! Width of the border on the window.
       The window manager will set this to 0 while the window is being managed,
index c2190ee239cf0383c3584339cc4db99fc62830a5..07f2dbe0a22a5f72cf203d224516857fe053161c 100644 (file)
 
 static ObDock *dock;
 
-Strut dock_strut;
+StrutPartial dock_strut;
 
 void dock_startup()
 {
     XSetWindowAttributes attrib;
 
-    STRUT_SET(dock_strut, 0, 0, 0, 0);
+    STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0,
+                      0, 0, 0, 0, 0, 0, 0, 0);
 
     dock = g_new0(ObDock, 1);
     dock->obwin.type = Window_Dock;
@@ -338,7 +339,8 @@ void dock_configure()
     }
 
     if (!config_dock_floating && config_dock_hide) {
-        strw = strh = ob_rr_theme->bwidth;
+        strw = ob_rr_theme->bwidth;
+        strh = ob_rr_theme->bwidth;
     } else {
         strw = dock->w;
         strh =  dock->h;
@@ -346,58 +348,83 @@ void dock_configure()
 
     /* set the strut */
     if (config_dock_floating) {
-        STRUT_SET(dock_strut, 0, 0, 0, 0);
+        STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0,
+                          0, 0, 0, 0, 0, 0, 0, 0);
     } else {
         switch (config_dock_pos) {
         case OB_DIRECTION_NORTHWEST:
             switch (config_dock_orient) {
             case OB_ORIENTATION_HORZ:
-                STRUT_SET(dock_strut, 0, strh, 0, 0);
+                STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
+                                  0, 0, dock->x, dock->x + dock->w - 1,
+                                  0, 0, 0, 0);
                 break;
             case OB_ORIENTATION_VERT:
-                STRUT_SET(dock_strut, strw, 0, 0, 0);
+                STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
+                                  dock->y, dock->y + dock->h - 1,
+                                  0, 0, 0, 0, 0, 0);
                 break;
             }
             break;
         case OB_DIRECTION_NORTH:
-            STRUT_SET(dock_strut, 0, strh, 0, 0);
+            STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
+                              dock->x, dock->x + dock->w - 1,
+                              0, 0, 0, 0, 0, 0);
             break;
         case OB_DIRECTION_NORTHEAST:
             switch (config_dock_orient) {
             case OB_ORIENTATION_HORZ:
-                STRUT_SET(dock_strut, 0, strh, 0, 0);
+                STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
+                                  0, 0, dock->x, dock->x + dock->w -1,
+                                  0, 0, 0, 0);
                 break;
             case OB_ORIENTATION_VERT:
-                STRUT_SET(dock_strut, 0, 0, strw, 0);
+                STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
+                                  0, 0, 0, 0,
+                                  dock->y, dock->y + dock->h - 1, 0, 0);
                 break;
             }
             break;
         case OB_DIRECTION_WEST:
-            STRUT_SET(dock_strut, strw, 0, 0, 0);
+            STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
+                              dock->y, dock->y + dock->h - 1,
+                              0, 0, 0, 0, 0, 0);
             break;
         case OB_DIRECTION_EAST:
-            STRUT_SET(dock_strut, 0, 0, strw, 0);
+            STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
+                              0, 0, 0, 0,
+                              dock->y, dock->y + dock->h - 1, 0, 0);
             break;
         case OB_DIRECTION_SOUTHWEST:
             switch (config_dock_orient) {
             case OB_ORIENTATION_HORZ:
-                STRUT_SET(dock_strut, 0, 0, 0, strh);
+                STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
+                                  0, 0, 0, 0, 0, 0,
+                                  dock->x, dock->x + dock->w - 1);
                 break;
             case OB_ORIENTATION_VERT:
-                STRUT_SET(dock_strut, strw, 0, 0, 0);
+                STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
+                                  dock->y, dock->y + dock->h - 1,
+                                  0, 0, 0, 0, 0, 0);
                 break;
             }
             break;
         case OB_DIRECTION_SOUTH:
-            STRUT_SET(dock_strut, 0, 0, 0, strh);
+            STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
+                              0, 0, 0, 0, 0, 0,
+                              dock->x, dock->x + dock->w - 1);
             break;
         case OB_DIRECTION_SOUTHEAST:
             switch (config_dock_orient) {
             case OB_ORIENTATION_HORZ:
-                STRUT_SET(dock_strut, 0, 0, 0, strh);
+                STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
+                                  0, 0, 0, 0, 0, 0,
+                                  dock->x, dock->x + dock->w - 1);
                 break;
             case OB_ORIENTATION_VERT:
-                STRUT_SET(dock_strut, 0, 0, strw, 0);
+                STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
+                                  0, 0, 0, 0,
+                                  dock->y, dock->y + dock->h - 1, 0, 0);
                 break;
             }
             break;
index 99cc01f3a962dd7e8d7549fd0bbeb11cc0780ce5..f42a2027da1833356b117a238a2fe3df9195c175 100644 (file)
@@ -50,7 +50,7 @@ struct _ObDockApp {
     gint h;
 };
 
-extern Strut dock_strut;
+extern StrutPartial dock_strut;
 
 void dock_startup();
 void dock_shutdown();
index 5f2c030c381a6217ad2cb1677a30a498260fa89f..6e46522c6a340541c76ca2afafcd242e5b93406a 100644 (file)
@@ -1,21 +1,21 @@
 #ifndef __geom_h
 #define __geom_h
 
-typedef struct Point {
+typedef struct _Point {
     int x;
     int y;
 } Point;
 
 #define POINT_SET(pt, nx, ny) (pt).x = (nx), (pt).y = (ny)
 
-typedef struct Size {
+typedef struct _Size {
     int width;
     int height;
 } Size;
 
 #define SIZE_SET(sz, w, h) (sz).width = (w), (sz).height = (h)
 
-typedef struct Rect {
+typedef struct _Rect {
     int x;
     int y;
     int width;
@@ -43,16 +43,35 @@ typedef struct Rect {
     ((o).x < (r).x + (r).width && (o).x + (o).width > (r).x && \
      (o).y < (r).y + (r).height && (o).y + (o).height > (r).y)
 
-typedef struct Strut {
+typedef struct _Strut {
     int left;
     int top;
     int right;
     int bottom;
 } Strut;
 
+typedef struct _StrutPartial {
+    int left;
+    int top;
+    int right;
+    int bottom;
+
+    int left_start,   left_end;
+    int top_start,    top_end;
+    int right_start,  right_end;
+    int bottom_start, bottom_end;
+} StrutPartial;
+
 #define STRUT_SET(s, l, t, r, b) \
     (s).left = (l), (s).top = (t), (s).right = (r), (s).bottom = (b)
 
+#define STRUT_PARTIAL_SET(s, l, t, r, b, ls, le, ts, te, rs, re, bs, be) \
+    (s).left = (l), (s).top = (t), (s).right = (r), (s).bottom = (b), \
+    (s).left_start = (ls), (s).left_end = (le), \
+    (s).top_start = (ts), (s).top_end = (te), \
+    (s).right_start = (rs), (s).right_end = (re), \
+    (s).bottom_start = (bs), (s).bottom_end = (be)
+
 #define STRUT_ADD(s1, s2) \
     (s1).left = MAX((s1).left, (s2).left), \
     (s1).right = MAX((s1).right, (s2).right), \
index 47e5a53882c82e67157c77a2a6d1a797d9f627f5..186cc133c9c6af2b056cf6fbf78532d9f0fa9719 100644 (file)
@@ -59,6 +59,7 @@ void prop_startup()
     CREATE(net_wm_window_type, "_NET_WM_WINDOW_TYPE");
     CREATE(net_wm_state, "_NET_WM_STATE");
     CREATE(net_wm_strut, "_NET_WM_STRUT");
+    CREATE(net_wm_strut_partial, "_NET_WM_STRUT_PARTIAL");
     CREATE(net_wm_icon, "_NET_WM_ICON");
 /*   CREATE(net_wm_pid, "_NET_WM_PID"); */
     CREATE(net_wm_allowed_actions, "_NET_WM_ALLOWED_ACTIONS");
index 4ed6d7212e96f54861c348fd268829461c96b745..5bfad5727ea2cd3c6c3d52a5d2a0527e8fa43c18 100644 (file)
@@ -65,6 +65,7 @@ typedef struct Atoms {
     Atom net_wm_window_type;
     Atom net_wm_state;
     Atom net_wm_strut;
+    Atom net_wm_strut_partial;
     Atom net_wm_icon;
 /*  Atom net_wm_pid; */
     Atom net_wm_allowed_actions;
This page took 0.031356 seconds and 4 git commands to generate.