add partial struts tho they arent useful eyt

This commit is contained in:
Dana Jansens 2003-08-02 06:25:32 +00:00
parent 960a7f0184
commit 4cd886e518
6 changed files with 72 additions and 24 deletions

View file

@ -112,7 +112,7 @@ struct _ObClient
The strut defines areas of the screen that are marked off-bounds for The strut defines areas of the screen that are marked off-bounds for
window placement. In theory, where this window exists. window placement. In theory, where this window exists.
*/ */
Strut strut; StrutPartial strut;
/*! The logical size of the window /*! The logical size of the window
The "logical" size of the window is refers to the user's perception of The "logical" size of the window is refers to the user's perception of

View file

@ -13,13 +13,14 @@
static ObDock *dock; static ObDock *dock;
Strut dock_strut; StrutPartial dock_strut;
void dock_startup() void dock_startup()
{ {
XSetWindowAttributes attrib; 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 = g_new0(ObDock, 1);
dock->obwin.type = Window_Dock; dock->obwin.type = Window_Dock;
@ -338,7 +339,8 @@ void dock_configure()
} }
if (!config_dock_floating && config_dock_hide) { if (!config_dock_floating && config_dock_hide) {
strw = strh = ob_rr_theme->bwidth; strw = ob_rr_theme->bwidth;
strh = ob_rr_theme->bwidth;
} else { } else {
strw = dock->w; strw = dock->w;
strh = dock->h; strh = dock->h;
@ -346,58 +348,83 @@ void dock_configure()
/* set the strut */ /* set the strut */
if (config_dock_floating) { 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 { } else {
switch (config_dock_pos) { switch (config_dock_pos) {
case OB_DIRECTION_NORTHWEST: case OB_DIRECTION_NORTHWEST:
switch (config_dock_orient) { switch (config_dock_orient) {
case OB_ORIENTATION_HORZ: 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; break;
case OB_ORIENTATION_VERT: 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;
} }
break; break;
case OB_DIRECTION_NORTH: 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; break;
case OB_DIRECTION_NORTHEAST: case OB_DIRECTION_NORTHEAST:
switch (config_dock_orient) { switch (config_dock_orient) {
case OB_ORIENTATION_HORZ: 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; break;
case OB_ORIENTATION_VERT: 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;
} }
break; break;
case OB_DIRECTION_WEST: 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; break;
case OB_DIRECTION_EAST: 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; break;
case OB_DIRECTION_SOUTHWEST: case OB_DIRECTION_SOUTHWEST:
switch (config_dock_orient) { switch (config_dock_orient) {
case OB_ORIENTATION_HORZ: 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; break;
case OB_ORIENTATION_VERT: 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;
} }
break; break;
case OB_DIRECTION_SOUTH: 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; break;
case OB_DIRECTION_SOUTHEAST: case OB_DIRECTION_SOUTHEAST:
switch (config_dock_orient) { switch (config_dock_orient) {
case OB_ORIENTATION_HORZ: 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; break;
case OB_ORIENTATION_VERT: 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;
} }
break; break;

View file

@ -50,7 +50,7 @@ struct _ObDockApp {
gint h; gint h;
}; };
extern Strut dock_strut; extern StrutPartial dock_strut;
void dock_startup(); void dock_startup();
void dock_shutdown(); void dock_shutdown();

View file

@ -1,21 +1,21 @@
#ifndef __geom_h #ifndef __geom_h
#define __geom_h #define __geom_h
typedef struct Point { typedef struct _Point {
int x; int x;
int y; int y;
} Point; } Point;
#define POINT_SET(pt, nx, ny) (pt).x = (nx), (pt).y = (ny) #define POINT_SET(pt, nx, ny) (pt).x = (nx), (pt).y = (ny)
typedef struct Size { typedef struct _Size {
int width; int width;
int height; int height;
} Size; } Size;
#define SIZE_SET(sz, w, h) (sz).width = (w), (sz).height = (h) #define SIZE_SET(sz, w, h) (sz).width = (w), (sz).height = (h)
typedef struct Rect { typedef struct _Rect {
int x; int x;
int y; int y;
int width; int width;
@ -43,16 +43,35 @@ typedef struct Rect {
((o).x < (r).x + (r).width && (o).x + (o).width > (r).x && \ ((o).x < (r).x + (r).width && (o).x + (o).width > (r).x && \
(o).y < (r).y + (r).height && (o).y + (o).height > (r).y) (o).y < (r).y + (r).height && (o).y + (o).height > (r).y)
typedef struct Strut { typedef struct _Strut {
int left; int left;
int top; int top;
int right; int right;
int bottom; int bottom;
} Strut; } 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) \ #define STRUT_SET(s, l, t, r, b) \
(s).left = (l), (s).top = (t), (s).right = (r), (s).bottom = (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) \ #define STRUT_ADD(s1, s2) \
(s1).left = MAX((s1).left, (s2).left), \ (s1).left = MAX((s1).left, (s2).left), \
(s1).right = MAX((s1).right, (s2).right), \ (s1).right = MAX((s1).right, (s2).right), \

View file

@ -59,6 +59,7 @@ void prop_startup()
CREATE(net_wm_window_type, "_NET_WM_WINDOW_TYPE"); CREATE(net_wm_window_type, "_NET_WM_WINDOW_TYPE");
CREATE(net_wm_state, "_NET_WM_STATE"); CREATE(net_wm_state, "_NET_WM_STATE");
CREATE(net_wm_strut, "_NET_WM_STRUT"); 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_icon, "_NET_WM_ICON");
/* CREATE(net_wm_pid, "_NET_WM_PID"); */ /* CREATE(net_wm_pid, "_NET_WM_PID"); */
CREATE(net_wm_allowed_actions, "_NET_WM_ALLOWED_ACTIONS"); CREATE(net_wm_allowed_actions, "_NET_WM_ALLOWED_ACTIONS");

View file

@ -65,6 +65,7 @@ typedef struct Atoms {
Atom net_wm_window_type; Atom net_wm_window_type;
Atom net_wm_state; Atom net_wm_state;
Atom net_wm_strut; Atom net_wm_strut;
Atom net_wm_strut_partial;
Atom net_wm_icon; Atom net_wm_icon;
/* Atom net_wm_pid; */ /* Atom net_wm_pid; */
Atom net_wm_allowed_actions; Atom net_wm_allowed_actions;