rename configure() as window_configure() and passes info as args

This commit is contained in:
Julien Danjou 2007-10-17 17:29:21 +02:00
parent 2e832c8186
commit cabfc67b87
3 changed files with 16 additions and 15 deletions

View File

@ -253,22 +253,22 @@ ban(Client * c)
* \param c the client
*/
void
configure(Client * c)
window_configure(Display *disp, Window win, int x, int y, int w, int h, int border)
{
XConfigureEvent ce;
ce.type = ConfigureNotify;
ce.display = c->display;
ce.event = c->win;
ce.window = c->win;
ce.x = c->x;
ce.y = c->y;
ce.width = c->w;
ce.height = c->h;
ce.border_width = c->border;
ce.display = disp;
ce.event = win;
ce.window = win;
ce.x = x;
ce.y = y;
ce.width = w;
ce.height = h;
ce.border_width = border;
ce.above = None;
ce.override_redirect = False;
XSendEvent(c->display, c->win, False, StructureNotifyMask, (XEvent *) & ce);
XSendEvent(disp, win, False, StructureNotifyMask, (XEvent *) & ce);
}
/** Attach client after another one
@ -449,7 +449,8 @@ manage(Display *disp, Window w, XWindowAttributes *wa, awesome_config *awesomeco
wc.border_width = c->border;
XConfigureWindow(disp, w, CWBorderWidth, &wc);
XSetWindowBorder(disp, w, awesomeconf->colors_normal[ColBorder].pixel);
configure(c); /* propagates border_width, if size doesn't change */
/* propagates border_width, if size doesn't change */
window_configure(c->display, c->win, c->x, c->y, c->w, c->h, c->border);
updatesizehints(c);
XSelectInput(disp, w, StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
if(awesomeconf->have_shape)
@ -543,7 +544,7 @@ resize(Client *c, int x, int y, int w, int h, awesome_config *awesomeconf, Bool
c->h = wc.height = h;
wc.border_width = c->border;
XConfigureWindow(c->display, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
configure(c);
window_configure(c->display, c->win, c->x, c->y, c->w, c->h, c->border);
XSync(c->display, False);
if(XineramaIsActive(c->display))
{

View File

@ -33,7 +33,7 @@ inline void client_attach(Client **, Client *);
inline void client_detach(Client **, Client *);
void client_reattach_after(Client *, Client *);
void ban(Client *); /* bans c */
void configure(Client *); /* send synthetic configure event */
void window_configure(Display *, Window, int, int, int, int, int);
void focus(Client *, Bool, awesome_config *);
void manage(Display *, Window, XWindowAttributes *, awesome_config *);
void resize(Client *, int, int, int, int, awesome_config *, Bool); /* resize with given coordinates c */

View File

@ -275,12 +275,12 @@ handle_event_configurerequest(XEvent * e, awesome_config *awesomeconf)
if((c->y + c->h) > DisplayHeight(c->display, c->phys_screen) && c->isfloating)
c->y = DisplayHeight(c->display, c->phys_screen) / 2 - c->h / 2; /* center in y direction */
if((ev->value_mask & (CWX | CWY)) && !(ev->value_mask & (CWWidth | CWHeight)))
configure(c);
window_configure(c->display, c->win, c->x, c->y, c->w, c->h, c->border);
if(isvisible(c, c->screen, awesomeconf[c->screen].tags, awesomeconf[c->screen].ntags))
XMoveResizeWindow(e->xany.display, c->win, c->x, c->y, c->w, c->h);
}
else
configure(c);
window_configure(c->display, c->win, c->x, c->y, c->w, c->h, c->border);
}
else
{