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.
23 #include <X11/Xatom.h>
24 #include <X11/Xutil.h>
25 #include <X11/extensions/shape.h>
32 #include "statusbar.h"
34 #include "layouts/floating.h"
37 extern Client
*clients
, *sel
, *stack
; /* global client list and stack */
39 /** Attach client stack to clients stacks
43 attachstack(Client
* c
)
49 /** Detach client from stack
53 detachstack(Client
* c
)
57 for(tc
= &stack
; *tc
&& *tc
!= c
; tc
= &(*tc
)->snext
);
61 /** Grab or ungrab buttons when a client is focused
63 * \param focused True if client is focused
64 * \param modkey Mod key mask
65 * \param numlockmask Numlock mask
68 grabbuttons(Client
* c
, Bool focused
, KeySym modkey
, unsigned int numlockmask
)
70 XUngrabButton(c
->display
, AnyButton
, AnyModifier
, c
->win
);
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
->phys_screen
));
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
->phys_screen
), False
, BUTTONMASK
,
108 GrabModeAsync
, GrabModeSync
, None
, None
);
109 XGrabButton(c
->display
, Button4
, LockMask
, RootWindow(c
->display
, c
->phys_screen
), False
, BUTTONMASK
,
110 GrabModeAsync
, GrabModeSync
, None
, None
);
111 XGrabButton(c
->display
, Button4
, numlockmask
, RootWindow(c
->display
, c
->phys_screen
), False
, BUTTONMASK
,
112 GrabModeAsync
, GrabModeSync
, None
, None
);
113 XGrabButton(c
->display
, Button4
, numlockmask
| LockMask
, RootWindow(c
->display
, c
->phys_screen
), False
, BUTTONMASK
,
114 GrabModeAsync
, GrabModeSync
, None
, None
);
116 XGrabButton(c
->display
, Button5
, NoSymbol
, RootWindow(c
->display
, c
->phys_screen
), False
, BUTTONMASK
,
117 GrabModeAsync
, GrabModeSync
, None
, None
);
118 XGrabButton(c
->display
, Button5
, LockMask
, RootWindow(c
->display
, c
->phys_screen
), False
, BUTTONMASK
,
119 GrabModeAsync
, GrabModeSync
, None
, None
);
120 XGrabButton(c
->display
, Button5
, numlockmask
, RootWindow(c
->display
, c
->phys_screen
), False
, BUTTONMASK
,
121 GrabModeAsync
, GrabModeSync
, None
, None
);
122 XGrabButton(c
->display
, Button5
, numlockmask
| LockMask
, RootWindow(c
->display
, c
->phys_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
133 isprotodel(Client
* c
)
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
))
149 /** Set client WM_STATE property
150 * \param c the client
151 * \param state no idea
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
165 * \param opacity opacity percentage
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);
180 XDeleteProperty(c
->display
, c
->win
, XInternAtom(c
->display
, "_NET_WM_WINDOW_OPACITY", False
));
182 XSync(c
->display
, False
);
185 /** Swap two client in the linked list clients
186 * \param c1 first client
187 * \param c2 second client
190 client_swap(Client
*c1
, Client
*c2
)
196 c2
->next
= (tmp
== c2
? c1
: tmp
);
200 c1
->prev
= (tmp
== c1
? c2
: tmp
);
218 /** Attach client to the beginning of the clients stack
219 * \param c the client
231 updatetitle(Client
* c
)
233 if(!xgettextprop(c
->display
, c
->win
, XInternAtom(c
->display
, "_NET_WM_NAME", False
), c
->name
, sizeof c
->name
))
234 xgettextprop(c
->display
, c
->win
, XInternAtom(c
->display
, "WM_NAME", False
), c
->name
, sizeof c
->name
);
237 /** Ban client and unmapped it
238 * \param c the client
243 XUnmapWindow(c
->display
, c
->win
);
244 setclientstate(c
, IconicState
);
250 * \param c the client
253 configure(Client
* c
)
257 ce
.type
= ConfigureNotify
;
258 ce
.display
= c
->display
;
265 ce
.border_width
= c
->border
;
267 ce
.override_redirect
= False
;
268 XSendEvent(c
->display
, c
->win
, False
, StructureNotifyMask
, (XEvent
*) & ce
);
275 c
->prev
->next
= c
->next
;
277 c
->next
->prev
= c
->prev
;
280 c
->next
= c
->prev
= NULL
;
283 /** Give focus to client, or to first client if c is NULL
284 * \param disp Display ref
285 * \param drawcontext drawcontext ref
287 * \param selscreen True if current screen is selected
288 * \param awesomeconf awesome config
291 focus(Display
*disp
, DC
*drawcontext
, Client
* c
, Bool selscreen
, awesome_config
*awesomeconf
)
293 /* if c is NULL or invisible, take next client in the stack */
294 if((!c
&& selscreen
) || (c
&& !isvisible(c
, awesomeconf
->screen
, awesomeconf
->tags
, awesomeconf
->ntags
)))
295 for(c
= stack
; c
&& !isvisible(c
, awesomeconf
->screen
, awesomeconf
->tags
, awesomeconf
->ntags
); c
= c
->snext
);
297 /* if a client was selected but it's not the current client, unfocus it */
300 grabbuttons(sel
, False
, awesomeconf
->modkey
, awesomeconf
->numlockmask
);
301 XSetWindowBorder(sel
->display
, sel
->win
, drawcontext
->norm
[ColBorder
]);
302 setclienttrans(sel
, awesomeconf
->opacity_unfocused
);
308 grabbuttons(c
, True
, awesomeconf
->modkey
, awesomeconf
->numlockmask
);
313 drawstatusbar(disp
, drawcontext
, awesomeconf
);
316 XSetWindowBorder(sel
->display
, sel
->win
, drawcontext
->sel
[ColBorder
]);
317 XSetInputFocus(sel
->display
, sel
->win
, RevertToPointerRoot
, CurrentTime
);
318 for(c
= stack
; c
; c
= c
->snext
)
320 setclienttrans(c
, awesomeconf
->opacity_unfocused
);
321 setclienttrans(sel
, -1);
324 XSetInputFocus(disp
, RootWindow(disp
, awesomeconf
->screen
), RevertToPointerRoot
, CurrentTime
);
327 /** Kill selected client
328 * \param disp Display ref
329 * \param drawcontext Drawcontext ref
330 * \param awesomeconf awesome config
332 * \ingroup ui_callback
335 uicb_killclient(Display
*disp
__attribute__ ((unused
)),
336 DC
*drawcontext
__attribute__ ((unused
)),
337 awesome_config
*awesomeconf
__attribute__ ((unused
)),
338 const char *arg
__attribute__ ((unused
)))
346 ev
.type
= ClientMessage
;
347 ev
.xclient
.window
= sel
->win
;
348 ev
.xclient
.message_type
= XInternAtom(disp
, "WM_PROTOCOLS", False
);
349 ev
.xclient
.format
= 32;
350 ev
.xclient
.data
.l
[0] = XInternAtom(disp
, "WM_DELETE_WINDOW", False
);
351 ev
.xclient
.data
.l
[1] = CurrentTime
;
352 XSendEvent(sel
->display
, sel
->win
, False
, NoEventMask
, &ev
);
355 XKillClient(sel
->display
, sel
->win
);
359 /** Load windows properties, restoring client's tag
360 * and floating state before awesome was restarted if any
361 * \todo this may bug if number of tags is != than before
362 * \param c Client ref
363 * \param ntags tags number
366 loadprops(Client
* c
, int ntags
)
372 prop
= p_new(char, ntags
+ 2);
374 if(xgettextprop(c
->display
, c
->win
, AWESOMEPROPS_ATOM(c
->display
), prop
, ntags
+ 2))
376 for(i
= 0; i
< ntags
&& prop
[i
]; i
++)
377 if((c
->tags
[i
] = prop
[i
] == '1'))
379 if(i
<= ntags
&& prop
[i
])
380 c
->isfloating
= prop
[i
] == '1';
388 /** Manage a new client
389 * \param disp Display ref
390 * \param drawcontext Drawcontext ref
391 * \param w The window
392 * \param wa Window attributes
393 * \param awesomeconf awesome config
396 manage(Display
*disp
, DC
*drawcontext
, Window w
, XWindowAttributes
*wa
, awesome_config
*awesomeconf
)
399 Client
*c
, *t
= NULL
;
403 ScreenInfo
*si
= get_display_info(disp
, awesomeconf
->screen
, &awesomeconf
->statusbar
);
405 c
= p_new(Client
, 1);
408 c
->x
= c
->rw
= wa
->x
;
409 c
->y
= c
->ry
= wa
->y
;
410 c
->w
= c
->rw
= wa
->width
;
411 c
->h
= c
->rh
= wa
->height
;
412 c
->oldborder
= wa
->border_width
;
414 c
->phys_screen
= get_phys_screen(disp
, c
->screen
);
415 if(c
->w
== si
->width
&& c
->h
== si
->height
)
419 c
->border
= wa
->border_width
;
423 if(c
->x
+ c
->w
+ 2 * c
->border
> si
->x_org
+ si
->width
)
424 c
->x
= c
->rx
= si
->x_org
+ si
->width
- c
->w
- 2 * c
->border
;
425 if(c
->y
+ c
->h
+ 2 * c
->border
> si
->y_org
+ si
->height
)
426 c
->y
= c
->ry
= si
->y_org
+ si
->height
- c
->h
- 2 * c
->border
;
428 c
->x
= c
->rx
= si
->x_org
;
430 c
->y
= c
->ry
= si
->y_org
;
431 c
->border
= awesomeconf
->borderpx
;
434 wc
.border_width
= c
->border
;
435 XConfigureWindow(disp
, w
, CWBorderWidth
, &wc
);
436 XSetWindowBorder(disp
, w
, drawcontext
->norm
[ColBorder
]);
437 configure(c
); /* propagates border_width, if size doesn't change */
439 XSelectInput(disp
, w
, StructureNotifyMask
| PropertyChangeMask
| EnterWindowMask
);
440 if(awesomeconf
->have_shape
)
442 XShapeSelectInput(disp
, w
, ShapeNotifyMask
);
445 grabbuttons(c
, False
, awesomeconf
->modkey
, awesomeconf
->numlockmask
);
447 move_client_to_screen(c
, awesomeconf
, False
);
448 if((rettrans
= XGetTransientForHint(disp
, w
, &trans
) == Success
))
449 for(t
= clients
; t
&& t
->win
!= trans
; t
= t
->next
);
451 for(i
= 0; i
< awesomeconf
->ntags
; i
++)
452 c
->tags
[i
] = t
->tags
[i
];
453 if(!loadprops(c
, awesomeconf
->ntags
))
454 applyrules(c
, awesomeconf
);
456 c
->isfloating
= (rettrans
== Success
) || c
->isfixed
;
457 saveprops(c
, awesomeconf
->ntags
);
460 XMoveResizeWindow(disp
, c
->win
, c
->x
, c
->y
, c
->w
, c
->h
); /* some windows require this */
462 arrange(disp
, drawcontext
, awesomeconf
);
466 resize(Client
*c
, int x
, int y
, int w
, int h
, awesome_config
*awesomeconf
, Bool sizehints
)
468 double dx
, dy
, max
, min
, ratio
;
474 if(c
->minay
> 0 && c
->maxay
> 0 && (h
- c
->baseh
) > 0 && (w
- c
->basew
) > 0)
476 dx
= (double) (w
- c
->basew
);
477 dy
= (double) (h
- c
->baseh
);
478 min
= (double) (c
->minax
) / (double) (c
->minay
);
479 max
= (double) (c
->maxax
) / (double) (c
->maxay
);
481 if(max
> 0 && min
> 0 && ratio
> 0)
485 dy
= (dx
* min
+ dy
) / (min
* min
+ 1);
487 w
= (int) dx
+ c
->basew
;
488 h
= (int) dy
+ c
->baseh
;
492 dy
= (dx
* min
+ dy
) / (max
* max
+ 1);
494 w
= (int) dx
+ c
->basew
;
495 h
= (int) dy
+ c
->baseh
;
499 if(c
->minw
&& w
< c
->minw
)
501 if(c
->minh
&& h
< c
->minh
)
503 if(c
->maxw
&& w
> c
->maxw
)
505 if(c
->maxh
&& h
> c
->maxh
)
508 w
-= (w
- c
->basew
) % c
->incw
;
510 h
-= (h
- c
->baseh
) % c
->inch
;
514 /* offscreen appearance fixes */
515 if(XineramaIsActive(c
->display
))
516 si
= get_display_info(c
->display
, DefaultScreen(c
->display
), NULL
);
518 si
= get_display_info(c
->display
, c
->screen
, NULL
);
520 x
= si
->width
- w
- 2 * c
->border
;
522 y
= si
->height
- h
- 2 * c
->border
;
524 if(x
+ w
+ 2 * c
->border
< 0)
526 if(y
+ h
+ 2 * c
->border
< 0)
528 if(c
->x
!= x
|| c
->y
!= y
|| c
->w
!= w
|| c
->h
!= h
)
533 c
->h
= wc
.height
= h
;
534 wc
.border_width
= c
->border
;
535 XConfigureWindow(c
->display
, c
->win
, CWX
| CWY
| CWWidth
| CWHeight
| CWBorderWidth
, &wc
);
537 XSync(c
->display
, False
);
538 if(XineramaIsActive(c
->display
))
540 int new_screen
= get_screen_bycoord(c
->display
, c
->x
, c
->y
);
541 if(c
->screen
!= new_screen
)
542 move_client_to_screen(c
, &awesomeconf
[new_screen
- awesomeconf
->screen
], False
);
548 uicb_moveresize(Display
*disp
__attribute__ ((unused
)),
549 DC
*drawcontext
__attribute__ ((unused
)),
550 awesome_config
*awesomeconf
,
553 int nx
, ny
, nw
, nh
, ox
, oy
, ow
, oh
;
554 char x
[8], y
[8], w
[8], h
[8];
555 int mx
, my
, dx
, dy
, nmx
, nmy
;
559 if(!IS_ARRANGE(layout_floating
))
560 if(!sel
|| !sel
->isfloating
|| sel
->isfixed
|| !arg
)
562 if(sscanf(arg
, "%s %s %s %s", x
, y
, w
, h
) != 4)
564 nx
= (int) compute_new_value_from_arg(x
, sel
->x
);
565 ny
= (int) compute_new_value_from_arg(y
, sel
->y
);
566 nw
= (int) compute_new_value_from_arg(w
, sel
->w
);
567 nh
= (int) compute_new_value_from_arg(h
, sel
->h
);
574 Bool xqp
= XQueryPointer(sel
->display
, RootWindow(sel
->display
, sel
->screen
), &dummy
, &dummy
, &mx
, &my
, &dx
, &dy
, &dui
);
575 resize(sel
, nx
, ny
, nw
, nh
, awesomeconf
, True
);
576 if (xqp
&& ox
<= mx
&& (ox
+ ow
) >= mx
&& oy
<= my
&& (oy
+ oh
) >= my
)
578 nmx
= mx
-ox
+sel
->w
-ow
-1 < 0 ? 0 : mx
-ox
+sel
->w
-ow
-1;
579 nmy
= my
-oy
+sel
->h
-oh
-1 < 0 ? 0 : my
-oy
+sel
->h
-oh
-1;
580 XWarpPointer(sel
->display
, None
, sel
->win
, 0, 0, 0, 0, nmx
, nmy
);
585 saveprops(Client
* c
, int ntags
)
590 prop
= p_new(char, ntags
+ 2);
592 for(i
= 0; i
< ntags
; i
++)
593 prop
[i
] = c
->tags
[i
] ? '1' : '0';
596 prop
[i
] = c
->isfloating
? '1' : '0';
600 XChangeProperty(c
->display
, c
->win
, AWESOMEPROPS_ATOM(c
->display
), XA_STRING
, 8,
601 PropModeReplace
, (unsigned char *) prop
, i
);
609 XMapWindow(c
->display
, c
->win
);
610 setclientstate(c
, NormalState
);
616 unmanage(Client
* c
, DC
*drawcontext
, long state
, awesome_config
*awesomeconf
)
621 wc
.border_width
= c
->oldborder
;
622 /* The server grab construct avoids race conditions. */
623 XGrabServer(c
->display
);
624 XConfigureWindow(c
->display
, c
->win
, CWBorderWidth
, &wc
); /* restore border */
628 focus(c
->display
, drawcontext
, NULL
, True
, awesomeconf
);
629 XUngrabButton(c
->display
, AnyButton
, AnyModifier
, c
->win
);
630 setclientstate(c
, state
);
631 XSync(c
->display
, False
);
632 XSetErrorHandler(xerror
);
633 XUngrabServer(c
->display
);
634 if(state
!= NormalState
)
635 arrange(c
->display
, drawcontext
, awesomeconf
);
641 updatesizehints(Client
* c
)
646 if(!XGetWMNormalHints(c
->display
, c
->win
, &size
, &msize
) || !size
.flags
)
648 c
->flags
= size
.flags
;
649 if(c
->flags
& PBaseSize
)
651 c
->basew
= size
.base_width
;
652 c
->baseh
= size
.base_height
;
654 else if(c
->flags
& PMinSize
)
656 c
->basew
= size
.min_width
;
657 c
->baseh
= size
.min_height
;
660 c
->basew
= c
->baseh
= 0;
661 if(c
->flags
& PResizeInc
)
663 c
->incw
= size
.width_inc
;
664 c
->inch
= size
.height_inc
;
667 c
->incw
= c
->inch
= 0;
669 if(c
->flags
& PMaxSize
)
671 c
->maxw
= size
.max_width
;
672 c
->maxh
= size
.max_height
;
675 c
->maxw
= c
->maxh
= 0;
677 if(c
->flags
& PMinSize
)
679 c
->minw
= size
.min_width
;
680 c
->minh
= size
.min_height
;
682 else if(c
->flags
& PBaseSize
)
684 c
->minw
= size
.base_width
;
685 c
->minh
= size
.base_height
;
688 c
->minw
= c
->minh
= 0;
690 if(c
->flags
& PAspect
)
692 c
->minax
= size
.min_aspect
.x
;
693 c
->maxax
= size
.max_aspect
.x
;
694 c
->minay
= size
.min_aspect
.y
;
695 c
->maxay
= size
.max_aspect
.y
;
698 c
->minax
= c
->maxax
= c
->minay
= c
->maxay
= 0;
700 c
->isfixed
= (c
->maxw
&& c
->minw
&& c
->maxh
&& c
->minh
701 && c
->maxw
== c
->minw
&& c
->maxh
== c
->minh
);
708 int i
, b
; unsigned int u
; /* dummies */
709 /* Logic to decide if we have a shaped window cribbed from fvwm-2.5.10. */
710 if (XShapeQueryExtents(c
->display
, c
->win
, &bounding_shaped
, &i
, &i
,
711 &u
, &u
, &b
, &i
, &i
, &u
, &u
) && bounding_shaped
)
712 XShapeCombineShape(c
->display
, RootWindow(c
->display
, c
->screen
), ShapeBounding
, 0, 0, c
->win
, ShapeBounding
, ShapeSet
);
715 /** Set selected client transparency
716 * \param disp Display ref
717 * \param drawcontext Drawcontext ref
718 * \param awesomeconf awesome config
719 * \param arg unused arg
720 * \ingroup ui_callback
723 uicb_settrans(Display
*disp
__attribute__ ((unused
)),
724 DC
*drawcontext
__attribute__ ((unused
)),
725 awesome_config
*awesomeconf
__attribute__ ((unused
)),
728 double delta
= 100.0, current_opacity
= 0.0;
732 unsigned long n
, left
;
733 unsigned int current_opacity_raw
= 0;
739 XGetWindowProperty(sel
->display
, sel
->win
, XInternAtom(sel
->display
, "_NET_WM_WINDOW_OPACITY", False
),
740 0L, 1L, False
, XA_CARDINAL
, &actual
, &format
, &n
, &left
,
741 (unsigned char **) &data
);
744 memcpy(¤t_opacity_raw
, data
, sizeof(unsigned int));
746 current_opacity
= (current_opacity_raw
* 100.0) / 0xffffffff;
751 delta
= compute_new_value_from_arg(arg
, current_opacity
);
755 else if(delta
> 100.0)
761 if(delta
== 100.0 && !set_prop
)
762 setclienttrans(sel
, -1);
764 setclienttrans(sel
, delta
);
769 * \param disp Display ref
770 * \param drawcontext Drawcontext ref
771 * \param awesomeconf awesome config
772 * \param arg X, +X or -X
773 * \ingroup ui_callback
776 uicb_setborder(Display
*disp
__attribute__ ((unused
)),
777 DC
*drawcontext
__attribute__ ((unused
)),
778 awesome_config
*awesomeconf
,
784 if((awesomeconf
->borderpx
= (int) compute_new_value_from_arg(arg
, (double) awesomeconf
->borderpx
)) < 0)
785 awesomeconf
->borderpx
= 0;
789 uicb_swapnext(Display
*disp
,
791 awesome_config
*awesomeconf
,
792 const char *arg
__attribute__ ((unused
)))
799 for(next
= sel
->next
; next
&& !isvisible(next
, awesomeconf
->screen
, awesomeconf
->tags
, awesomeconf
->ntags
); next
= next
->next
);
802 client_swap(sel
, next
);
803 arrange(disp
, drawcontext
, awesomeconf
);
808 uicb_swapprev(Display
*disp
,
810 awesome_config
*awesomeconf
,
811 const char *arg
__attribute__ ((unused
)))
818 for(prev
= sel
->prev
; prev
&& !isvisible(prev
, awesomeconf
->screen
, awesomeconf
->tags
, awesomeconf
->ntags
); prev
= prev
->prev
);
821 client_swap(prev
, sel
);
822 arrange(disp
, drawcontext
, awesomeconf
);