titlebar: Fix titlebar base size
This commit is contained in:
15
src/bar.c
15
src/bar.c
@@ -43,17 +43,22 @@ bar_create(int x, int y, uint w, uint h, int bord, uint color, Bool entermask)
|
|||||||
at.override_redirect = 1;
|
at.override_redirect = 1;
|
||||||
at.background_pixmap = ParentRelative;
|
at.background_pixmap = ParentRelative;
|
||||||
if(entermask)
|
if(entermask)
|
||||||
at.event_mask = ButtonPressMask | ExposureMask | EnterWindowMask;
|
at.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
|
||||||
|
ButtonPressMask | ExposureMask | EnterWindowMask |
|
||||||
|
LeaveWindowMask | StructureNotifyMask;
|
||||||
else
|
else
|
||||||
at.event_mask = ButtonPressMask | ExposureMask;
|
at.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
|
||||||
|
ButtonPressMask | ExposureMask | StructureNotifyMask;
|
||||||
|
|
||||||
bw->dr = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
|
|
||||||
bw->win = XCreateWindow(dpy, root, x, y, w, h, bord, DefaultDepth(dpy, screen),
|
bw->win = XCreateWindow(dpy, root, x, y, w, h, bord, DefaultDepth(dpy, screen),
|
||||||
CopyFromParent, DefaultVisual(dpy, screen),
|
CopyFromParent, DefaultVisual(dpy, screen),
|
||||||
CWOverrideRedirect | CWBackPixmap | CWEventMask, &at);
|
CWOverrideRedirect | CWBackPixmap | CWEventMask, &at);
|
||||||
|
bw->dr = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
|
||||||
|
|
||||||
bw->geo.x = x; bw->geo.y = y;
|
bw->geo.x = x;
|
||||||
bw->geo.width = w; bw->geo.height = h;
|
bw->geo.y = y;
|
||||||
|
bw->geo.width = w;
|
||||||
|
bw->geo.height = h;
|
||||||
bw->bord = bord;
|
bw->bord = bord;
|
||||||
bw->color = color;
|
bw->color = color;
|
||||||
|
|
||||||
|
|||||||
@@ -238,8 +238,8 @@ client_manage(Window w, XWindowAttributes *wa)
|
|||||||
XConfigureWindow(dpy, w, CWBorderWidth, &winc);
|
XConfigureWindow(dpy, w, CWBorderWidth, &winc);
|
||||||
XSetWindowBorder(dpy, w, conf.client.bordernormal);
|
XSetWindowBorder(dpy, w, conf.client.bordernormal);
|
||||||
grabbuttons(c, False);
|
grabbuttons(c, False);
|
||||||
XSelectInput(dpy, w, EnterWindowMask | FocusChangeMask
|
XSelectInput(dpy, w, EnterWindowMask | FocusChangeMask | PropertyChangeMask | StructureNotifyMask);
|
||||||
| PropertyChangeMask | StructureNotifyMask);
|
|
||||||
client_size_hints(c);
|
client_size_hints(c);
|
||||||
titlebar_update(c);
|
titlebar_update(c);
|
||||||
if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
|
if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
|
||||||
@@ -323,7 +323,6 @@ client_moveresize(Client *c, XRectangle geo, bool r)
|
|||||||
|
|
||||||
XMoveResizeWindow(dpy, c->win, geo.x, geo.y,
|
XMoveResizeWindow(dpy, c->win, geo.x, geo.y,
|
||||||
geo.width, geo.height);
|
geo.width, geo.height);
|
||||||
|
|
||||||
if(conf.titlebar.exist)
|
if(conf.titlebar.exist)
|
||||||
titlebar_update_position(c);
|
titlebar_update_position(c);
|
||||||
|
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ titlebar_create(Client *c)
|
|||||||
/* Set titlebar position : Top/Bottom */
|
/* Set titlebar position : Top/Bottom */
|
||||||
switch(conf.titlebar.pos)
|
switch(conf.titlebar.pos)
|
||||||
{
|
{
|
||||||
case Bottom:
|
|
||||||
y = c->geo.y + c->geo.height + conf.client.borderheight;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
case Top:
|
case Top:
|
||||||
y = c->geo.y - (conf.titlebar.height + conf.client.borderheight);
|
y = c->geo.y - conf.titlebar.height;
|
||||||
|
break;
|
||||||
|
case Bottom:
|
||||||
|
y = c->geo.y + c->geo.height + conf.client.borderheight;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user