titlebar: Fix titlebar base size

This commit is contained in:
Martin Duquesnoy 2008-11-06 20:26:03 +01:00
parent b5ba311576
commit 64f450d6ec
3 changed files with 16 additions and 12 deletions

View File

@ -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.background_pixmap = ParentRelative;
if(entermask)
at.event_mask = ButtonPressMask | ExposureMask | EnterWindowMask;
at.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
ButtonPressMask | ExposureMask | EnterWindowMask |
LeaveWindowMask | StructureNotifyMask;
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),
CopyFromParent, DefaultVisual(dpy, screen),
CWOverrideRedirect | CWBackPixmap | CWEventMask, &at);
bw->dr = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
bw->geo.x = x; bw->geo.y = y;
bw->geo.width = w; bw->geo.height = h;
bw->geo.x = x;
bw->geo.y = y;
bw->geo.width = w;
bw->geo.height = h;
bw->bord = bord;
bw->color = color;

View File

@ -238,8 +238,8 @@ client_manage(Window w, XWindowAttributes *wa)
XConfigureWindow(dpy, w, CWBorderWidth, &winc);
XSetWindowBorder(dpy, w, conf.client.bordernormal);
grabbuttons(c, False);
XSelectInput(dpy, w, EnterWindowMask | FocusChangeMask
| PropertyChangeMask | StructureNotifyMask);
XSelectInput(dpy, w, EnterWindowMask | FocusChangeMask | PropertyChangeMask | StructureNotifyMask);
client_size_hints(c);
titlebar_update(c);
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,
geo.width, geo.height);
if(conf.titlebar.exist)
titlebar_update_position(c);

View File

@ -40,12 +40,12 @@ titlebar_create(Client *c)
/* Set titlebar position : Top/Bottom */
switch(conf.titlebar.pos)
{
case Bottom:
y = c->geo.y + c->geo.height + conf.client.borderheight;
break;
default:
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;
}