restack and arrange take screen as arg
This commit is contained in:
parent
389e1f809a
commit
e91de5bfb9
4
client.c
4
client.c
|
@ -415,7 +415,7 @@ manage(Display * disp, int screen, DC *drawcontext, Window w, XWindowAttributes
|
||||||
attachstack(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, drawcontext, awesomeconf);
|
arrange(disp, screen, drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -576,7 +576,7 @@ unmanage(Client * c, DC *drawcontext, long state, awesome_config *awesomeconf)
|
||||||
XSetErrorHandler(xerror);
|
XSetErrorHandler(xerror);
|
||||||
XUngrabServer(c->display);
|
XUngrabServer(c->display);
|
||||||
if(state != NormalState)
|
if(state != NormalState)
|
||||||
arrange(c->display, drawcontext, awesomeconf);
|
arrange(c->display, c->screen, drawcontext, awesomeconf);
|
||||||
p_delete(&c->tags);
|
p_delete(&c->tags);
|
||||||
p_delete(&c);
|
p_delete(&c);
|
||||||
}
|
}
|
||||||
|
|
8
event.c
8
event.c
|
@ -183,14 +183,14 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
|
||||||
return;
|
return;
|
||||||
if(ev->button == Button1 && (IS_ARRANGE(floating) || c->isfloating))
|
if(ev->button == Button1 && (IS_ARRANGE(floating) || c->isfloating))
|
||||||
{
|
{
|
||||||
restack(e->xany.display, &dc, awesomeconf);
|
restack(e->xany.display, DefaultScreen(e->xany.display), &dc, awesomeconf);
|
||||||
movemouse(c, awesomeconf);
|
movemouse(c, awesomeconf);
|
||||||
}
|
}
|
||||||
else if(ev->button == Button2)
|
else if(ev->button == Button2)
|
||||||
uicb_zoom(e->xany.display, &dc, awesomeconf, NULL);
|
uicb_zoom(e->xany.display, &dc, awesomeconf, NULL);
|
||||||
else if(ev->button == Button3 && (IS_ARRANGE(floating) || c->isfloating) && !c->isfixed)
|
else if(ev->button == Button3 && (IS_ARRANGE(floating) || c->isfloating) && !c->isfixed)
|
||||||
{
|
{
|
||||||
restack(e->xany.display, &dc, awesomeconf);
|
restack(e->xany.display, DefaultScreen(e->xany.display), &dc, awesomeconf);
|
||||||
resizemouse(c, awesomeconf);
|
resizemouse(c, awesomeconf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,7 @@ handle_event_configurenotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
XResizeWindow(e->xany.display, awesomeconf->statusbar.window,
|
XResizeWindow(e->xany.display, awesomeconf->statusbar.window,
|
||||||
DisplayWidth(e->xany.display, DefaultScreen(e->xany.display)), awesomeconf->statusbar.height);
|
DisplayWidth(e->xany.display, DefaultScreen(e->xany.display)), awesomeconf->statusbar.height);
|
||||||
updatebarpos(e->xany.display, awesomeconf->statusbar);
|
updatebarpos(e->xany.display, awesomeconf->statusbar);
|
||||||
arrange(e->xany.display, &dc, awesomeconf);
|
arrange(e->xany.display, DefaultScreen(e->xany.display), &dc, awesomeconf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
case XA_WM_TRANSIENT_FOR:
|
case XA_WM_TRANSIENT_FOR:
|
||||||
XGetTransientForHint(e->xany.display, c->win, &trans);
|
XGetTransientForHint(e->xany.display, c->win, &trans);
|
||||||
if(!c->isfloating && (c->isfloating = (getclient(trans) != NULL)))
|
if(!c->isfloating && (c->isfloating = (getclient(trans) != NULL)))
|
||||||
arrange(e->xany.display, &dc, awesomeconf);
|
arrange(e->xany.display, DefaultScreen(e->xany.display), &dc, awesomeconf);
|
||||||
break;
|
break;
|
||||||
case XA_WM_NORMAL_HINTS:
|
case XA_WM_NORMAL_HINTS:
|
||||||
updatesizehints(c);
|
updatesizehints(c);
|
||||||
|
|
18
layout.c
18
layout.c
|
@ -33,7 +33,7 @@
|
||||||
extern Client *clients, *sel; /* global client list */
|
extern Client *clients, *sel; /* global client list */
|
||||||
|
|
||||||
void
|
void
|
||||||
arrange(Display * disp, DC *drawcontext, awesome_config *awesomeconf)
|
arrange(Display * disp, int screen, DC *drawcontext, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ arrange(Display * disp, DC *drawcontext, awesome_config *awesomeconf)
|
||||||
else
|
else
|
||||||
ban(c);
|
ban(c);
|
||||||
awesomeconf->current_layout->arrange(disp, awesomeconf);
|
awesomeconf->current_layout->arrange(disp, awesomeconf);
|
||||||
focus(disp, DefaultScreen(disp), drawcontext, NULL, True, awesomeconf);
|
focus(disp, screen, drawcontext, NULL, True, awesomeconf);
|
||||||
restack(disp, drawcontext, awesomeconf);
|
restack(disp, screen, drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -63,7 +63,7 @@ uicb_focusnext(Display *disp __attribute__ ((unused)),
|
||||||
if(c)
|
if(c)
|
||||||
{
|
{
|
||||||
focus(c->display, c->screen, drawcontext, c, True, awesomeconf);
|
focus(c->display, c->screen, drawcontext, c, True, awesomeconf);
|
||||||
restack(c->display, drawcontext, awesomeconf);
|
restack(c->display, c->screen, drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ uicb_focusprev(Display *disp __attribute__ ((unused)),
|
||||||
if(c)
|
if(c)
|
||||||
{
|
{
|
||||||
focus(c->display, c->screen, drawcontext, c, True, awesomeconf);
|
focus(c->display, c->screen, drawcontext, c, True, awesomeconf);
|
||||||
restack(c->display, drawcontext, awesomeconf);
|
restack(c->display, c->screen, drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ loadawesomeprops(Display *disp, int screen, awesome_config * awesomeconf)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf)
|
restack(Display * disp, int screen, DC * drawcontext, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
drawstatusbar(disp, screen, drawcontext, awesomeconf);
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
if(sel->isfloating || IS_ARRANGE(floating))
|
if(sel->isfloating || IS_ARRANGE(floating))
|
||||||
|
@ -180,7 +180,7 @@ uicb_setlayout(Display *disp,
|
||||||
c->ftview = True;
|
c->ftview = True;
|
||||||
|
|
||||||
if(sel)
|
if(sel)
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
else
|
else
|
||||||
drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
|
|
||||||
|
@ -275,6 +275,6 @@ uicb_zoom(Display *disp __attribute__ ((unused)),
|
||||||
detach(sel);
|
detach(sel);
|
||||||
attach(sel);
|
attach(sel);
|
||||||
focus(sel->display, sel->screen, drawcontext, sel, True, awesomeconf);
|
focus(sel->display, sel->screen, drawcontext, sel, True, awesomeconf);
|
||||||
arrange(sel->display, drawcontext, awesomeconf);
|
arrange(sel->display, sel->screen, drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
layout.h
4
layout.h
|
@ -29,8 +29,8 @@
|
||||||
|
|
||||||
#define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False)
|
#define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False)
|
||||||
|
|
||||||
void arrange(Display *, DC *, awesome_config *); /* arranges all windows depending on the layout in use */
|
void arrange(Display *, int, DC *, awesome_config *); /* arranges all windows depending on the layout in use */
|
||||||
void restack(Display *, DC *, awesome_config *); /* restores z layers of all clients */
|
void restack(Display *, int, DC *, awesome_config *); /* restores z layers of all clients */
|
||||||
void uicb_focusnext(Display *, DC *, awesome_config *, const char *); /* focuses next visible client */
|
void uicb_focusnext(Display *, DC *, awesome_config *, const char *); /* focuses next visible client */
|
||||||
void uicb_focusprev(Display *, DC *, awesome_config *, const char *); /* focuses prev visible client */
|
void uicb_focusprev(Display *, DC *, awesome_config *, const char *); /* focuses prev visible client */
|
||||||
void uicb_setlayout(Display *, DC *, awesome_config *, const char *); /* sets layout, NULL means next layout */
|
void uicb_setlayout(Display *, DC *, awesome_config *, const char *); /* sets layout, NULL means next layout */
|
||||||
|
|
|
@ -43,7 +43,7 @@ uicb_setnmaster(Display *disp,
|
||||||
if((awesomeconf->nmaster = (int) compute_new_value_from_arg(arg, (double) awesomeconf->nmaster)) < 0)
|
if((awesomeconf->nmaster = (int) compute_new_value_from_arg(arg, (double) awesomeconf->nmaster)) < 0)
|
||||||
awesomeconf->nmaster = 0;
|
awesomeconf->nmaster = 0;
|
||||||
|
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -58,7 +58,7 @@ uicb_setncols(Display *disp,
|
||||||
if((awesomeconf->ncols = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncols)) < 1)
|
if((awesomeconf->ncols = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncols)) < 1)
|
||||||
awesomeconf->ncols = 1;
|
awesomeconf->ncols = 1;
|
||||||
|
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -75,7 +75,7 @@ uicb_setmwfact(Display *disp,
|
||||||
else if(awesomeconf->mwfact > 0.9)
|
else if(awesomeconf->mwfact > 0.9)
|
||||||
awesomeconf->mwfact = 0.9;
|
awesomeconf->mwfact = 0.9;
|
||||||
|
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -149,6 +149,6 @@ uicb_togglebar(Display *disp,
|
||||||
else
|
else
|
||||||
awesomeconf->statusbar.position = BarOff;
|
awesomeconf->statusbar.position = BarOff;
|
||||||
updatebarpos(disp, awesomeconf->statusbar);
|
updatebarpos(disp, awesomeconf->statusbar);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
16
tag.c
16
tag.c
|
@ -159,7 +159,7 @@ uicb_tag(Display *disp,
|
||||||
if(i >= 0 && i < awesomeconf->ntags)
|
if(i >= 0 && i < awesomeconf->ntags)
|
||||||
sel->tags[i] = True;
|
sel->tags[i] = True;
|
||||||
saveprops(sel, awesomeconf->ntags);
|
saveprops(sel, awesomeconf->ntags);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Toggle floating state of a client
|
/** Toggle floating state of a client
|
||||||
|
@ -188,7 +188,7 @@ uicb_togglefloating(Display *disp,
|
||||||
sel->rh = sel->h;
|
sel->rh = sel->h;
|
||||||
}
|
}
|
||||||
saveprops(sel, awesomeconf->ntags);
|
saveprops(sel, awesomeconf->ntags);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Toggle tag view
|
/** Toggle tag view
|
||||||
|
@ -213,7 +213,7 @@ uicb_toggletag(Display *disp,
|
||||||
if(j == awesomeconf->ntags)
|
if(j == awesomeconf->ntags)
|
||||||
sel->tags[i] = True;
|
sel->tags[i] = True;
|
||||||
saveprops(sel, awesomeconf->ntags);
|
saveprops(sel, awesomeconf->ntags);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Add a tag to viewed tags
|
/** Add a tag to viewed tags
|
||||||
|
@ -236,7 +236,7 @@ uicb_toggleview(Display *disp,
|
||||||
if(j == awesomeconf->ntags)
|
if(j == awesomeconf->ntags)
|
||||||
awesomeconf->selected_tags[i] = True; /* cannot toggle last view */
|
awesomeconf->selected_tags[i] = True; /* cannot toggle last view */
|
||||||
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** View tag
|
/** View tag
|
||||||
|
@ -265,7 +265,7 @@ uicb_view(Display *disp,
|
||||||
awesomeconf->current_layout = awesomeconf->tag_layouts[i];
|
awesomeconf->current_layout = awesomeconf->tag_layouts[i];
|
||||||
}
|
}
|
||||||
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** View previously selected tags
|
/** View previously selected tags
|
||||||
|
@ -289,7 +289,7 @@ uicb_viewprevtags(Display * disp,
|
||||||
awesomeconf->selected_tags[i] = awesomeconf->prev_selected_tags[i];
|
awesomeconf->selected_tags[i] = awesomeconf->prev_selected_tags[i];
|
||||||
awesomeconf->prev_selected_tags[i] = t;
|
awesomeconf->prev_selected_tags[i] = t;
|
||||||
}
|
}
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** View next tag
|
/** View next tag
|
||||||
|
@ -316,7 +316,7 @@ uicb_tag_viewnext(Display *disp,
|
||||||
firsttag = 0;
|
firsttag = 0;
|
||||||
awesomeconf->selected_tags[firsttag] = True;
|
awesomeconf->selected_tags[firsttag] = True;
|
||||||
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** View previous tag
|
/** View previous tag
|
||||||
|
@ -343,5 +343,5 @@ uicb_tag_viewprev(Display *disp,
|
||||||
firsttag = awesomeconf->ntags - 1;
|
firsttag = awesomeconf->ntags - 1;
|
||||||
awesomeconf->selected_tags[firsttag] = True;
|
awesomeconf->selected_tags[firsttag] = True;
|
||||||
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue