all repos — openbox @ 4cd886e5188549ab48a11b70cb40b65efe916b6c

openbox fork - make it a bit more like ryudo

add partial struts tho they arent useful eyt
Dana Jansens danakj@orodu.net
commit

4cd886e5188549ab48a11b70cb40b65efe916b6c

parent

960a7f0184a84f99545fa2d3dd22cefc77f2cbc6

6 files changed, 72 insertions(+), 24 deletions(-)

jump to
M openbox/client.hopenbox/client.h

@@ -106,13 +106,13 @@ This will not always be the actual position of the window on screen, it

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 @@ the size of the window, and is the value that should be displayed to the

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,
M openbox/dock.copenbox/dock.c

@@ -13,13 +13,14 @@ #define DOCKAPP_EVENT_MASK (StructureNotifyMask)

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 @@ }

} 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 @@ }

/* 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;
M openbox/dock.hopenbox/dock.h

@@ -50,7 +50,7 @@ gint w;

gint h; }; -extern Strut dock_strut; +extern StrutPartial dock_strut; void dock_startup(); void dock_shutdown();
M openbox/geom.hopenbox/geom.h

@@ -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,15 +43,34 @@ #define RECT_INTERSECTS_RECT(r, o) \

((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), \
M openbox/prop.copenbox/prop.c

@@ -59,6 +59,7 @@ CREATE(net_wm_desktop, "_NET_WM_DESKTOP");

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");
M openbox/prop.hopenbox/prop.h

@@ -65,6 +65,7 @@ Atom net_wm_desktop;

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;