mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
remove XXX and move a configure event out of the event handler functions.
reminded by a similiar diff from Thomas Pfaff. ok oga@
This commit is contained in:
parent
00b502b1da
commit
a12fb346a2
4
calmwm.h
4
calmwm.h
|
@ -375,9 +375,6 @@ struct menu *menu_filter(struct screen_ctx *, struct menu_q *,
|
||||||
void (*)(struct menu *, int));
|
void (*)(struct menu *, int));
|
||||||
void menu_init(struct screen_ctx *);
|
void menu_init(struct screen_ctx *);
|
||||||
|
|
||||||
/* XXX should be xu_ */
|
|
||||||
void xev_reconfig(struct client_ctx *);
|
|
||||||
|
|
||||||
void xev_loop(void);
|
void xev_loop(void);
|
||||||
|
|
||||||
void xu_getatoms(void);
|
void xu_getatoms(void);
|
||||||
|
@ -390,6 +387,7 @@ void xu_ptr_setpos(Window, int, int);
|
||||||
void xu_ptr_getpos(Window, int *, int *);
|
void xu_ptr_getpos(Window, int *, int *);
|
||||||
void xu_key_grab(Window, int, int);
|
void xu_key_grab(Window, int, int);
|
||||||
void xu_key_ungrab(Window, int, int);
|
void xu_key_ungrab(Window, int, int);
|
||||||
|
void xu_configure(struct client_ctx *);
|
||||||
void xu_sendmsg(Window, Atom, long);
|
void xu_sendmsg(Window, Atom, long);
|
||||||
int xu_getprop(Window, Atom, Atom, long, u_char **);
|
int xu_getprop(Window, Atom, Atom, long, u_char **);
|
||||||
int xu_getstrprop(Window, Atom, char **);
|
int xu_getstrprop(Window, Atom, char **);
|
||||||
|
|
6
client.c
6
client.c
|
@ -114,7 +114,7 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
|
||||||
XAddToSaveSet(X_Dpy, cc->win);
|
XAddToSaveSet(X_Dpy, cc->win);
|
||||||
|
|
||||||
/* Notify client of its configuration. */
|
/* Notify client of its configuration. */
|
||||||
xev_reconfig(cc);
|
xu_configure(cc);
|
||||||
|
|
||||||
(state == IconicState) ? client_hide(cc) : client_unhide(cc);
|
(state == IconicState) ? client_hide(cc) : client_unhide(cc);
|
||||||
xu_setstate(cc, cc->state);
|
xu_setstate(cc, cc->state);
|
||||||
|
@ -390,14 +390,14 @@ client_resize(struct client_ctx *cc)
|
||||||
|
|
||||||
XMoveResizeWindow(X_Dpy, cc->win, cc->geom.x,
|
XMoveResizeWindow(X_Dpy, cc->win, cc->geom.x,
|
||||||
cc->geom.y, cc->geom.width, cc->geom.height);
|
cc->geom.y, cc->geom.width, cc->geom.height);
|
||||||
xev_reconfig(cc);
|
xu_configure(cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
client_move(struct client_ctx *cc)
|
client_move(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
XMoveWindow(X_Dpy, cc->win, cc->geom.x, cc->geom.y);
|
XMoveWindow(X_Dpy, cc->win, cc->geom.x, cc->geom.y);
|
||||||
xev_reconfig(cc);
|
xu_configure(cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
22
xevents.c
22
xevents.c
|
@ -166,7 +166,7 @@ xev_handle_configurerequest(XEvent *ee)
|
||||||
wc.border_width = cc->bwidth;
|
wc.border_width = cc->bwidth;
|
||||||
|
|
||||||
XConfigureWindow(X_Dpy, cc->win, e->value_mask, &wc);
|
XConfigureWindow(X_Dpy, cc->win, e->value_mask, &wc);
|
||||||
xev_reconfig(cc);
|
xu_configure(cc);
|
||||||
} else {
|
} else {
|
||||||
/* let it do what it wants, it'll be ours when we map it. */
|
/* let it do what it wants, it'll be ours when we map it. */
|
||||||
wc.x = e->x;
|
wc.x = e->x;
|
||||||
|
@ -213,25 +213,6 @@ test:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
xev_reconfig(struct client_ctx *cc)
|
|
||||||
{
|
|
||||||
XConfigureEvent ce;
|
|
||||||
|
|
||||||
ce.type = ConfigureNotify;
|
|
||||||
ce.event = cc->win;
|
|
||||||
ce.window = cc->win;
|
|
||||||
ce.x = cc->geom.x;
|
|
||||||
ce.y = cc->geom.y;
|
|
||||||
ce.width = cc->geom.width;
|
|
||||||
ce.height = cc->geom.height;
|
|
||||||
ce.border_width = cc->bwidth;
|
|
||||||
ce.above = None;
|
|
||||||
ce.override_redirect = 0;
|
|
||||||
|
|
||||||
XSendEvent(X_Dpy, cc->win, False, StructureNotifyMask, (XEvent *)&ce);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xev_handle_enternotify(XEvent *ee)
|
xev_handle_enternotify(XEvent *ee)
|
||||||
{
|
{
|
||||||
|
@ -429,7 +410,6 @@ xev_handle_expose(XEvent *ee)
|
||||||
client_draw_border(cc);
|
client_draw_border(cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
volatile sig_atomic_t _xev_quit = 0;
|
volatile sig_atomic_t _xev_quit = 0;
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
19
xutil.c
19
xutil.c
|
@ -118,6 +118,25 @@ xu_key_ungrab(Window win, int mask, int keysym)
|
||||||
XUngrabKey(X_Dpy, code, (mask | ign_mods[i]), win);
|
XUngrabKey(X_Dpy, code, (mask | ign_mods[i]), win);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xu_configure(struct client_ctx *cc)
|
||||||
|
{
|
||||||
|
XConfigureEvent ce;
|
||||||
|
|
||||||
|
ce.type = ConfigureNotify;
|
||||||
|
ce.event = cc->win;
|
||||||
|
ce.window = cc->win;
|
||||||
|
ce.x = cc->geom.x;
|
||||||
|
ce.y = cc->geom.y;
|
||||||
|
ce.width = cc->geom.width;
|
||||||
|
ce.height = cc->geom.height;
|
||||||
|
ce.border_width = cc->bwidth;
|
||||||
|
ce.above = None;
|
||||||
|
ce.override_redirect = 0;
|
||||||
|
|
||||||
|
XSendEvent(X_Dpy, cc->win, False, StructureNotifyMask, (XEvent *)&ce);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xu_sendmsg(Window win, Atom atm, long val)
|
xu_sendmsg(Window win, Atom atm, long val)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user