{
XUnmapEvent* ev = &(e->xunmap);
Client* c = client_get(ev->window, NULL);
- if (c && c->win == ev->window)
+ if (c && c->win == ev->window && !(c->flags & F_SHADED))
{
XUnmapWindow(X.disp, c->frame);
}
enum {
F_WM_DELETE = (1 << 0),
F_DIALOG = (1 << 1),
+ F_SHADED = (1 << 2),
};
typedef struct Client {
void client_focus(Client* c);
void client_show(Client* c, int show);
void client_readprops(Client* c);
+void client_shade(Client* c);
/* mouse.c */
void mouse_click(XButtonEvent* ev, Location* loc);
c->h += ydiff;
if (c->w < 50) c->w = 50;
if (c->h < 50) c->h = 50;
- XResizeWindow(X.disp, c->frame, c->w, c->h);
- XResizeWindow(X.disp, c->win,
- c->w - 2*BORDER_WIDTH - 2,
- c->h - 2*BORDER_WIDTH - TITLE_HEIGHT - 2
- );
+ if (c->flags & F_SHADED)
+ {
+ XResizeWindow(X.disp, c->frame, c->w, TITLE_HEIGHT+BORDER_WIDTH);
+ }
+ else
+ {
+ XResizeWindow(X.disp, c->frame, c->w, c->h);
+ XResizeWindow(X.disp, c->win,
+ c->w - 2*BORDER_WIDTH - 2,
+ c->h - 2*BORDER_WIDTH - TITLE_HEIGHT - 2
+ );
+ }
mons_place(c);
}
}
xfree(protos);
}
+
+void client_shade(Client* c)
+{
+ if (c->flags & F_SHADED)
+ {
+ c->flags &= ~F_SHADED;
+ XMapWindow(X.disp, c->win);
+ }
+ else
+ {
+ c->flags |= F_SHADED;
+ XUnmapWindow(X.disp, c->win);
+ }
+ client_adjust(c);
+}
static void float_click(XButtonEvent* ev, Location* loc)
{
- if (ev->button == Button2)
+ if ((ev->button == Button1) && (ev->y > (TITLE_HEIGHT + BORDER_WIDTH)))
+ {
+ X.mode = M_RESIZE;
+ warp_mouse(loc->client);
+ }
+ else if (ev->button == Button2)
{
client_close(loc->client);
}
+ else if (ev->button == Button3)
+ {
+ client_shade(loc->client);
+ }
else if (ev->button == Button4)
{
mons_lower(loc->monitor, loc->client);
else if (ev->button == Button5)
{
mons_raise(loc->monitor, loc->client);
- if (ev->y > (TITLE_HEIGHT + BORDER_WIDTH))
- {
- X.mode = M_RESIZE;
- warp_mouse(loc->client);
- }
}
}