restack does not need Display as arg

This commit is contained in:
Julien Danjou 2007-10-15 18:28:07 +02:00
parent 0026bd3813
commit fefa16611a
4 changed files with 17 additions and 17 deletions

View File

@ -202,7 +202,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
{ {
if (ev->button == Button1) if (ev->button == Button1)
{ {
restack(c->display, &awesomeconf[c->screen]); restack(&awesomeconf[c->screen]);
grabbuttons(c, True, True, awesomeconf->modkey, awesomeconf->numlockmask); grabbuttons(c, True, True, awesomeconf->modkey, awesomeconf->numlockmask);
} }
} }
@ -211,7 +211,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
if(!IS_ARRANGE(c->screen, layout_floating) && !c->isfloating) if(!IS_ARRANGE(c->screen, layout_floating) && !c->isfloating)
uicb_togglefloating(&awesomeconf[c->screen], NULL); uicb_togglefloating(&awesomeconf[c->screen], NULL);
else else
restack(e->xany.display, &awesomeconf[c->screen]); restack(&awesomeconf[c->screen]);
movemouse(c, awesomeconf); movemouse(c, awesomeconf);
} }
else if(ev->button == Button2) else if(ev->button == Button2)
@ -226,7 +226,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
if(!IS_ARRANGE(c->screen, layout_floating) && !c->isfloating) if(!IS_ARRANGE(c->screen, layout_floating) && !c->isfloating)
uicb_togglefloating(&awesomeconf[c->screen], NULL); uicb_togglefloating(&awesomeconf[c->screen], NULL);
else else
restack(e->xany.display, &awesomeconf[c->screen]); restack(&awesomeconf[c->screen]);
resizemouse(c, awesomeconf); resizemouse(c, awesomeconf);
} }
else if(ev->button == Button4) else if(ev->button == Button4)

View File

