frame/titlebar: Remove border Between client and titlebar
This commit is contained in:
parent
c8e82eac86
commit
e90fc58732
@ -157,9 +157,11 @@ wmfs_spawn(PyObject *self, PyObject *args)
|
|||||||
{
|
{
|
||||||
char *arg, *sh;
|
char *arg, *sh;
|
||||||
|
|
||||||
|
int t,tt,st;
|
||||||
|
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
|
|
||||||
if(!PyArg_ParseTuple(args, "s", &arg))
|
if(!PyArg_ParseTuple(args, "(i|i)s", &t, &tt, &st, &arg))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(!(sh = getenv("SHELL")))
|
if(!(sh = getenv("SHELL")))
|
||||||
@ -177,6 +179,7 @@ wmfs_spawn(PyObject *self, PyObject *args)
|
|||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("t: %d, tt: %d, st %d\n",t, tt, st);
|
||||||
|
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|||||||
47
src/barwin.c
47
src/barwin.c
@ -51,7 +51,8 @@ barwin_create(Window parent,
|
|||||||
uint bg,
|
uint bg,
|
||||||
char *fg,
|
char *fg,
|
||||||
Bool entermask,
|
Bool entermask,
|
||||||
Bool stipple)
|
Bool stipple,
|
||||||
|
Bool border)
|
||||||
{
|
{
|
||||||
XSetWindowAttributes at;
|
XSetWindowAttributes at;
|
||||||
BarWindow *bw;
|
BarWindow *bw;
|
||||||
@ -76,10 +77,15 @@ barwin_create(Window parent,
|
|||||||
bw->dr = XCreatePixmap(dpy, parent, w, h, DefaultDepth(dpy, SCREEN));
|
bw->dr = XCreatePixmap(dpy, parent, w, h, DefaultDepth(dpy, SCREEN));
|
||||||
|
|
||||||
/* His border */
|
/* His border */
|
||||||
CWIN(bw->border.left, bw->win, 0, 0, SHADH, h, 0, CWBackPixel, color_enlight(bg), &at);
|
if(border)
|
||||||
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);
|
bw->bord = True;
|
||||||
CWIN(bw->border.right, bw->win, w - SHADH, 0, SHADH, h, 0, CWBackPixel, SHADC, &at);
|
|
||||||
|
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 */
|
/* Property */
|
||||||
bw->geo.x = x;
|
bw->geo.x = x;
|
||||||
@ -236,11 +242,13 @@ barwin_resize(BarWindow *bw, uint w, uint h)
|
|||||||
XResizeWindow(dpy, bw->win, w, h);
|
XResizeWindow(dpy, bw->win, w, h);
|
||||||
|
|
||||||
/* Border */
|
/* Border */
|
||||||
XResizeWindow(dpy, bw->border.left, SHADH, h);
|
if(bw->bord)
|
||||||
XResizeWindow(dpy, bw->border.top, w, SHADH);
|
{
|
||||||
XResizeWindow(dpy, bw->border.bottom, w, SHADH);
|
XResizeWindow(dpy, bw->border.left, SHADH, h);
|
||||||
XMoveResizeWindow(dpy, bw->border.right, w - SHADH, 0, 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;
|
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);
|
XFillRectangle(dpy, bw->dr, gc_stipple, 3, 2, bw->geo.width - 6, bw->geo.height - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
XSetWindowBackground(dpy, bw->border.left, bw->border.light);
|
if(bw->bord)
|
||||||
XSetWindowBackground(dpy, bw->border.top, bw->border.light);
|
{
|
||||||
XSetWindowBackground(dpy, bw->border.bottom, bw->border.dark);
|
XSetWindowBackground(dpy, bw->border.left, bw->border.light);
|
||||||
XSetWindowBackground(dpy, bw->border.right, bw->border.dark);
|
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.left);
|
||||||
XClearWindow(dpy, bw->border.top);
|
XClearWindow(dpy, bw->border.top);
|
||||||
XClearWindow(dpy, bw->border.bottom);
|
XClearWindow(dpy, bw->border.bottom);
|
||||||
XClearWindow(dpy, bw->border.right);
|
XClearWindow(dpy, bw->border.right);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -341,6 +341,7 @@ client_map(Client *c)
|
|||||||
barwin_map(c->titlebar);
|
barwin_map(c->titlebar);
|
||||||
barwin_map_subwin(c->titlebar);
|
barwin_map_subwin(c->titlebar);
|
||||||
}
|
}
|
||||||
|
XMapSubwindows(dpy, c->frame);
|
||||||
c->unmapped = False;
|
c->unmapped = False;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -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])
|
else if(data_l[1] == net_atom[net_wm_state_demands_attention])
|
||||||
{
|
{
|
||||||
if(data_l[0] == _NET_WM_STATE_ADD)
|
if(data_l[0] == _NET_WM_STATE_ADD)
|
||||||
{
|
|
||||||
screen_set_sel(c->screen);
|
|
||||||
tag_set(c->tag);
|
|
||||||
client_focus(c);
|
client_focus(c);
|
||||||
}
|
|
||||||
if(data_l[0] == _NET_WM_STATE_REMOVE)
|
if(data_l[0] == _NET_WM_STATE_REMOVE)
|
||||||
if(c == sel)
|
if(c == sel)
|
||||||
client_focus(NULL);
|
client_focus(NULL);
|
||||||
|
|||||||
@ -71,11 +71,11 @@ frame_create(Client *c)
|
|||||||
/* Create titlebar window */
|
/* Create titlebar window */
|
||||||
if(TBARH)
|
if(TBARH)
|
||||||
c->titlebar = barwin_create(c->frame, 0, 0,
|
c->titlebar = barwin_create(c->frame, 0, 0,
|
||||||
c->frame_geo.width,
|
c->frame_geo.width ,
|
||||||
TBARH + (c->geo.x - c->frame_geo.x),
|
TBARH + (c->geo.x - c->frame_geo.x),
|
||||||
c->colors.frame,
|
c->colors.frame,
|
||||||
c->colors.fg,
|
c->colors.fg,
|
||||||
True, conf.titlebar.stipple);
|
True, conf.titlebar.stipple, False);
|
||||||
|
|
||||||
at.event_mask &= ~(EnterWindowMask | LeaveWindowMask); /* <- Delete useless mask */
|
at.event_mask &= ~(EnterWindowMask | LeaveWindowMask); /* <- Delete useless mask */
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ infobar_init(void)
|
|||||||
/* Create infobar barwindow */
|
/* Create infobar barwindow */
|
||||||
infobar[sc].bar = barwin_create(ROOT, sgeo[sc].x - BORDH, infobar[sc].geo.y,
|
infobar[sc].bar = barwin_create(ROOT, sgeo[sc].x - BORDH, infobar[sc].geo.y,
|
||||||
sgeo[sc].width, infobar[sc].geo.height,
|
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 */
|
/* Create tags window */
|
||||||
for(i = 1; i < conf.ntag[sc] + 1; ++i)
|
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,
|
infobar[sc].tags[i] = barwin_create(infobar[sc].bar->win, j, 0,
|
||||||
textw(tags[sc][i].name) + PAD,
|
textw(tags[sc][i].name) + PAD,
|
||||||
infobar[sc].geo.height,
|
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;
|
j += textw(tags[sc][i].name) + PAD;
|
||||||
barwin_map_subwin(infobar[sc].tags[i]);
|
barwin_map_subwin(infobar[sc].tags[i]);
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ infobar_init(void)
|
|||||||
textw(tags[sc][seltag[sc]].layout.symbol) + PAD,
|
textw(tags[sc][seltag[sc]].layout.symbol) + PAD,
|
||||||
infobar[sc].geo.height,
|
infobar[sc].geo.height,
|
||||||
conf.colors.layout_bg, conf.colors.layout_fg,
|
conf.colors.layout_bg, conf.colors.layout_fg,
|
||||||
False, False);
|
False, False, True);
|
||||||
|
|
||||||
/* Map/Refresh all */
|
/* Map/Refresh all */
|
||||||
barwin_map(infobar[sc].bar);
|
barwin_map(infobar[sc].bar);
|
||||||
|
|||||||
@ -109,7 +109,7 @@ typedef struct
|
|||||||
uint bg;
|
uint bg;
|
||||||
char *fg;
|
char *fg;
|
||||||
XRectangle geo;
|
XRectangle geo;
|
||||||
Bool mapped, stipple;
|
Bool mapped, stipple, bord;
|
||||||
} BarWindow;
|
} BarWindow;
|
||||||
|
|
||||||
/* Client Structure. */
|
/* Client Structure. */
|
||||||
|
|||||||
@ -90,7 +90,8 @@ BarWindow *barwin_create(Window parent,
|
|||||||
uint w, uint h,
|
uint w, uint h,
|
||||||
uint bg, char*fg,
|
uint bg, char*fg,
|
||||||
Bool entermask,
|
Bool entermask,
|
||||||
Bool stipple);
|
Bool stipple,
|
||||||
|
Bool border);
|
||||||
|
|
||||||
void barwin_draw_text(BarWindow *bw, int x, int y, char *text);
|
void barwin_draw_text(BarWindow *bw, int x, int y, char *text);
|
||||||
void barwin_delete(BarWindow *bw);
|
void barwin_delete(BarWindow *bw);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user