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/extensions/shape.h>
25 #include <X11/extensions/Xinerama.h>
33 #include "statusbar.h"
38 #include "layouts/floating.h"
41 extern AwesomeConf globalconf
;
43 /** Load windows properties, restoring client's tag
44 * and floating state before awesome was restarted if any
45 * \todo this may bug if number of tags is != than before
47 * \param screen Screen ID
50 client_loadprops(Client
* c
, int screen
)
57 for(tag
= globalconf
.screens
[screen
].tags
; tag
; tag
= tag
->next
)
60 prop
= p_new(char, ntags
+ 2);
62 if(xgettextprop(globalconf
.display
, c
->win
, AWESOMEPROPS_ATOM(globalconf
.display
), prop
, ntags
+ 2))
64 for(i
= 0, tag
= globalconf
.screens
[screen
].tags
; tag
&& i
< ntags
&& prop
[i
]; i
++, tag
= tag
->next
)
73 if(i
<= ntags
&& prop
[i
])
74 c
->isfloating
= prop
[i
] == '1';
82 /** Check if client supports protocol WM_DELETE_WINDOW
83 * \param disp the display
84 * \param win the Window
85 * \return True if client has WM_DELETE_WINDOW
88 isprotodel(Display
*disp
, Window win
)
94 if(XGetWMProtocols(disp
, win
, &protocols
, &n
))
96 for(i
= 0; !ret
&& i
< n
; i
++)
97 if(protocols
[i
] == XInternAtom(disp
, "WM_DELETE_WINDOW", False
))
104 /** Swap two client in the linked list clients
105 * \param head pointer ito the client list head
106 * \param c1 first client
107 * \param c2 second client
110 client_swap(Client
**head
, Client
*c1
, Client
*c2
)
116 c2
->next
= (tmp
== c2
? c1
: tmp
);
120 c1
->prev
= (tmp
== c1
? c2
: tmp
);
138 /** Get a Client by its window
139 * \param list Client list to look info
140 * \param w Client window to find
144 get_client_bywin(Client
*list
, Window w
)
148 for(c
= list
; c
&& c
->win
!= w
; c
= c
->next
);
153 /** Get a client by its name
154 * \param list Client list
155 * \param name name to search
156 * \return first matching client
159 get_client_byname(Client
*list
, char *name
)
163 for(c
= list
; c
; c
= c
->next
)
164 if(strstr(c
->name
, name
))
170 /** Update client name attribute with its title
171 * \param c the client
174 client_updatetitle(Client
*c
)
176 if(!xgettextprop(globalconf
.display
, c
->win
, XInternAtom(globalconf
.display
, "_NET_WM_NAME", False
), c
->name
, sizeof(c
->name
)))
177 xgettextprop(globalconf
.display
, c
->win
, XInternAtom(globalconf
.display
, "WM_NAME", False
), c
->name
, sizeof(c
->name
));
180 /** Ban client and unmap it
181 * \param c the client
184 client_ban(Client
* c
)
186 XUnmapWindow(globalconf
.display
, c
->win
);
187 window_setstate(c
->win
, IconicState
);
190 /** Attach client to the beginning of the clients stack
191 * \param c the client
194 client_attach(Client
*c
)
196 if(globalconf
.clients
)
197 (globalconf
.clients
)->prev
= c
;
198 c
->next
= globalconf
.clients
;
199 globalconf
.clients
= c
;
202 /** Detach client from clients list
203 * \param c client to detach
206 client_detach(Client
*c
)
209 c
->prev
->next
= c
->next
;
211 c
->next
->prev
= c
->prev
;
212 if(c
== globalconf
.clients
)
213 globalconf
.clients
= c
->next
;
214 c
->next
= c
->prev
= NULL
;
217 /** Give focus to client, or to first client if c is NULL
219 * \param selscreen True if current screen is selected
220 * \param screen Screen ID
223 focus(Client
*c
, Bool selscreen
, int screen
)
225 /* unfocus current selected client */
226 if(globalconf
.focus
->client
)
228 window_grabbuttons(globalconf
.focus
->client
->phys_screen
,
229 globalconf
.focus
->client
->win
, False
, True
);
230 XSetWindowBorder(globalconf
.display
, globalconf
.focus
->client
->win
,
231 globalconf
.screens
[screen
].colors_normal
[ColBorder
].pixel
);
232 window_settrans(globalconf
.focus
->client
->win
,
233 globalconf
.screens
[screen
].opacity_unfocused
);
237 /* if c is NULL or invisible, take next client in the focus history */
238 if((!c
&& selscreen
) || (c
&& !client_isvisible(c
, screen
)))
240 c
= focus_get_current_client(screen
);
241 /* if c is still NULL take next client in the stack */
243 for(c
= globalconf
.clients
; c
&& (c
->skip
|| !client_isvisible(c
, screen
)); c
= c
->next
);
248 XSetWindowBorder(globalconf
.display
, c
->win
, globalconf
.screens
[screen
].colors_selected
[ColBorder
].pixel
);
249 window_grabbuttons(c
->phys_screen
, c
->win
, True
, True
);
255 /* save sel in focus history */
258 statusbar_draw_all(screen
);
260 if(globalconf
.focus
->client
)
262 XSetInputFocus(globalconf
.display
,
263 globalconf
.focus
->client
->win
, RevertToPointerRoot
, CurrentTime
);
264 for(c
= globalconf
.clients
; c
; c
= c
->next
)
265 if(c
!= globalconf
.focus
->client
)
266 window_settrans(globalconf
.focus
->client
->win
,
267 globalconf
.screens
[screen
].opacity_unfocused
);
268 window_settrans(globalconf
.focus
->client
->win
, -1);
271 XSetInputFocus(globalconf
.display
,
272 RootWindow(globalconf
.display
, get_phys_screen(screen
)),
273 RevertToPointerRoot
, CurrentTime
);
275 ewmh_update_net_active_window(get_phys_screen(screen
));
278 /** Manage a new client
279 * \param w The window
280 * \param wa Window attributes
281 * \param screen Screen ID
284 client_manage(Window w
, XWindowAttributes
*wa
, int screen
)
286 Client
*c
, *t
= NULL
;
293 c
= p_new(Client
, 1);
296 c
->x
= c
->rx
= wa
->x
;
297 c
->y
= c
->ry
= wa
->y
;
298 c
->w
= c
->rw
= wa
->width
;
299 c
->h
= c
->rh
= wa
->height
;
300 c
->oldborder
= wa
->border_width
;
302 globalconf
.display
= globalconf
.display
;
303 c
->screen
= get_screen_bycoord(c
->x
, c
->y
);
304 c
->phys_screen
= get_phys_screen(c
->screen
);
306 move_client_to_screen(c
, screen
, True
);
308 /* update window title */
309 client_updatetitle(c
);
311 if(c
->w
== area
.width
&& c
->h
== area
.height
)
312 c
->border
= wa
->border_width
;
314 c
->border
= globalconf
.screens
[screen
].borderpx
;
316 ewmh_check_client_hints(c
);
317 /* loadprops or apply rules if no props */
318 if(!client_loadprops(c
, screen
))
319 tag_client_with_rules(c
);
321 area
= get_screen_area(screen
, NULL
, NULL
);
323 /* if window request fullscreen mode */
324 if(c
->w
== area
.width
&& c
->h
== area
.height
)
331 darea
= get_display_area(c
->phys_screen
,
332 globalconf
.screens
[screen
].statusbar
,
333 &globalconf
.screens
[screen
].padding
);
335 if(c
->x
+ c
->w
+ 2 * c
->border
> darea
.x
+ darea
.width
)
336 c
->x
= c
->rx
= darea
.x
+ darea
.width
- c
->w
- 2 * c
->border
;
337 if(c
->y
+ c
->h
+ 2 * c
->border
> darea
.y
+ darea
.height
)
338 c
->y
= c
->ry
= darea
.y
+ darea
.height
- c
->h
- 2 * c
->border
;
340 c
->x
= c
->rx
= darea
.x
;
342 c
->y
= c
->ry
= darea
.y
;
346 wc
.border_width
= c
->border
;
347 XConfigureWindow(globalconf
.display
, w
, CWBorderWidth
, &wc
);
348 XSetWindowBorder(globalconf
.display
, w
, globalconf
.screens
[screen
].colors_normal
[ColBorder
].pixel
);
350 /* propagates border_width, if size doesn't change */
351 window_configure(c
->win
, c
->x
, c
->y
, c
->w
, c
->h
, c
->border
);
354 client_updatesizehints(c
);
355 client_updatewmhints(c
);
357 XSelectInput(globalconf
.display
, w
, StructureNotifyMask
| PropertyChangeMask
| EnterWindowMask
);
360 if(globalconf
.have_shape
)
362 XShapeSelectInput(globalconf
.display
, w
, ShapeNotifyMask
);
363 window_setshape(c
->phys_screen
, c
->win
);
367 window_grabbuttons(c
->phys_screen
, c
->win
, False
, True
);
369 /* check for transient and set tags like its parent */
370 if((rettrans
= XGetTransientForHint(globalconf
.display
, w
, &trans
) == Success
)
371 && (t
= get_client_bywin(globalconf
.clients
, trans
)))
372 for(tag
= globalconf
.screens
[c
->screen
].tags
; tag
; tag
= tag
->next
)
373 if(is_client_tagged(t
, tag
))
376 /* should be floating if transsient or fixed */
378 c
->isfloating
= (rettrans
== Success
) || c
->isfixed
;
383 /* attach to the stack */
386 /* some windows require this */
387 XMoveResizeWindow(globalconf
.display
, c
->win
, c
->x
, c
->y
, c
->w
, c
->h
);
389 focus(c
, True
, screen
);
391 ewmh_update_net_client_list(c
->phys_screen
);
393 /* rearrange to display new window */
397 /** Resize client window
398 * \param c client to resize
403 * \param sizehints respect size hints
404 * \param volatile_coords register coords in rx/ry/rw/rh
407 client_resize(Client
*c
, int x
, int y
, int w
, int h
,
408 Bool sizehints
, Bool volatile_coords
)
410 double dx
, dy
, max
, min
, ratio
;
417 if(c
->minay
> 0 && c
->maxay
> 0 && (h
- c
->baseh
) > 0 && (w
- c
->basew
) > 0)
419 dx
= (double) (w
- c
->basew
);
420 dy
= (double) (h
- c
->baseh
);
421 min
= (double) (c
->minax
) / (double) (c
->minay
);
422 max
= (double) (c
->maxax
) / (double) (c
->maxay
);
424 if(max
> 0 && min
> 0 && ratio
> 0)
428 dy
= (dx
* min
+ dy
) / (min
* min
+ 1);
430 w
= (int) dx
+ c
->basew
;
431 h
= (int) dy
+ c
->baseh
;
435 dy
= (dx
* min
+ dy
) / (max
* max
+ 1);
437 w
= (int) dx
+ c
->basew
;
438 h
= (int) dy
+ c
->baseh
;
442 if(c
->minw
&& w
< c
->minw
)
444 if(c
->minh
&& h
< c
->minh
)
446 if(c
->maxw
&& w
> c
->maxw
)
448 if(c
->maxh
&& h
> c
->maxh
)
451 w
-= (w
- c
->basew
) % c
->incw
;
453 h
-= (h
- c
->baseh
) % c
->inch
;
457 /* offscreen appearance fixes */
458 area
= get_display_area(c
->phys_screen
,
460 &globalconf
.screens
[c
->screen
].padding
);
462 x
= area
.width
- w
- 2 * c
->border
;
464 y
= area
.height
- h
- 2 * c
->border
;
465 if(x
+ w
+ 2 * c
->border
< 0)
467 if(y
+ h
+ 2 * c
->border
< 0)
469 if(c
->x
!= x
|| c
->y
!= y
|| c
->w
!= w
|| c
->h
!= h
)
474 c
->h
= wc
.height
= h
;
475 curtags
= get_current_tags(c
->screen
);
478 || curtags
[0]->layout
->arrange
== layout_floating
))
486 wc
.border_width
= c
->border
;
487 XConfigureWindow(globalconf
.display
, c
->win
, CWX
| CWY
| CWWidth
| CWHeight
| CWBorderWidth
, &wc
);
488 window_configure(c
->win
, c
->x
, c
->y
, c
->w
, c
->h
, c
->border
);
489 XSync(globalconf
.display
, False
);
490 if((c
->x
>= 0 || c
->y
>= 0) && XineramaIsActive(globalconf
.display
))
492 int new_screen
= get_screen_bycoord(c
->x
, c
->y
);
493 if(c
->screen
!= new_screen
)
494 move_client_to_screen(c
, new_screen
, False
);
499 /** Save client properties as an X property
503 client_saveprops(Client
*c
)
505 int i
= 0, ntags
= 0;
509 for(tag
= globalconf
.screens
[c
->screen
].tags
; tag
; tag
= tag
->next
)
512 prop
= p_new(char, ntags
+ 2);
514 for(tag
= globalconf
.screens
[c
->screen
].tags
; tag
; tag
= tag
->next
, i
++)
515 prop
[i
] = is_client_tagged(c
, tag
) ? '1' : '0';
518 prop
[i
] = c
->isfloating
? '1' : '0';
522 XChangeProperty(globalconf
.display
, c
->win
, AWESOMEPROPS_ATOM(globalconf
.display
), XA_STRING
, 8,
523 PropModeReplace
, (unsigned char *) prop
, i
);
529 client_unban(Client
*c
)
531 XMapWindow(globalconf
.display
, c
->win
);
532 window_setstate(c
->win
, NormalState
);
536 client_unmanage(Client
*c
, long state
)
541 wc
.border_width
= c
->oldborder
;
542 /* The server grab construct avoids race conditions. */
543 XGrabServer(globalconf
.display
);
544 XConfigureWindow(globalconf
.display
, c
->win
, CWBorderWidth
, &wc
); /* restore border */
546 if(globalconf
.focus
->client
== c
)
547 focus(NULL
, True
, c
->screen
);
548 focus_delete_client(c
);
549 for(tag
= globalconf
.screens
[c
->screen
].tags
; tag
; tag
= tag
->next
)
550 untag_client(c
, tag
);
551 XUngrabButton(globalconf
.display
, AnyButton
, AnyModifier
, c
->win
);
552 window_setstate(c
->win
, state
);
553 XSync(globalconf
.display
, False
);
554 XSetErrorHandler(xerror
);
555 XUngrabServer(globalconf
.display
);
556 if(state
!= NormalState
)
562 client_updatewmhints(Client
*c
)
566 if((wmh
= XGetWMHints(globalconf
.display
, c
->win
)))
568 c
->isurgent
= (wmh
->flags
& XUrgencyHint
);
569 if((wmh
->flags
& StateHint
) && wmh
->initial_state
== WithdrawnState
)
576 client_updatesizehints(Client
*c
)
581 if(!XGetWMNormalHints(globalconf
.display
, c
->win
, &size
, &msize
) || !size
.flags
)
583 c
->flags
= size
.flags
;
584 if(c
->flags
& PBaseSize
)
586 c
->basew
= size
.base_width
;
587 c
->baseh
= size
.base_height
;
589 else if(c
->flags
& PMinSize
)
591 c
->basew
= size
.min_width
;
592 c
->baseh
= size
.min_height
;
595 c
->basew
= c
->baseh
= 0;
596 if(c
->flags
& PResizeInc
)
598 c
->incw
= size
.width_inc
;
599 c
->inch
= size
.height_inc
;
602 c
->incw
= c
->inch
= 0;
604 if(c
->flags
& PMaxSize
)
606 c
->maxw
= size
.max_width
;
607 c
->maxh
= size
.max_height
;
610 c
->maxw
= c
->maxh
= 0;
612 if(c
->flags
& PMinSize
)
614 c
->minw
= size
.min_width
;
615 c
->minh
= size
.min_height
;
617 else if(c
->flags
& PBaseSize
)
619 c
->minw
= size
.base_width
;
620 c
->minh
= size
.base_height
;
623 c
->minw
= c
->minh
= 0;
625 if(c
->flags
& PAspect
)
627 c
->minax
= size
.min_aspect
.x
;
628 c
->maxax
= size
.max_aspect
.x
;
629 c
->minay
= size
.min_aspect
.y
;
630 c
->maxay
= size
.max_aspect
.y
;
633 c
->minax
= c
->maxax
= c
->minay
= c
->maxay
= 0;
635 if(c
->maxw
&& c
->minw
&& c
->maxh
&& c
->minh
636 && c
->maxw
== c
->minw
&& c
->maxh
== c
->minh
)
640 /** Returns True if a client is tagged
641 * with one of the tags
642 * \return True or False
645 client_isvisible(Client
*c
, int screen
)
649 if(c
->screen
!= screen
)
652 for(tag
= globalconf
.screens
[screen
].tags
; tag
; tag
= tag
->next
)
653 if(tag
->selected
&& is_client_tagged(c
, tag
))
658 /** Set selected client transparency
659 * \param screen Screen ID
660 * \param arg unused arg
661 * \ingroup ui_callback
664 uicb_client_settrans(int screen
__attribute__ ((unused
)), char *arg
)
666 double delta
= 100.0, current_opacity
= 100.0;
670 unsigned long n
, left
;
671 unsigned int current_opacity_raw
= 0;
673 Client
*sel
= globalconf
.focus
->client
;
678 XGetWindowProperty(globalconf
.display
, sel
->win
,
679 XInternAtom(globalconf
.display
, "_NET_WM_WINDOW_OPACITY", False
),
680 0L, 1L, False
, XA_CARDINAL
, &actual
, &format
, &n
, &left
,
681 (unsigned char **) &data
);
684 memcpy(¤t_opacity_raw
, data
, sizeof(unsigned int));
686 current_opacity
= (current_opacity_raw
* 100.0) / 0xffffffff;
691 delta
= compute_new_value_from_arg(arg
, current_opacity
);
695 else if(delta
> 100.0)
701 if(delta
== 100.0 && !set_prop
)
702 window_settrans(sel
->win
, -1);
704 window_settrans(sel
->win
, delta
);
709 * \param screen Screen ID
710 * \param arg X, +X or -X
711 * \ingroup ui_callback
714 uicb_setborder(int screen
, char *arg
)
719 if((globalconf
.screens
[screen
].borderpx
= (int) compute_new_value_from_arg(arg
, (double) globalconf
.screens
[screen
].borderpx
)) < 0)
720 globalconf
.screens
[screen
].borderpx
= 0;
723 /** Swap current with next client
724 * \param screen Screen ID
726 * \ingroup ui_callback
729 uicb_client_swapnext(int screen
, char *arg
__attribute__ ((unused
)))
731 Client
*next
, *sel
= globalconf
.focus
->client
;
736 for(next
= sel
->next
; next
&& !client_isvisible(next
, screen
); next
= next
->next
);
739 client_swap(&globalconf
.clients
, sel
, next
);
742 focus(sel
, True
, screen
);
746 /** Swap current with previous client
747 * \param screen Screen ID
749 * \ingroup ui_callback
752 uicb_client_swapprev(int screen
, char *arg
__attribute__ ((unused
)))
754 Client
*prev
, *sel
= globalconf
.focus
->client
;
759 for(prev
= sel
->prev
; prev
&& !client_isvisible(prev
, screen
); prev
= prev
->prev
);
762 client_swap(&globalconf
.clients
, prev
, sel
);
765 focus(sel
, True
, screen
);
769 /** Move and resize client
770 * \param screen Screen ID
772 * \ingroup ui_callback
775 uicb_client_moveresize(int screen
, char *arg
)
777 int nx
, ny
, nw
, nh
, ox
, oy
, ow
, oh
;
778 char x
[8], y
[8], w
[8], h
[8];
779 int mx
, my
, dx
, dy
, nmx
, nmy
;
782 Client
*sel
= globalconf
.focus
->client
;
783 Tag
**curtags
= get_current_tags(screen
);
785 if(curtags
[0]->layout
->arrange
!= layout_floating
)
786 if(!sel
|| !sel
->isfloating
|| sel
->isfixed
|| !arg
)
792 if(sscanf(arg
, "%s %s %s %s", x
, y
, w
, h
) != 4)
794 nx
= (int) compute_new_value_from_arg(x
, sel
->x
);
795 ny
= (int) compute_new_value_from_arg(y
, sel
->y
);
796 nw
= (int) compute_new_value_from_arg(w
, sel
->w
);
797 nh
= (int) compute_new_value_from_arg(h
, sel
->h
);
804 Bool xqp
= XQueryPointer(globalconf
.display
,
805 RootWindow(globalconf
.display
,
806 get_phys_screen(screen
)),
807 &dummy
, &dummy
, &mx
, &my
, &dx
, &dy
, &dui
);
808 client_resize(sel
, nx
, ny
, nw
, nh
, True
, False
);
809 if (xqp
&& ox
<= mx
&& (ox
+ ow
) >= mx
&& oy
<= my
&& (oy
+ oh
) >= my
)
811 nmx
= mx
- ox
+ sel
->w
- ow
- 1 < 0 ? 0 : mx
- ox
+ sel
->w
- ow
- 1;
812 nmy
= my
- oy
+ sel
->h
- oh
- 1 < 0 ? 0 : my
- oy
+ sel
->h
- oh
- 1;
813 XWarpPointer(globalconf
.display
,
815 0, 0, 0, 0, nmx
, nmy
);
821 client_kill(Client
*c
)
825 if(isprotodel(globalconf
.display
, c
->win
))
827 ev
.type
= ClientMessage
;
828 ev
.xclient
.window
= c
->win
;
829 ev
.xclient
.message_type
= XInternAtom(globalconf
.display
, "WM_PROTOCOLS", False
);
830 ev
.xclient
.format
= 32;
831 ev
.xclient
.data
.l
[0] = XInternAtom(globalconf
.display
, "WM_DELETE_WINDOW", False
);
832 ev
.xclient
.data
.l
[1] = CurrentTime
;
833 XSendEvent(globalconf
.display
, c
->win
, False
, NoEventMask
, &ev
);
836 XKillClient(globalconf
.display
, c
->win
);
839 /** Kill selected client
840 * \param screen Screen ID
842 * \ingroup ui_callback
845 uicb_client_kill(int screen
__attribute__ ((unused
)), char *arg
__attribute__ ((unused
)))
847 Client
*sel
= globalconf
.focus
->client
;
854 client_maximize(Client
*c
, int x
, int y
, int w
, int h
)
856 if((c
->ismax
= !c
->ismax
))
858 c
->oldborder
= c
->border
;
860 c
->wasfloating
= c
->isfloating
;
861 c
->isfloating
= True
;
862 client_resize(c
, x
, y
, w
, h
, False
, True
);
864 else if(c
->wasfloating
)
865 client_resize(c
, c
->rx
, c
->ry
, c
->rw
, c
->rh
, True
, False
);
867 c
->isfloating
= False
;
869 c
->border
= c
->oldborder
;
874 /** Toggle maximize for client
875 * \param screen Screen ID
877 * \ingroup ui_callback
880 uicb_client_togglemax(int screen
, char *arg
__attribute__ ((unused
)))
882 Client
*sel
= globalconf
.focus
->client
;
883 Area area
= get_screen_area(screen
,
884 globalconf
.screens
[screen
].statusbar
,
885 &globalconf
.screens
[screen
].padding
);
887 client_maximize(sel
, area
.x
, area
.y
,
888 area
.width
- 2 * globalconf
.screens
[screen
].borderpx
,
889 area
.height
- 2 * globalconf
.screens
[screen
].borderpx
);
892 /** Toggle vertical maximize for client
893 * \param screen Screen ID
895 * \ingroup ui_callback
898 uicb_client_toggleverticalmax(int screen
, char *arg
__attribute__ ((unused
)))
900 Client
*sel
= globalconf
.focus
->client
;
901 Area area
= get_screen_area(screen
,
902 globalconf
.screens
[screen
].statusbar
,
903 &globalconf
.screens
[screen
].padding
);
906 client_maximize(sel
, sel
->x
, area
.y
,
908 area
.height
- 2 * globalconf
.screens
[screen
].borderpx
);
912 /** Toggle horizontal maximize for client
913 * \param screen Screen ID
915 * \ingroup ui_callback
918 uicb_client_togglehorizontalmax(int screen
, char *arg
__attribute__ ((unused
)))
920 Client
*sel
= globalconf
.focus
->client
;
921 Area area
= get_screen_area(screen
,
922 globalconf
.screens
[screen
].statusbar
,
923 &globalconf
.screens
[screen
].padding
);
926 client_maximize(sel
, area
.x
, sel
->y
,
927 area
.height
- 2 * globalconf
.screens
[screen
].borderpx
,
932 * \param screen Screen ID
934 * \ingroup ui_callback
937 uicb_client_zoom(int screen
, char *arg
__attribute__ ((unused
)))
939 Client
*sel
= globalconf
.focus
->client
;
941 if(globalconf
.clients
== sel
)
942 for(sel
= sel
->next
; sel
&& !client_isvisible(sel
, screen
); sel
= sel
->next
);
950 focus(sel
, True
, screen
);
954 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80