@ -48,7 +48,7 @@ arrange(awesome_config *awesomeconf)
} }
awesomeconf->current_layout->arrange(awesomeconf); awesomeconf->current_layout->arrange(awesomeconf);
focus(NULL, True, awesomeconf); focus(NULL, True, awesomeconf);
restack(awesomeconf->display, awesomeconf); restack(awesomeconf);
} }
void void
@ -65,7 +65,7 @@ uicb_focusnext(awesome_config * awesomeconf,
if(c) if(c)
{ {
focus(c, True, awesomeconf); focus(c, True, awesomeconf);
restack(c->display, awesomeconf); restack(awesomeconf);
} }
} }
@ -86,7 +86,7 @@ uicb_focusprev(awesome_config *awesomeconf,
if(c) if(c)
{ {
focus(c, True, awesomeconf); focus(c, True, awesomeconf);
restack(c->display, awesomeconf); restack(awesomeconf);
} }
} }
@ -113,7 +113,7 @@ loadawesomeprops(awesome_config * awesomeconf)
} }
void void
restack(Display * disp, awesome_config *awesomeconf) restack(awesome_config *awesomeconf)
{ {
Client *c; Client *c;
XEvent ev; XEvent ev;
@ -123,33 +123,33 @@ restack(Display * disp, awesome_config *awesomeconf)
if(!*awesomeconf->client_sel) if(!*awesomeconf->client_sel)
return; return;
if(awesomeconf->allow_lower_floats) if(awesomeconf->allow_lower_floats)
XRaiseWindow(disp, (*awesomeconf->client_sel)->win); XRaiseWindow(awesomeconf->display, (*awesomeconf->client_sel)->win);
else else
{ {
if((*awesomeconf->client_sel)->isfloating || IS_ARRANGE(0, layout_floating)) if((*awesomeconf->client_sel)->isfloating || IS_ARRANGE(0, layout_floating))
XRaiseWindow(disp, (*awesomeconf->client_sel)->win); XRaiseWindow(awesomeconf->display, (*awesomeconf->client_sel)->win);
if(!IS_ARRANGE(0, layout_floating)) if(!IS_ARRANGE(0, layout_floating))
{ {
wc.stack_mode = Below; wc.stack_mode = Below;
wc.sibling = awesomeconf->statusbar.window; wc.sibling = awesomeconf->statusbar.window;
if(!(*awesomeconf->client_sel)->isfloating) if(!(*awesomeconf->client_sel)->isfloating)
{ {
XConfigureWindow(disp, (*awesomeconf->client_sel)->win, CWSibling | CWStackMode, &wc); XConfigureWindow(awesomeconf->display, (*awesomeconf->client_sel)->win, CWSibling | CWStackMode, &wc);
wc.sibling = (*awesomeconf->client_sel)->win; wc.sibling = (*awesomeconf->client_sel)->win;
} }
for(c = *awesomeconf->clients; c; c = c->next) for(c = *awesomeconf->clients; c; c = c->next)
{ {
if(!IS_TILED(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags) || c == *awesomeconf->client_sel) if(!IS_TILED(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags) || c == *awesomeconf->client_sel)
continue; continue;
XConfigureWindow(disp, c->win, CWSibling | CWStackMode, &wc); XConfigureWindow(awesomeconf->display, c->win, CWSibling | CWStackMode, &wc);
wc.sibling = c->win; wc.sibling = c->win;
} }
} }
} }
if(awesomeconf->focus_move_pointer) if(awesomeconf->focus_move_pointer)
XWarpPointer(disp, None, (*awesomeconf->client_sel)->win, 0, 0, 0, 0, (*awesomeconf->client_sel)->w / 2, (*awesomeconf->client_sel)->h / 2); XWarpPointer(awesomeconf->display, None, (*awesomeconf->client_sel)->win, 0, 0, 0, 0, (*awesomeconf->client_sel)->w / 2, (*awesomeconf->client_sel)->h / 2);
XSync(disp, False); XSync(awesomeconf->display, False);
while(XCheckMaskEvent(disp, EnterWindowMask, &ev)); while(XCheckMaskEvent(awesomeconf->display, EnterWindowMask, &ev));
} }
void void

View File

@ -30,7 +30,7 @@
#define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False) #define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False)
void arrange(awesome_config *); /* arranges all windows depending on the layout in use */ void arrange(awesome_config *); /* arranges all windows depending on the layout in use */
void restack(Display *, awesome_config *); /* restores z layers of all clients */ void restack(awesome_config *); /* restores z layers of all clients */
void loadawesomeprops(awesome_config *); void loadawesomeprops(awesome_config *);
void saveawesomeprops(awesome_config *); void saveawesomeprops(awesome_config *);

View File

@ -198,7 +198,7 @@ uicb_focusnextscreen(awesome_config * awesomeconf,
if(c) if(c)
{ {
focus(c, True, &awesomeconf[next_screen - awesomeconf->screen]); focus(c, True, &awesomeconf[next_screen - awesomeconf->screen]);
restack(c->display, &awesomeconf[next_screen - awesomeconf->screen]); restack(&awesomeconf[next_screen - awesomeconf->screen]);
} }
move_mouse_pointer_to_screen(awesomeconf->display, next_screen); move_mouse_pointer_to_screen(awesomeconf->display, next_screen);
} }
@ -214,7 +214,7 @@ uicb_focusprevscreen(awesome_config * awesomeconf,
if(c) if(c)
{ {
focus(c, True, &awesomeconf[prev_screen - awesomeconf->screen]); focus(c, True, &awesomeconf[prev_screen - awesomeconf->screen]);
restack(c->display, &awesomeconf[prev_screen - awesomeconf->screen]); restack(&awesomeconf[prev_screen - awesomeconf->screen]);
} }
move_mouse_pointer_to_screen(awesomeconf->display, prev_screen); move_mouse_pointer_to_screen(awesomeconf->display, prev_screen);
} }