fix the ultimate bug when restarting awesome, client misdisplayed
[awesome.git] / client.c
blob9cdfcde1451b3c121e2d09f586d0e3cd980c7725
1 /*
2 * client.c - client management
3 *
4 * Copyright © 2007 Julien Danjou <julien@danjou.info>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include <stdio.h>
23 #include <X11/Xatom.h>
24 #include <X11/Xutil.h>
25 #include <X11/extensions/shape.h>
27 #include "screen.h"
28 #include "awesome.h"
29 #include "layout.h"
30 #include "tag.h"
31 #include "util.h"
32 #include "statusbar.h"
34 #include "layouts/floating.h"
36 /* extern */
37 extern Client *clients, *sel, *stack; /* global client list and stack */
39 /** Attach client stack to clients stacks
40 * \param c the client
41 */
42 static inline void
43 attachstack(Client * c)
45 c->snext = stack;
46 stack = c;
49 /** Detach client from stack
50 * \param c the client
52 static inline void
53 detachstack(Client * c)
55 Client **tc;
57 for(tc = &stack; *tc && *tc != c; tc = &(*tc)->snext);
58 *tc = c->snext;
61 /** Grab or ungrab buttons when a client is focused
62 * \param c client
63 * \param focused True if client is focused
64 * \param modkey Mod key mask
65 * \param numlockmask Numlock mask
67 static void
68 grabbuttons(Client * c, Bool focused, KeySym modkey, unsigned int numlockmask)
70 XUngrabButton(c->display, AnyButton, AnyModifier, c->win);
72 if(focused)
74 XGrabButton(c->display, Button1, modkey, c->win, False, BUTTONMASK,
75 GrabModeAsync, GrabModeSync, None, None);
76 XGrabButton(c->display, Button1, modkey | LockMask, c->win, False,
77 BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
78 XGrabButton(c->display, Button1, modkey | numlockmask, c->win, False,
79 BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
80 XGrabButton(c->display, Button1, modkey | numlockmask | LockMask,
81 c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
83 XGrabButton(c->display, Button2, modkey, c->win, False, BUTTONMASK,
84 GrabModeAsync, GrabModeSync, None, None);
85 XGrabButton(c->display, Button2, modkey | LockMask, c->win, False,
86 BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
87 XGrabButton(c->display, Button2, modkey | numlockmask, c->win, False,
88 BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
89 XGrabButton(c->display, Button2, modkey | numlockmask | LockMask,
90 c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
92 XGrabButton(c->display, Button3, modkey, c->win, False, BUTTONMASK,
93 GrabModeAsync, GrabModeSync, None, None);
94 XGrabButton(c->display, Button3, modkey | LockMask, c->win, False,
95 BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
96 XGrabButton(c->display, Button3, modkey | numlockmask, c->win, False,
97 BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
98 XGrabButton(c->display, Button3, modkey | numlockmask | LockMask,
99 c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
101 XUngrabButton(c->display, AnyButton, AnyModifier, RootWindow(c->display, c->screen));
103 else
105 XGrabButton(c->display, AnyButton, AnyModifier, c->win, False, BUTTONMASK,
106 GrabModeAsync, GrabModeSync, None, None);
107 XGrabButton(c->display, Button4, NoSymbol, RootWindow(c->display, c->screen), False, BUTTONMASK,
108 GrabModeAsync, GrabModeSync, None, None);
109 XGrabButton(c->display, Button4, LockMask, RootWindow(c->display, c->screen), False, BUTTONMASK,
110 GrabModeAsync, GrabModeSync, None, None);
111 XGrabButton(c->display, Button4, numlockmask, RootWindow(c->display, c->screen), False, BUTTONMASK,
112 GrabModeAsync, GrabModeSync, None, None);
113 XGrabButton(c->display, Button4, numlockmask | LockMask, RootWindow(c->display, c->screen), False, BUTTONMASK,
114 GrabModeAsync, GrabModeSync, None, None);
116 XGrabButton(c->display, Button5, NoSymbol, RootWindow(c->display, c->screen), False, BUTTONMASK,
117 GrabModeAsync, GrabModeSync, None, None);
118 XGrabButton(c->display, Button5, LockMask, RootWindow(c->display, c->screen), False, BUTTONMASK,
119 GrabModeAsync, GrabModeSync, None, None);
120 XGrabButton(c->display, Button5, numlockmask, RootWindow(c->display, c->screen), False, BUTTONMASK,
121 GrabModeAsync, GrabModeSync, None, None);
122 XGrabButton(c->display, Button5, numlockmask | LockMask, RootWindow(c->display, c->screen), False, BUTTONMASK,
123 GrabModeAsync, GrabModeSync, None, None);
128 /** Check if client supports protocol WM_DELETE_WINDOW
129 * \param c the client
130 * \return True if client has WM_DELETE_WINDOW
132 static Bool
133 isprotodel(Client * c)
135 int i, n;
136 Atom *protocols;
137 Bool ret = False;
139 if(XGetWMProtocols(c->display, c->win, &protocols, &n))
141 for(i = 0; !ret && i < n; i++)
142 if(protocols[i] == XInternAtom(c->display, "WM_DELETE_WINDOW", False))
143 ret = True;
144 XFree(protocols);
146 return ret;
149 /** Set client WM_STATE property
150 * \param c the client
151 * \param state no idea
153 static void
154 setclientstate(Client * c, long state)
156 long data[] = { state, None };
158 XChangeProperty(c->display, c->win, XInternAtom(c->display, "WM_STATE", False),
159 XInternAtom(c->display, "WM_STATE", False), 32,
160 PropModeReplace, (unsigned char *) data, 2);
163 /** Set client transparency using composite
164 * \param c client
165 * \param opacity opacity percentage
167 static void
168 setclienttrans(Client *c, double opacity)
170 unsigned int real_opacity = 0xffffffff;
172 if(opacity >= 0 && opacity <= 100)
174 real_opacity = ((opacity / 100.0) * 0xffffffff);
175 XChangeProperty(c->display, c->win,
176 XInternAtom(c->display, "_NET_WM_WINDOW_OPACITY", False),
177 XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &real_opacity, 1L);
179 else
180 XDeleteProperty(c->display, c->win, XInternAtom(c->display, "_NET_WM_WINDOW_OPACITY", False));
182 XSync(c->display, False);
185 /** Attach client to the beginning of the clients stack
186 * \param c the client
188 inline void
189 attach(Client * c)
191 if(clients)
192 clients->prev = c;
193 c->next = clients;
194 clients = c;
197 inline void
198 updatetitle(Client * c)
200 if(!xgettextprop(c->display, c->win, XInternAtom(c->display, "_NET_WM_NAME", False), c->name, sizeof c->name))
201 xgettextprop(c->display, c->win, XInternAtom(c->display, "WM_NAME", False), c->name, sizeof c->name);
204 /** Ban client
205 * \param c the client
207 void
208 ban(Client * c)
210 XUnmapWindow(c->display, c->win);
211 setclientstate(c, IconicState);
212 c->isbanned = True;
213 c->unmapped = True;
216 /** Configure client
217 * \param c the client
219 void
220 configure(Client * c)
222 XConfigureEvent ce;
224 ce.type = ConfigureNotify;
225 ce.display = c->display;
226 ce.event = c->win;
227 ce.window = c->win;
228 ce.x = c->x;
229 ce.y = c->y;
230 ce.width = c->w;
231 ce.height = c->h;
232 ce.border_width = c->border;
233 ce.above = None;
234 ce.override_redirect = False;
235 XSendEvent(c->display, c->win, False, StructureNotifyMask, (XEvent *) & ce);
238 void
239 detach(Client * c)
241 if(c->prev)
242 c->prev->next = c->next;
243 if(c->next)
244 c->next->prev = c->prev;
245 if(c == clients)
246 clients = c->next;
247 c->next = c->prev = NULL;
250 /** Give focus to client, or to first client if c is NULL
251 * \param disp Display ref
252 * \param drawcontext drawcontext ref
253 * \param c client
254 * \param selscreen True if current screen is selected
255 * \param awesomeconf awesome config
257 void
258 focus(Display *disp, DC *drawcontext, Client * c, Bool selscreen, awesome_config *awesomeconf)
260 /* if c is NULL or invisible, take next client in the stack */
261 if((!c && selscreen) || (c && !isvisible(c, awesomeconf->screen, awesomeconf->selected_tags, awesomeconf->ntags)))
262 for(c = stack; c && !isvisible(c, awesomeconf->screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->snext);
264 /* if a client was selected but it's not the current client, unfocus it */
265 if(sel && sel != c)
267 grabbuttons(sel, False, awesomeconf->modkey, awesomeconf->numlockmask);
268 XSetWindowBorder(sel->display, sel->win, drawcontext->norm[ColBorder]);
269 setclienttrans(sel, awesomeconf->opacity_unfocused);
271 if(c)
273 detachstack(c);
274 attachstack(c);
275 grabbuttons(c, True, awesomeconf->modkey, awesomeconf->numlockmask);
277 if(!selscreen)
278 return;
279 sel = c;
280 drawstatusbar(disp, awesomeconf->screen, drawcontext, awesomeconf);
281 if(sel)
283 XSetWindowBorder(sel->display, sel->win, drawcontext->sel[ColBorder]);
284 XSetInputFocus(sel->display, sel->win, RevertToPointerRoot, CurrentTime);
285 for(c = stack; c; c = c->snext)
286 if(c != sel)
287 setclienttrans(c, awesomeconf->opacity_unfocused);
288 setclienttrans(sel, -1);
290 else
291 XSetInputFocus(disp, RootWindow(disp, awesomeconf->screen), RevertToPointerRoot, CurrentTime);
294 /** Kill selected client
295 * \param disp Display ref
296 * \param awesomeconf awesome config
297 * \param arg unused
298 * \ingroup ui_callback
300 void
301 uicb_killclient(Display *disp __attribute__ ((unused)),
302 DC *drawcontext __attribute__ ((unused)),
303 awesome_config *awesomeconf __attribute__ ((unused)),
304 const char *arg __attribute__ ((unused)))
306 XEvent ev;
308 if(!sel)
309 return;
310 if(isprotodel(sel))
312 ev.type = ClientMessage;
313 ev.xclient.window = sel->win;
314 ev.xclient.message_type = XInternAtom(disp, "WM_PROTOCOLS", False);
315 ev.xclient.format = 32;
316 ev.xclient.data.l[0] = XInternAtom(disp, "WM_DELETE_WINDOW", False);
317 ev.xclient.data.l[1] = CurrentTime;
318 XSendEvent(sel->display, sel->win, False, NoEventMask, &ev);
320 else
321 XKillClient(sel->display, sel->win);
324 static Bool
325 loadprops(Client * c, int ntags)
327 int i;
328 char *prop;
329 Bool result = False;
331 prop = p_new(char, ntags + 2);
333 if(xgettextprop(c->display, c->win, AWESOMEPROPS_ATOM(c->display), prop, ntags + 2))
335 for(i = 0; i < ntags && prop[i]; i++)
336 if((c->tags[i] = prop[i] == '1'))
337 result = True;
338 if(i <= ntags && prop[i])
339 c->isfloating = prop[i] == '1';
342 p_delete(&prop);
344 return result;
347 void
348 manage(Display * disp, DC *drawcontext, Window w, XWindowAttributes * wa, awesome_config *awesomeconf)
350 int i;
351 Client *c, *t = NULL;
352 Window trans;
353 Status rettrans;
354 XWindowChanges wc;
356 c = p_new(Client, 1);
357 c->tags = p_new(Bool, awesomeconf->ntags);
358 c->win = w;
359 c->ftview = True;
360 c->x = c->rw = wa->x;
361 c->y = c->ry = wa->y;
362 c->w = c->rw = wa->width;
363 c->h = c->rh = wa->height;
364 c->oldborder = wa->border_width;
365 c->display = disp;
366 c->screen = awesomeconf->screen;
367 if(c->w == DisplayWidth(disp, c->screen)
368 && c->h == DisplayHeight(disp, c->screen))
370 c->x = 0;
371 c->y = 0;
372 c->border = wa->border_width;
374 else
376 ScreenInfo *si = get_display_info(disp, c->screen, awesomeconf->statusbar);
378 if(c->x + c->w + 2 * c->border > si->x_org + si->width)
379 c->x = c->rx = si->x_org + si->width - c->w - 2 * c->border;
380 if(c->y + c->h + 2 * c->border > si->y_org + si->height)
381 c->y = c->ry = si->y_org + si->height - c->h - 2 * c->border;
382 if(c->x < si->x_org)
383 c->x = c->rx = si->x_org;
384 if(c->y < si->y_org)
385 c->y = c->ry = si->y_org;
386 c->border = awesomeconf->borderpx;
387 XFree(si);
389 wc.border_width = c->border;
390 XConfigureWindow(disp, w, CWBorderWidth, &wc);
391 XSetWindowBorder(disp, w, drawcontext->norm[ColBorder]);
392 configure(c); /* propagates border_width, if size doesn't change */
393 updatesizehints(c);
394 XSelectInput(disp, w, StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
395 if(awesomeconf->have_shape)
397 XShapeSelectInput(disp, w, ShapeNotifyMask);
398 set_shape(c);
400 grabbuttons(c, False, awesomeconf->modkey, awesomeconf->numlockmask);
401 updatetitle(c);
402 if((rettrans = XGetTransientForHint(disp, w, &trans) == Success))
403 for(t = clients; t && t->win != trans; t = t->next);
404 if(t)
405 for(i = 0; i < awesomeconf->ntags; i++)
406 c->tags[i] = t->tags[i];
407 if(!loadprops(c, awesomeconf->ntags))
408 applyrules(c, awesomeconf);
409 if(!c->isfloating)
410 c->isfloating = (rettrans == Success) || c->isfixed;
411 saveprops(c, awesomeconf->ntags);
412 attach(c);
413 attachstack(c);
414 XMoveResizeWindow(disp, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
415 c->isbanned = True;
416 arrange(disp, drawcontext, awesomeconf);
419 void
420 resize(Client * c, int x, int y, int w, int h, Bool sizehints)
422 double dx, dy, max, min, ratio;
423 XWindowChanges wc;
425 if(sizehints)
427 if(c->minay > 0 && c->maxay > 0 && (h - c->baseh) > 0 && (w - c->basew) > 0)
429 dx = (double) (w - c->basew);
430 dy = (double) (h - c->baseh);
431 min = (double) (c->minax) / (double) (c->minay);
432 max = (double) (c->maxax) / (double) (c->maxay);
433 ratio = dx / dy;
434 if(max > 0 && min > 0 && ratio > 0)
436 if(ratio < min)
438 dy = (dx * min + dy) / (min * min + 1);
439 dx = dy * min;
440 w = (int) dx + c->basew;
441 h = (int) dy + c->baseh;
443 else if(ratio > max)
445 dy = (dx * min + dy) / (max * max + 1);
446 dx = dy * min;
447 w = (int) dx + c->basew;
448 h = (int) dy + c->baseh;
452 if(c->minw && w < c->minw)
453 w = c->minw;
454 if(c->minh && h < c->minh)
455 h = c->minh;
456 if(c->maxw && w > c->maxw)
457 w = c->maxw;
458 if(c->maxh && h > c->maxh)
459 h = c->maxh;
460 if(c->incw)
461 w -= (w - c->basew) % c->incw;
462 if(c->inch)
463 h -= (h - c->baseh) % c->inch;
465 if(w <= 0 || h <= 0)
466 return;
467 /* offscreen appearance fixes */
468 if(x > DisplayWidth(c->display, c->screen))
469 x = DisplayWidth(c->display, c->screen) - w - 2 * c->border;
470 if(y > DisplayHeight(c->display, c->screen))
471 y = DisplayHeight(c->display, c->screen) - h - 2 * c->border;
472 if(x + w + 2 * c->border < 0)
473 x = 0;
474 if(y + h + 2 * c->border < 0)
475 y = 0;
476 if(c->x != x || c->y != y || c->w != w || c->h != h)
478 c->x = wc.x = x;
479 c->y = wc.y = y;
480 c->w = wc.width = w;
481 c->h = wc.height = h;
482 wc.border_width = c->border;
483 XConfigureWindow(c->display, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
484 configure(c);
485 XSync(c->display, False);
489 void
490 uicb_moveresize(Display *disp __attribute__ ((unused)),
491 DC *drawcontext __attribute__ ((unused)),
492 awesome_config *awesomeconf,
493 const char *arg)
495 int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh;
496 char xabs, yabs, wabs, habs;
497 int mx, my, dx, dy, nmx, nmy;
498 unsigned int dui;
499 Window dummy;
501 if(!IS_ARRANGE(floating))
502 if(!sel || !sel->isfloating || sel->isfixed || !arg)
503 return;
504 if(sscanf(arg, "%d%c %d%c %d%c %d%c", &x, &xabs, &y, &yabs, &w, &wabs, &h, &habs) != 8)
505 return;
506 nx = xabs == 'x' ? sel->x + x : x;
507 ny = yabs == 'y' ? sel->y + y : y;
508 nw = wabs == 'w' ? sel->w + w : w;
509 nh = habs == 'h' ? sel->h + h : h;
511 ox = sel->x;
512 oy = sel->y;
513 ow = sel->w;
514 oh = sel->h;
516 Bool xqp = XQueryPointer(sel->display, RootWindow(sel->display, sel->screen), &dummy, &dummy, &mx, &my, &dx, &dy, &dui);
517 resize(sel, nx, ny, nw, nh, True);
518 if (xqp && ox <= mx && (ox + ow) >= mx && oy <= my && (oy + oh) >= my)
520 nmx = mx-ox+sel->w-ow-1 < 0 ? 0 : mx-ox+sel->w-ow-1;
521 nmy = my-oy+sel->h-oh-1 < 0 ? 0 : my-oy+sel->h-oh-1;
522 XWarpPointer(sel->display, None, sel->win, 0, 0, 0, 0, nmx, nmy);
526 void
527 saveprops(Client * c, int ntags)
529 int i;
530 char *prop;
532 prop = p_new(char, ntags + 2);
534 for(i = 0; i < ntags; i++)
535 prop[i] = c->tags[i] ? '1' : '0';
537 if(i <= ntags)
538 prop[i] = c->isfloating ? '1' : '0';
540 prop[++i] = '\0';
542 XChangeProperty(c->display, c->win, AWESOMEPROPS_ATOM(c->display), XA_STRING, 8,
543 PropModeReplace, (unsigned char *) prop, i);
545 p_delete(&prop);
548 void
549 unban(Client * c)
551 XMapWindow(c->display, c->win);
552 setclientstate(c, NormalState);
553 c->isbanned = False;
554 c->unmapped = False;
557 void
558 unmanage(Client * c, DC *drawcontext, long state, awesome_config *awesomeconf)
560 XWindowChanges wc;
562 c->unmapped = True;
563 wc.border_width = c->oldborder;
564 /* The server grab construct avoids race conditions. */
565 XGrabServer(c->display);
566 XConfigureWindow(c->display, c->win, CWBorderWidth, &wc); /* restore border */
567 detach(c);
568 detachstack(c);
569 if(sel == c)
570 focus(c->display, drawcontext, NULL, True, awesomeconf);
571 XUngrabButton(c->display, AnyButton, AnyModifier, c->win);
572 setclientstate(c, state);
573 XSync(c->display, False);
574 XSetErrorHandler(xerror);
575 XUngrabServer(c->display);
576 if(state != NormalState)
577 arrange(c->display, drawcontext, awesomeconf);
578 p_delete(&c->tags);
579 p_delete(&c);
582 void
583 updatesizehints(Client * c)
585 long msize;
586 XSizeHints size;
588 if(!XGetWMNormalHints(c->display, c->win, &size, &msize) || !size.flags)
589 size.flags = PSize;
590 c->flags = size.flags;
591 if(c->flags & PBaseSize)
593 c->basew = size.base_width;
594 c->baseh = size.base_height;
596 else if(c->flags & PMinSize)
598 c->basew = size.min_width;
599 c->baseh = size.min_height;
601 else
602 c->basew = c->baseh = 0;
603 if(c->flags & PResizeInc)
605 c->incw = size.width_inc;
606 c->inch = size.height_inc;
608 else
609 c->incw = c->inch = 0;
611 if(c->flags & PMaxSize)
613 c->maxw = size.max_width;
614 c->maxh = size.max_height;
616 else
617 c->maxw = c->maxh = 0;
619 if(c->flags & PMinSize)
621 c->minw = size.min_width;
622 c->minh = size.min_height;
624 else if(c->flags & PBaseSize)
626 c->minw = size.base_width;
627 c->minh = size.base_height;
629 else
630 c->minw = c->minh = 0;
632 if(c->flags & PAspect)
634 c->minax = size.min_aspect.x;
635 c->maxax = size.max_aspect.x;
636 c->minay = size.min_aspect.y;
637 c->maxay = size.max_aspect.y;
639 else
640 c->minax = c->maxax = c->minay = c->maxay = 0;
642 c->isfixed = (c->maxw && c->minw && c->maxh && c->minh
643 && c->maxw == c->minw && c->maxh == c->minh);
646 void
647 set_shape(Client *c)
649 int bounding_shaped;
650 int i, b; unsigned int u; /* dummies */
651 /* Logic to decide if we have a shaped window cribbed from fvwm-2.5.10. */
652 if (XShapeQueryExtents(c->display, c->win, &bounding_shaped, &i, &i,
653 &u, &u, &b, &i, &i, &u, &u) && bounding_shaped)
654 XShapeCombineShape(c->display, RootWindow(c->display, c->screen), ShapeBounding, 0, 0, c->win, ShapeBounding, ShapeSet);
657 void
658 uicb_settrans(Display *disp __attribute__ ((unused)),
659 DC *drawcontext __attribute__ ((unused)),
660 awesome_config *awesomeconf __attribute__ ((unused)),
661 const char *arg)
663 double delta = 100.0, current_opacity = 0.0;
664 unsigned char *data;
665 Atom actual;
666 int format;
667 unsigned long n, left;
668 unsigned int current_opacity_raw = 0;
669 int set_prop = 0;
671 if(!sel)
672 return;
674 XGetWindowProperty(sel->display, sel->win, XInternAtom(sel->display, "_NET_WM_WINDOW_OPACITY", False),
675 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left,
676 (unsigned char **) &data);
677 if(data)
679 memcpy(&current_opacity_raw, data, sizeof(unsigned int));
680 XFree(data);
681 current_opacity = (current_opacity_raw * 100.0) / 0xffffffff;
683 else
684 set_prop = 1;
686 delta = compute_new_value_from_arg(arg, current_opacity);
688 if(delta <= 0.0)
689 delta = 0.0;
690 else if(delta > 100.0)
692 delta = 100.0;
693 set_prop = 1;
696 if(delta == 100.0 && !set_prop)
697 setclienttrans(sel, -1);
698 else
699 setclienttrans(sel, delta);
703 /** Set borrder size
704 * \param disp Display ref
705 * \param drawcontext Drawcontext ref
706 * \param awesomeconf awesome config
707 * \param arg X, +X or -X
709 void
710 uicb_setborder(Display *disp __attribute__ ((unused)),
711 DC *drawcontext __attribute__ ((unused)),
712 awesome_config *awesomeconf,
713 const char *arg)
715 if(!arg)
716 return;
718 if((awesomeconf->borderpx = (int) compute_new_value_from_arg(arg, (double) awesomeconf->borderpx)) < 0)
719 awesomeconf->borderpx = 0;