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

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

View file

@ -13,13 +13,14 @@
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;

View file

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

View 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), \

View 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");

View 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;