remove stack
This commit is contained in:
parent
c3986a5937
commit
0899432059
|
@ -40,8 +40,6 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
|
|
||||||
Client *stack = NULL;
|
|
||||||
|
|
||||||
static int (*xerrorxlib) (Display *, XErrorEvent *);
|
static int (*xerrorxlib) (Display *, XErrorEvent *);
|
||||||
static Bool readin = True, running = True;
|
static Bool readin = True, running = True;
|
||||||
|
|
||||||
|
@ -53,10 +51,10 @@ cleanup(awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
int screen, i;
|
int screen, i;
|
||||||
|
|
||||||
while(stack)
|
while(*awesomeconf->clients)
|
||||||
{
|
{
|
||||||
unban(stack);
|
unban(*awesomeconf->clients);
|
||||||
unmanage(stack, NormalState, awesomeconf);
|
unmanage(*awesomeconf->clients, NormalState, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(screen = 0; screen < get_screen_count(awesomeconf->display); screen++)
|
for(screen = 0; screen < get_screen_count(awesomeconf->display); screen++)
|
||||||
|
|
35
client.c
35
client.c
|
@ -33,31 +33,6 @@
|
||||||
|
|
||||||
#include "layouts/floating.h"
|
#include "layouts/floating.h"
|
||||||
|
|
||||||
/* extern */
|
|
||||||
extern Client *stack;
|
|
||||||
|
|
||||||
/** Attach client stack to clients stacks
|
|
||||||
* \param c the client
|
|
||||||
*/
|
|
||||||
static inline void
|
|
||||||
attachstack(Client * c)
|
|
||||||
{
|
|
||||||
c->snext = stack;
|
|
||||||
stack = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Detach client from stack
|
|
||||||
* \param c the client
|
|
||||||
*/
|
|
||||||
static inline void
|
|
||||||
detachstack(Client * c)
|
|
||||||
{
|
|
||||||
Client **tc;
|
|
||||||
|
|
||||||
for(tc = &stack; *tc && *tc != c; tc = &(*tc)->snext);
|
|
||||||
*tc = c->snext;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Grab or ungrab buttons when a client is focused
|
/** Grab or ungrab buttons when a client is focused
|
||||||
* \param c client
|
* \param c client
|
||||||
* \param focused True if client is focused
|
* \param focused True if client is focused
|
||||||
|
@ -326,7 +301,7 @@ focus(Display *disp, Client * c, Bool selscreen, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
/* if c is NULL or invisible, take next client in the stack */
|
/* if c is NULL or invisible, take next client in the stack */
|
||||||
if((!c && selscreen) || (c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags)))
|
if((!c && selscreen) || (c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags)))
|
||||||
for(c = stack; c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); c = c->snext);
|
for(c = *awesomeconf->clients; c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); c = c->snext);
|
||||||
|
|
||||||
/* if a client was selected but it's not the current client, unfocus it */
|
/* if a client was selected but it's not the current client, unfocus it */
|
||||||
if(*awesomeconf->client_sel && *awesomeconf->client_sel != c)
|
if(*awesomeconf->client_sel && *awesomeconf->client_sel != c)
|
||||||
|
@ -338,11 +313,7 @@ focus(Display *disp, Client * c, Bool selscreen, awesome_config *awesomeconf)
|
||||||
if(*awesomeconf->client_sel == c)
|
if(*awesomeconf->client_sel == c)
|
||||||
return;
|
return;
|
||||||
if(c)
|
if(c)
|
||||||
{
|
|
||||||
detachstack(c);
|
|
||||||
attachstack(c);
|
|
||||||
grabbuttons(c, True, True, awesomeconf->modkey, awesomeconf->numlockmask);
|
grabbuttons(c, True, True, awesomeconf->modkey, awesomeconf->numlockmask);
|
||||||
}
|
|
||||||
if(!selscreen)
|
if(!selscreen)
|
||||||
return;
|
return;
|
||||||
*awesomeconf->client_sel = c;
|
*awesomeconf->client_sel = c;
|
||||||
|
@ -351,7 +322,7 @@ focus(Display *disp, Client * c, Bool selscreen, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
XSetWindowBorder(awesomeconf->display, (*awesomeconf->client_sel)->win, awesomeconf->colors_selected[ColBorder].pixel);
|
XSetWindowBorder(awesomeconf->display, (*awesomeconf->client_sel)->win, awesomeconf->colors_selected[ColBorder].pixel);
|
||||||
XSetInputFocus(awesomeconf->display, (*awesomeconf->client_sel)->win, RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(awesomeconf->display, (*awesomeconf->client_sel)->win, RevertToPointerRoot, CurrentTime);
|
||||||
for(c = stack; c; c = c->snext)
|
for(c = *awesomeconf->clients; c; c = c->snext)
|
||||||
if(c != *awesomeconf->client_sel)
|
if(c != *awesomeconf->client_sel)
|
||||||
setclienttrans(c, awesomeconf->opacity_unfocused);
|
setclienttrans(c, awesomeconf->opacity_unfocused);
|
||||||
setclienttrans(*awesomeconf->client_sel, -1);
|
setclienttrans(*awesomeconf->client_sel, -1);
|
||||||
|
@ -462,7 +433,6 @@ manage(Display *disp, Window w, XWindowAttributes *wa, awesome_config *awesomeco
|
||||||
c->isfloating = (rettrans == Success) || c->isfixed;
|
c->isfloating = (rettrans == Success) || c->isfixed;
|
||||||
saveprops(c, awesomeconf->ntags);
|
saveprops(c, awesomeconf->ntags);
|
||||||
attach(awesomeconf->clients, c);
|
attach(awesomeconf->clients, c);
|
||||||
attachstack(c);
|
|
||||||
XMoveResizeWindow(disp, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
|
XMoveResizeWindow(disp, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
|
||||||
c->isbanned = True;
|
c->isbanned = True;
|
||||||
arrange(disp, awesomeconf);
|
arrange(disp, awesomeconf);
|
||||||
|
@ -589,7 +559,6 @@ unmanage(Client * c, long state, awesome_config *awesomeconf)
|
||||||
XGrabServer(c->display);
|
XGrabServer(c->display);
|
||||||
XConfigureWindow(c->display, c->win, CWBorderWidth, &wc); /* restore border */
|
XConfigureWindow(c->display, c->win, CWBorderWidth, &wc); /* restore border */
|
||||||
detach(awesomeconf->clients, c);
|
detach(awesomeconf->clients, c);
|
||||||
detachstack(c);
|
|
||||||
if(*awesomeconf->client_sel == c)
|
if(*awesomeconf->client_sel == c)
|
||||||
focus(c->display, NULL, True, awesomeconf);
|
focus(c->display, NULL, True, awesomeconf);
|
||||||
XUngrabButton(c->display, AnyButton, AnyModifier, c->win);
|
XUngrabButton(c->display, AnyButton, AnyModifier, c->win);
|
||||||
|
|
Loading…
Reference in New Issue