print unknown command in config files on stderr
[awesome.git] / client.c
blobbd91baac01d6c9861561a6520b6a103704d8942c
1 /*
2 * client.c - client management
4 * Copyright © 2007 Julien Danjou <julien@danjou.info>
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/extensions/shape.h>
26 #include "screen.h"
27 #include "awesome.h"
28 #include "layout.h"
29 #include "tag.h"
30 #include "rules.h"
31 #include "util.h"
32 #include "statusbar.h"
33 #include "window.h"
34 #include "layouts/floating.h"
36 /** Get a Client by its window
37 * \param list Client list to look info
38 * \param w Client window to find
39 * \return client
41 Client *
42 get_client_bywin(Client *list, Window w)
44 Client *c;
46 for(c = list; c && c->win != w; c = c->next);
47 return c;
50 /** Check if client supports protocol WM_DELETE_WINDOW
51 * \param c the client
52 * \return True if client has WM_DELETE_WINDOW
54 static Bool
55 isprotodel(Display *disp, Window win)
57 int i, n;
58 Atom *protocols;
59 Bool ret = False;
61 if(XGetWMProtocols(disp, win, &protocols, &n))
63 for(i = 0; !ret && i < n; i++)
64 if(protocols[i] == XInternAtom(disp, "WM_DELETE_WINDOW", False))
65 ret = True;
66 XFree(protocols);
68 return ret;
71 /** Swap two client in the linked list clients
72 * \param c1 first client
73 * \param c2 second client
75 static void
76 client_swap(Client **head, Client *c1, Client *c2)
78 Client *tmp;
80 tmp = c1->next;
81 c1->next = c2->next;
82 c2->next = (tmp == c2 ? c1 : tmp);
84 tmp = c2->prev;
85 c2->prev = c1->prev;
86 c1->prev = (tmp == c1 ? c2 : tmp );
88 if(c1->next)
89 c1->next->prev = c1;
91 if(c1->prev)
92 c1->prev->next = c1;
94 if(c2->next)
95 c2->next->prev = c2;
97 if(c2->prev)
98 c2->prev->next = c2;
100 if(*head == c1)
101 *head = c2;
104 void
105 updatetitle(Client *c)
107 if(!xgettextprop(c->display, c->win, XInternAtom(c->display, "_NET_WM_NAME", False), c->name, sizeof(c->name)))
108 xgettextprop(c->display, c->win, XInternAtom(c->display, "WM_NAME", False), c->name, sizeof(c->name));
111 /** Ban client and unmapped it
112 * \param c the client
114 void
115 client_ban(Client * c)
117 XUnmapWindow(c->display, c->win);
118 window_setstate(c->display, c->win, IconicState);
121 /** Attach client after another one
122 * \param client to attach to
123 * \param c the client
125 void
126 client_reattach_after(Client *head, Client *c)
128 if(head->next == c)
129 return;
131 if(head->next)
132 head->next->prev = c;
134 if(c->prev)
135 c->prev->next = c->next;
137 c->next = head->next;
138 head->next = c;
139 c->prev = head;
142 /** Attach client to the beginning of the clients stack
143 * \param head client list
144 * \param c the client
146 void
147 client_attach(Client **head, Client *c)
149 if(*head)
150 (*head)->prev = c;
151 c->next = *head;
152 *head = c;
155 /** Detach client from clients list
156 * \param head client list
157 * \param c client to detach
159 void
160 client_detach(Client **head, Client *c)
162 if(c->prev)
163 c->prev->next = c->next;
164 if(c->next)
165 c->next->prev = c->prev;
166 if(c == *head)
167 *head = c->next;
168 c->next = c->prev = NULL;
171 /** Give focus to client, or to first client if c is NULL
172 * \param c client
173 * \param selscreen True if current screen is selected
174 * \param awesomeconf awesome config
176 void
177 focus(Client *c, Bool selscreen, awesome_config *awesomeconf)
179 int i;
180 Tag *tag = get_current_tag(awesomeconf->tags, awesomeconf->ntags);
182 /* if c is NULL or invisible, take next client in the stack */
183 if((!c && selscreen) || (c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags)))
184 for(c = *awesomeconf->clients; c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); c = c->next);
186 /* XXX unfocus other tags clients, this is a bit too much */
187 for(i = 0; i < awesomeconf->ntags; i++)
188 if(awesomeconf->tags[i].client_sel)
190 window_grabbuttons(awesomeconf->tags[i].client_sel->display,
191 awesomeconf->tags[i].client_sel->phys_screen,
192 awesomeconf->tags[i].client_sel->win,
193 False, True, awesomeconf->buttons.root,
194 awesomeconf->buttons.client, awesomeconf->numlockmask);
195 XSetWindowBorder(awesomeconf->tags[i].client_sel->display,
196 awesomeconf->tags[i].client_sel->win,
197 awesomeconf->colors_normal[ColBorder].pixel);
198 window_settrans(awesomeconf->tags[i].client_sel->display,
199 awesomeconf->tags[i].client_sel->win, awesomeconf->opacity_unfocused);
201 if(c)
203 XSetWindowBorder(awesomeconf->display, c->win, awesomeconf->colors_selected[ColBorder].pixel);
204 window_grabbuttons(c->display, c->phys_screen, c->win,
205 True, True, awesomeconf->buttons.root,
206 awesomeconf->buttons.client, awesomeconf->numlockmask);
208 if(!selscreen)
209 return;
210 tag->client_sel = c;
211 drawstatusbar(awesomeconf);
212 if(tag->client_sel)
214 XSetInputFocus(tag->client_sel->display, tag->client_sel->win, RevertToPointerRoot, CurrentTime);
215 for(c = *awesomeconf->clients; c; c = c->next)
216 if(c != tag->client_sel)
217 window_settrans(awesomeconf->display, tag->client_sel->win, awesomeconf->opacity_unfocused);
218 window_settrans(awesomeconf->display, tag->client_sel->win, -1);
220 else
221 XSetInputFocus(awesomeconf->display, RootWindow(awesomeconf->display, awesomeconf->phys_screen), RevertToPointerRoot, CurrentTime);
225 /** Load windows properties, restoring client's tag
226 * and floating state before awesome was restarted if any
227 * \todo this may bug if number of tags is != than before
228 * \param c Client ref
229 * \param ntags tags number
231 Bool
232 loadprops(Client * c, int ntags)
234 int i;
235 char *prop;
236 Bool result = False;
238 prop = p_new(char, ntags + 2);
240 if(xgettextprop(c->display, c->win, AWESOMEPROPS_ATOM(c->display), prop, ntags + 2))
242 for(i = 0; i < ntags && prop[i]; i++)
243 if((c->tags[i] = prop[i] == '1'))
244 result = True;
245 if(i <= ntags && prop[i])
246 c->isfloating = prop[i] == '1';
249 p_delete(&prop);
251 return result;
254 /** Manage a new client
255 * \param w The window
256 * \param wa Window attributes
257 * \param awesomeconf awesome config
259 void
260 client_manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
262 int i;
263 Client *c, *t = NULL;
264 Window trans;
265 Status rettrans;
266 XWindowChanges wc;
267 ScreenInfo *screen_info;
268 awesome_config *current_acf = awesomeconf;
270 c = p_new(Client, 1);
272 c->win = w;
273 c->x = c->rx = wa->x;
274 c->y = c->ry = wa->y;
275 c->w = c->rw = wa->width;
276 c->h = c->rh = wa->height;
277 c->oldborder = wa->border_width;
279 c->display = awesomeconf->display;
280 c->phys_screen = awesomeconf->phys_screen;
281 tag_client_with_current_selected(c, awesomeconf);
283 /* update window title */
284 updatetitle(c);
286 c->screen = get_screen_bycoord(c->display, c->x, c->y);
287 /* loadprops or apply rules if no props */
288 if(!loadprops(c, awesomeconf->ntags))
290 Rule *r;
291 Bool matched = False, has_rule = False;
292 for(r = current_acf->rules; r; r = r->next)
293 if(client_match_rule(c, r))
295 has_rule = True;
297 c->isfloating = r->isfloating;
299 if(r->screen != RULE_NOSCREEN && r->screen != c->screen)
301 current_acf = &awesomeconf[r->screen - awesomeconf->screen];
302 tag_client_with_current_selected(c, current_acf);
303 move_client_to_screen(c, current_acf, True);
306 for(i = 0; i < current_acf->ntags; i++)
307 if(is_tag_match_rules(&current_acf->tags[i], r))
309 matched = True;
310 c->tags[i] = True;
312 else
313 c->tags[i] = False;
315 if(!matched)
316 tag_client_with_current_selected(c, current_acf);
317 break;
319 if(!has_rule)
321 tag_client_with_current_selected(c, current_acf);
322 move_client_to_screen(c, current_acf, True);
326 screen_info = get_screen_info(current_acf->display, current_acf->screen, NULL);
327 /* if window request fullscreen mode */
328 if(c->w == screen_info[current_acf->screen].width && c->h == screen_info[current_acf->screen].height)
330 c->x = screen_info[current_acf->screen].x_org;
331 c->y = screen_info[current_acf->screen].y_org;
333 c->border = wa->border_width;
335 else
337 ScreenInfo *display_info = get_display_info(c->display, c->phys_screen, &current_acf->statusbar);
339 if(c->x + c->w + 2 * c->border > display_info->x_org + display_info->width)
340 c->x = c->rx = display_info->x_org + display_info->width - c->w - 2 * c->border;
341 if(c->y + c->h + 2 * c->border > display_info->y_org + display_info->height)
342 c->y = c->ry = display_info->y_org + display_info->height - c->h - 2 * c->border;
343 if(c->x < display_info->x_org)
344 c->x = c->rx = display_info->x_org;
345 if(c->y < display_info->y_org)
346 c->y = c->ry = display_info->y_org;
348 c->border = current_acf->borderpx;
350 p_delete(&display_info);
352 p_delete(&screen_info);
354 /* set borders */
355 wc.border_width = c->border;
356 XConfigureWindow(c->display, w, CWBorderWidth, &wc);
357 XSetWindowBorder(c->display, w, current_acf->colors_normal[ColBorder].pixel);
359 /* propagates border_width, if size doesn't change */
360 window_configure(c->display, c->win, c->x, c->y, c->w, c->h, c->border);
362 /* update sizehint */
363 updatesizehints(c);
365 XSelectInput(c->display, w, StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
367 /* handle xshape */
368 if(current_acf->have_shape)
370 XShapeSelectInput(c->display, w, ShapeNotifyMask);
371 window_setshape(c->display, c->phys_screen, c->win);
374 /* grab buttons */
375 window_grabbuttons(c->display, c->phys_screen, c->win,
376 False, True, current_acf->buttons.root,
377 current_acf->buttons.client, current_acf->numlockmask);
379 move_client_to_screen(c, current_acf, True);
381 /* check for transient and set tags like its parent */
382 if((rettrans = XGetTransientForHint(c->display, w, &trans) == Success)
383 && (t = get_client_bywin(*current_acf->clients, trans)))
384 for(i = 0; i < current_acf->ntags; i++)
385 c->tags[i] = t->tags[i];
387 /* should be floating if transsient or fixed) */
388 if(!c->isfloating)
389 c->isfloating = (rettrans == Success) || c->isfixed;
391 /* save new props */
392 saveprops(c, current_acf->ntags);
394 /* attach to the stack */
395 client_attach(current_acf->clients, c);
397 /* some windows require this */
398 XMoveResizeWindow(c->display, c->win, c->x, c->y, c->w, c->h);
400 focus(c, True, current_acf);
402 /* rearrange to display new window */
403 arrange(current_acf);
406 void
407 client_resize(Client *c, int x, int y, int w, int h, awesome_config *awesomeconf,
408 Bool sizehints, Bool volatile_coords)
410 double dx, dy, max, min, ratio;
411 XWindowChanges wc;
412 ScreenInfo *si;
414 if(sizehints)
416 if(c->minay > 0 && c->maxay > 0 && (h - c->baseh) > 0 && (w - c->basew) > 0)
418 dx = (double) (w - c->basew);
419 dy = (double) (h - c->baseh);
420 min = (double) (c->minax) / (double) (c->minay);
421 max = (double) (c->maxax) / (double) (c->maxay);
422 ratio = dx / dy;
423 if(max > 0 && min > 0 && ratio > 0)
425 if(ratio < min)
427 dy = (dx * min + dy) / (min * min + 1);
428 dx = dy * min;
429 w = (int) dx + c->basew;
430 h = (int) dy + c->baseh;
432 else if(ratio > max)
434 dy = (dx * min + dy) / (max * max + 1);
435 dx = dy * min;
436 w = (int) dx + c->basew;
437 h = (int) dy + c->baseh;
441 if(c->minw && w < c->minw)
442 w = c->minw;
443 if(c->minh && h < c->minh)
444 h = c->minh;
445 if(c->maxw && w > c->maxw)
446 w = c->maxw;
447 if(c->maxh && h > c->maxh)
448 h = c->maxh;
449 if(c->incw)
450 w -= (w - c->basew) % c->incw;
451 if(c->inch)
452 h -= (h - c->baseh) % c->inch;
454 if(w <= 0 || h <= 0)
455 return;
456 /* offscreen appearance fixes */
457 si = get_display_info(c->display, c->phys_screen, NULL);
458 if(x > si->width)
459 x = si->width - w - 2 * c->border;
460 if(y > si->height)
461 y = si->height - h - 2 * c->border;
462 p_delete(&si);
463 if(x + w + 2 * c->border < 0)
464 x = 0;
465 if(y + h + 2 * c->border < 0)
466 y = 0;
467 if(c->x != x || c->y != y || c->w != w || c->h != h)
469 c->x = wc.x = x;
470 c->y = wc.y = y;
471 c->w = wc.width = w;
472 c->h = wc.height = h;
473 if(!volatile_coords
474 && (c->isfloating
475 || get_current_layout(awesomeconf->tags, awesomeconf->ntags)->arrange == layout_floating))
477 c->rx = c->x;
478 c->ry = c->y;
479 c->rw = c->w;
480 c->rh = c->h;
482 wc.border_width = c->border;
483 XConfigureWindow(c->display, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
484 window_configure(c->display, c->win, c->x, c->y, c->w, c->h, c->border);
485 XSync(c->display, False);
486 if((c->x >= 0 || c->y >= 0) && XineramaIsActive(c->display))
488 int new_screen = get_screen_bycoord(c->display, c->x, c->y);
489 if(c->screen != new_screen)
491 tag_client_with_current_selected(c, &awesomeconf[new_screen - awesomeconf->screen]);
492 move_client_to_screen(c, &awesomeconf[new_screen - awesomeconf->screen], False);
498 void
499 saveprops(Client * c, int ntags)
501 int i;
502 char *prop;
504 prop = p_new(char, ntags + 2);
506 for(i = 0; i < ntags; i++)
507 prop[i] = c->tags[i] ? '1' : '0';
509 if(i <= ntags)
510 prop[i] = c->isfloating ? '1' : '0';
512 prop[++i] = '\0';
514 XChangeProperty(c->display, c->win, AWESOMEPROPS_ATOM(c->display), XA_STRING, 8,
515 PropModeReplace, (unsigned char *) prop, i);
517 p_delete(&prop);
520 void
521 client_unban(Client *c)
523 XMapWindow(c->display, c->win);
524 window_setstate(c->display, c->win, NormalState);
527 void
528 client_unmanage(Client *c, long state, awesome_config *awesomeconf)
530 XWindowChanges wc;
531 int tag;
533 wc.border_width = c->oldborder;
534 /* The server grab construct avoids race conditions. */
535 XGrabServer(c->display);
536 XConfigureWindow(c->display, c->win, CWBorderWidth, &wc); /* restore border */
537 client_detach(awesomeconf->clients, c);
538 if(get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel == c)
539 focus(NULL, True, awesomeconf);
540 for(tag = 0; tag < awesomeconf->ntags; tag++)
541 if(awesomeconf->tags[tag].client_sel == c)
542 awesomeconf->tags[tag].client_sel = NULL;
543 XUngrabButton(c->display, AnyButton, AnyModifier, c->win);
544 window_setstate(c->display, c->win, state);
545 XSync(c->display, False);
546 XSetErrorHandler(xerror);
547 XUngrabServer(c->display);
548 if(state != NormalState)
549 arrange(awesomeconf);
550 p_delete(&c->tags);
551 p_delete(&c);
554 void
555 updatesizehints(Client *c)
557 long msize;
558 XSizeHints size;
560 if(!XGetWMNormalHints(c->display, c->win, &size, &msize) || !size.flags)
561 size.flags = PSize;
562 c->flags = size.flags;
563 if(c->flags & PBaseSize)
565 c->basew = size.base_width;
566 c->baseh = size.base_height;
568 else if(c->flags & PMinSize)
570 c->basew = size.min_width;
571 c->baseh = size.min_height;
573 else
574 c->basew = c->baseh = 0;
575 if(c->flags & PResizeInc)
577 c->incw = size.width_inc;
578 c->inch = size.height_inc;
580 else
581 c->incw = c->inch = 0;
583 if(c->flags & PMaxSize)
585 c->maxw = size.max_width;
586 c->maxh = size.max_height;
588 else
589 c->maxw = c->maxh = 0;
591 if(c->flags & PMinSize)
593 c->minw = size.min_width;
594 c->minh = size.min_height;
596 else if(c->flags & PBaseSize)
598 c->minw = size.base_width;
599 c->minh = size.base_height;
601 else
602 c->minw = c->minh = 0;
604 if(c->flags & PAspect)
606 c->minax = size.min_aspect.x;
607 c->maxax = size.max_aspect.x;
608 c->minay = size.min_aspect.y;
609 c->maxay = size.max_aspect.y;
611 else
612 c->minax = c->maxax = c->minay = c->maxay = 0;
614 c->isfixed = (c->maxw && c->minw && c->maxh && c->minh
615 && c->maxw == c->minw && c->maxh == c->minh);
618 /** Set selected client transparency
619 * \param awesomeconf awesome config
620 * \param arg unused arg
621 * \ingroup ui_callback
623 void
624 uicb_client_settrans(awesome_config *awesomeconf,
625 const char *arg)
627 double delta = 100.0, current_opacity = 100.0;
628 unsigned char *data;
629 Atom actual;
630 int format;
631 unsigned long n, left;
632 unsigned int current_opacity_raw = 0;
633 int set_prop = 0;
634 Client *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel;
636 if(!sel)
637 return;
639 XGetWindowProperty(awesomeconf->display, sel->win,
640 XInternAtom(sel->display, "_NET_WM_WINDOW_OPACITY", False),
641 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left,
642 (unsigned char **) &data);
643 if(data)
645 memcpy(&current_opacity_raw, data, sizeof(unsigned int));
646 XFree(data);
647 current_opacity = (current_opacity_raw * 100.0) / 0xffffffff;
649 else
650 set_prop = 1;
652 delta = compute_new_value_from_arg(arg, current_opacity);
654 if(delta <= 0.0)
655 delta = 0.0;
656 else if(delta > 100.0)
658 delta = 100.0;
659 set_prop = 1;
662 if(delta == 100.0 && !set_prop)
663 window_settrans(sel->display, sel->win, -1);
664 else
665 window_settrans(sel->display, sel->win, delta);
669 /** Set borrder size
670 * \param awesomeconf awesome config
671 * \param arg X, +X or -X
672 * \ingroup ui_callback
674 void
675 uicb_setborder(awesome_config *awesomeconf,
676 const char *arg)
678 if(!arg)
679 return;
681 if((awesomeconf->borderpx = (int) compute_new_value_from_arg(arg, (double) awesomeconf->borderpx)) < 0)
682 awesomeconf->borderpx = 0;
685 void
686 uicb_client_swapnext(awesome_config *awesomeconf,
687 const char *arg __attribute__ ((unused)))
689 Client *next, *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel;
691 if(!sel)
692 return;
694 for(next = sel->next; next && !isvisible(next, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); next = next->next);
695 if(next)
697 client_swap(awesomeconf->clients, sel, next);
698 arrange(awesomeconf);
699 /* restore focus */
700 focus(sel, True, awesomeconf);
704 void
705 uicb_client_swapprev(awesome_config *awesomeconf,
706 const char *arg __attribute__ ((unused)))
708 Client *prev, *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel;
710 if(!sel)
711 return;
713 for(prev = sel->prev; prev && !isvisible(prev, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); prev = prev->prev);
714 if(prev)
716 client_swap(awesomeconf->clients, prev, sel);
717 arrange(awesomeconf);
718 /* restore focus */
719 focus(sel, True, awesomeconf);
723 void
724 uicb_client_moveresize(awesome_config *awesomeconf,
725 const char *arg)
727 int nx, ny, nw, nh, ox, oy, ow, oh;
728 char x[8], y[8], w[8], h[8];
729 int mx, my, dx, dy, nmx, nmy;
730 unsigned int dui;
731 Window dummy;
732 Client *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel;
734 if(get_current_layout(awesomeconf->tags, awesomeconf->ntags)->arrange != layout_floating)
735 if(!sel || !sel->isfloating || sel->isfixed || !arg)
736 return;
737 if(sscanf(arg, "%s %s %s %s", x, y, w, h) != 4)
738 return;
739 nx = (int) compute_new_value_from_arg(x, sel->x);
740 ny = (int) compute_new_value_from_arg(y, sel->y);
741 nw = (int) compute_new_value_from_arg(w, sel->w);
742 nh = (int) compute_new_value_from_arg(h, sel->h);
744 ox = sel->x;
745 oy = sel->y;
746 ow = sel->w;
747 oh = sel->h;
749 Bool xqp = XQueryPointer(awesomeconf->display, RootWindow(awesomeconf->display, awesomeconf->phys_screen), &dummy, &dummy, &mx, &my, &dx, &dy, &dui);
750 client_resize(sel, nx, ny, nw, nh, awesomeconf, True, False);
751 if (xqp && ox <= mx && (ox + ow) >= mx && oy <= my && (oy + oh) >= my)
753 nmx = mx - ox + sel->w - ow - 1 < 0 ? 0 : mx - ox + sel->w - ow - 1;
754 nmy = my - oy + sel->h - oh - 1 < 0 ? 0 : my - oy + sel->h - oh - 1;
755 XWarpPointer(awesomeconf->display, None, sel->win, 0, 0, 0, 0, nmx, nmy);
759 /** Kill selected client
760 * \param awesomeconf awesome config
761 * \param arg unused
762 * \ingroup ui_callback
764 void
765 uicb_client_kill(awesome_config *awesomeconf,
766 const char *arg __attribute__ ((unused)))
768 XEvent ev;
769 Client *sel = get_current_tag(awesomeconf->tags, awesomeconf->ntags)->client_sel;
771 if(!sel)
772 return;
773 if(isprotodel(sel->display, sel->win))
775 ev.type = ClientMessage;
776 ev.xclient.window = sel->win;
777 ev.xclient.message_type = XInternAtom(awesomeconf->display, "WM_PROTOCOLS", False);
778 ev.xclient.format = 32;
779 ev.xclient.data.l[0] = XInternAtom(awesomeconf->display, "WM_DELETE_WINDOW", False);
780 ev.xclient.data.l[1] = CurrentTime;
781 XSendEvent(awesomeconf->display, sel->win, False, NoEventMask, &ev);
783 else
784 XKillClient(awesomeconf->display, sel->win);
786 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99