From 64f450d6ec0aeed17247bf5d2d8df99ea05dc3b0 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Thu, 6 Nov 2008 20:26:03 +0100 Subject: [PATCH] titlebar: Fix titlebar base size --- src/bar.c | 15 ++++++++++----- src/client.c | 5 ++--- src/titlebar.c | 8 ++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/bar.c b/src/bar.c index aa91398..ae97b89 100644 --- a/src/bar.c +++ b/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.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; diff --git a/src/client.c b/src/client.c index 4373019..67d015e 100644 --- a/src/client.c +++ b/src/client.c @@ -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); diff --git a/src/titlebar.c b/src/titlebar.c index f900c68..1001ab7 100644 --- a/src/titlebar.c +++ b/src/titlebar.c @@ -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; }