frame/titlebar: Remove border Between client and titlebar

This commit is contained in:
Martin Duquesnoy 2009-01-08 21:43:50 +01:00
parent c8e82eac86
commit e90fc58732
8 changed files with 42 additions and 30 deletions

View File

@ -157,9 +157,11 @@ wmfs_spawn(PyObject *self, PyObject *args)
{
char *arg, *sh;
int t,tt,st;
Py_INCREF(Py_None);
if(!PyArg_ParseTuple(args, "s", &arg))
if(!PyArg_ParseTuple(args, "(i|i)s", &t, &tt, &st, &arg))
return NULL;
if(!(sh = getenv("SHELL")))
@ -177,6 +179,7 @@ wmfs_spawn(PyObject *self, PyObject *args)
exit(EXIT_SUCCESS);
}
printf("t: %d, tt: %d, st %d\n",t, tt, st);
return Py_None;
}

View File

@ -51,7 +51,8 @@ barwin_create(Window parent,
uint bg,
char *fg,
Bool entermask,
Bool stipple)
Bool stipple,
Bool border)
{
XSetWindowAttributes at;
BarWindow *bw;
@ -76,10 +77,15 @@ barwin_create(Window parent,
bw->dr = XCreatePixmap(dpy, parent, w, h, DefaultDepth(dpy, SCREEN));
/* His border */
CWIN(bw->border.left, bw->win, 0, 0, SHADH, h, 0, CWBackPixel, color_enlight(bg), &at);
CWIN(bw->border.top, bw->win, 0, 0, w, SHADH, 0, CWBackPixel, color_enlight(bg), &at);
CWIN(bw->border.bottom, bw->win, 0, h - SHADH, w, SHADH, 0, CWBackPixel, SHADC, &at);
CWIN(bw->border.right, bw->win, w - SHADH, 0, SHADH, h, 0, CWBackPixel, SHADC, &at);
if(border)
{
bw->bord = True;
CWIN(bw->border.left, bw->win, 0, 0, SHADH, h, 0, CWBackPixel, color_enlight(bg), &at);
CWIN(bw->border.top, bw->win, 0, 0, w, SHADH, 0, CWBackPixel, color_enlight(bg), &at);
CWIN(bw->border.bottom, bw->win, 0, h - SHADH, w, SHADH, 0, CWBackPixel, SHADC, &at);
CWIN(bw->border.right, bw->win, w - SHADH, 0, SHADH, h, 0, CWBackPixel, SHADC, &at);
}
/* Property */
bw->geo.x = x;
@ -236,11 +242,13 @@ barwin_resize(BarWindow *bw, uint w, uint h)
XResizeWindow(dpy, bw->win, w, h);
/* Border */
XResizeWindow(dpy, bw->border.left, SHADH, h);
XResizeWindow(dpy, bw->border.top, w, SHADH);
XResizeWindow(dpy, bw->border.bottom, w, SHADH);
XMoveResizeWindow(dpy, bw->border.right, w - SHADH, 0, SHADH, h);
if(bw->bord)
{
XResizeWindow(dpy, bw->border.left, SHADH, h);
XResizeWindow(dpy, bw->border.top, w, SHADH);
XResizeWindow(dpy, bw->border.bottom, w, SHADH);
XMoveResizeWindow(dpy, bw->border.right, w - SHADH, 0, SHADH, h);
}
return;
}
@ -261,15 +269,18 @@ barwin_refresh_color(BarWindow *bw)
XFillRectangle(dpy, bw->dr, gc_stipple, 3, 2, bw->geo.width - 6, bw->geo.height - 4);
}
XSetWindowBackground(dpy, bw->border.left, bw->border.light);
XSetWindowBackground(dpy, bw->border.top, bw->border.light);
XSetWindowBackground(dpy, bw->border.bottom, bw->border.dark);
XSetWindowBackground(dpy, bw->border.right, bw->border.dark);
if(bw->bord)
{
XSetWindowBackground(dpy, bw->border.left, bw->border.light);
XSetWindowBackground(dpy, bw->border.top, bw->border.light);
XSetWindowBackground(dpy, bw->border.bottom, bw->border.dark);
XSetWindowBackground(dpy, bw->border.right, bw->border.dark);
XClearWindow(dpy, bw->border.left);
XClearWindow(dpy, bw->border.top);
XClearWindow(dpy, bw->border.bottom);
XClearWindow(dpy, bw->border.right);
XClearWindow(dpy, bw->border.left);
XClearWindow(dpy, bw->border.top);
XClearWindow(dpy, bw->border.bottom);
XClearWindow(dpy, bw->border.right);
}
return;
}

View File

@ -341,6 +341,7 @@ client_map(Client *c)
barwin_map(c->titlebar);
barwin_map_subwin(c->titlebar);
}
XMapSubwindows(dpy, c->frame);
c->unmapped = False;
return;

View File

@ -271,11 +271,7 @@ ewmh_manage_net_wm_state(long data_l[], Client *c)
else if(data_l[1] == net_atom[net_wm_state_demands_attention])
{
if(data_l[0] == _NET_WM_STATE_ADD)
{
screen_set_sel(c->screen);
tag_set(c->tag);
client_focus(c);
}
if(data_l[0] == _NET_WM_STATE_REMOVE)
if(c == sel)
client_focus(NULL);

View File

@ -71,11 +71,11 @@ frame_create(Client *c)
/* Create titlebar window */
if(TBARH)
c->titlebar = barwin_create(c->frame, 0, 0,
c->frame_geo.width,
c->frame_geo.width ,
TBARH + (c->geo.x - c->frame_geo.x),
c->colors.frame,
c->colors.fg,
True, conf.titlebar.stipple);
True, conf.titlebar.stipple, False);
at.event_mask &= ~(EnterWindowMask | LeaveWindowMask); /* <- Delete useless mask */

View File

@ -53,7 +53,7 @@ infobar_init(void)
/* Create infobar barwindow */
infobar[sc].bar = barwin_create(ROOT, sgeo[sc].x - BORDH, infobar[sc].geo.y,
sgeo[sc].width, infobar[sc].geo.height,
conf.colors.bar, conf.colors.text, False, False);
conf.colors.bar, conf.colors.text, False, False, True);
/* Create tags window */
for(i = 1; i < conf.ntag[sc] + 1; ++i)
@ -61,7 +61,7 @@ infobar_init(void)
infobar[sc].tags[i] = barwin_create(infobar[sc].bar->win, j, 0,
textw(tags[sc][i].name) + PAD,
infobar[sc].geo.height,
conf.colors.bar, conf.colors.text, False, False);
conf.colors.bar, conf.colors.text, False, False, True);
j += textw(tags[sc][i].name) + PAD;
barwin_map_subwin(infobar[sc].tags[i]);
}
@ -71,7 +71,7 @@ infobar_init(void)
textw(tags[sc][seltag[sc]].layout.symbol) + PAD,
infobar[sc].geo.height,
conf.colors.layout_bg, conf.colors.layout_fg,
False, False);
False, False, True);
/* Map/Refresh all */
barwin_map(infobar[sc].bar);

View File

@ -109,7 +109,7 @@ typedef struct
uint bg;
char *fg;
XRectangle geo;
Bool mapped, stipple;
Bool mapped, stipple, bord;
} BarWindow;
/* Client Structure. */

View File

@ -90,7 +90,8 @@ BarWindow *barwin_create(Window parent,
uint w, uint h,
uint bg, char*fg,
Bool entermask,
Bool stipple);
Bool stipple,
Bool border);
void barwin_draw_text(BarWindow *bw, int x, int y, char *text);
void barwin_delete(BarWindow *bw);