aboutsummaryrefslogtreecommitdiff
path: root/monsterwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-07-09 22:55:45 +0300
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-07-20 18:52:17 +0300
commit1390645281b2efed42c401ea069a6c054947b41c (patch)
tree8c0abeaf7a747721a0eb80553b9a6980afc01e6a /monsterwm.c
parentb3843f04023113569654e64cae12c86f1b77c09c (diff)
rework setfullscreen function - accept desktop arg
no need to use XWindowChanges and XConfigureWindow all we want is to change the border width, which can be achieved with XSetWindowBorderWidth. we need to know how many clients are on the given desktop, because if there's only one, then there shouldn't be a BORDER_WIDTH border.
Diffstat (limited to 'monsterwm.c')
-rw-r--r--monsterwm.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/monsterwm.c b/monsterwm.c
index c923ab1..bbee69c 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -134,7 +134,7 @@ static void propertynotify(XEvent *e);
static void quit();
static void removeclient(Client *c, Desktop *d);
static void run(void);
-static void setfullscreen(Client *c, Bool fullscrn);
+static void setfullscreen(Client *c, Desktop *d, Bool fullscrn);
static void setup(void);
static void sigchld();
static void spawn(const Arg *arg);
@@ -275,7 +275,7 @@ void clientmessage(XEvent *e) {
if (e->xclient.message_type == netatoms[NET_WM_STATE] && (
(unsigned)e->xclient.data.l[1] == netatoms[NET_FULLSCREEN]
|| (unsigned)e->xclient.data.l[2] == netatoms[NET_FULLSCREEN])) {
- setfullscreen(c, (e->xclient.data.l[0] == 1 || (e->xclient.data.l[0] == 2 && !c->isfull)));
+ setfullscreen(c, d, (e->xclient.data.l[0] == 1 || (e->xclient.data.l[0] == 2 && !c->isfull)));
if (!(c->isfloat || c->istrans) || !d->head->next) tile(d);
} else if (e->xclient.message_type == netatoms[NET_ACTIVE]) focus(c, d);
}
@@ -524,7 +524,7 @@ void maprequest(XEvent *e) {
int di; unsigned long dl; unsigned char *state = NULL; Atom da;
if (XGetWindowProperty(dis, c->win, netatoms[NET_WM_STATE], 0L, sizeof da,
False, XA_ATOM, &da, &di, &dl, &dl, &state) == Success && state)
- setfullscreen(c, (*(Atom *)state == netatoms[NET_FULLSCREEN]));
+ setfullscreen(c, d, (*(Atom *)state == netatoms[NET_FULLSCREEN]));
if (state) XFree(state);
if (currdeskidx == newdsk) { if (!ISFFT(c)) tile(d); XMapWindow(dis, c->win); }
@@ -728,13 +728,12 @@ void run(void) {
}
/* set or unset fullscreen state of client */
-void setfullscreen(Client *c, Bool fullscrn) {
+void setfullscreen(Client *c, Desktop *d, Bool fullscrn) {
if (fullscrn != c->isfull) XChangeProperty(dis, c->win,
netatoms[NET_WM_STATE], XA_ATOM, 32, PropModeReplace, (unsigned char*)
((c->isfull = fullscrn) ? &netatoms[NET_FULLSCREEN]:0), fullscrn);
if (fullscrn) XMoveResizeWindow(dis, c->win, 0, 0, ww, wh + PANEL_HEIGHT);
- XWindowChanges xwc = { 0, 0, 0, 0, fullscrn ? 0:BORDER_WIDTH, 0, 0 };
- XConfigureWindow(dis, c->win, CWBorderWidth, &xwc);
+ XSetWindowBorderWidth(dis, c->win, (c->isfull || !d->head->next ? 0:BORDER_WIDTH));
}
/* set initial values