mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Clarify defines and make them not look like non-local ones; started by a
small diff from Thomas Pfaff. ok oga@
This commit is contained in:
parent
c585dfbf32
commit
69ac0624cc
4
calmwm.c
4
calmwm.c
@ -180,8 +180,8 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
|
||||
xu_setwmname(sc);
|
||||
|
||||
rootattr.cursor = Cursor_normal;
|
||||
rootattr.event_mask = ChildMask|PropertyChangeMask|EnterWindowMask|
|
||||
LeaveWindowMask|ColormapChangeMask|ButtonMask;
|
||||
rootattr.event_mask = CHILDMASK|PropertyChangeMask|EnterWindowMask|
|
||||
LeaveWindowMask|ColormapChangeMask|BUTTONMASK;
|
||||
|
||||
XChangeWindowAttributes(X_Dpy, sc->rootwin,
|
||||
CWEventMask|CWCursor, &rootattr);
|
||||
|
14
calmwm.h
14
calmwm.h
@ -43,15 +43,15 @@
|
||||
#define CONFFILE ".cwmrc"
|
||||
#define WMNAME "CWM"
|
||||
|
||||
#define ChildMask (SubstructureRedirectMask|SubstructureNotifyMask)
|
||||
#define ButtonMask (ButtonPressMask|ButtonReleaseMask)
|
||||
#define MouseMask (ButtonMask|PointerMotionMask)
|
||||
#define KeyMask (KeyPressMask|ExposureMask)
|
||||
#define MenuMask (ButtonMask|ButtonMotionMask|ExposureMask| \
|
||||
#define CHILDMASK (SubstructureRedirectMask|SubstructureNotifyMask)
|
||||
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
|
||||
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
|
||||
#define KEYMASK (KeyPressMask|ExposureMask)
|
||||
#define MENUMASK (BUTTONMASK|ButtonMotionMask|ExposureMask| \
|
||||
PointerMotionMask)
|
||||
#define MenuGrabMask (ButtonMask|ButtonMotionMask|StructureNotifyMask|\
|
||||
#define MENUGRABMASK (BUTTONMASK|ButtonMotionMask|StructureNotifyMask|\
|
||||
PointerMotionMask)
|
||||
#define SearchMask (KeyPressMask|ExposureMask)
|
||||
#define SEARCHMASK (KeyPressMask|ExposureMask)
|
||||
|
||||
/* kb movement */
|
||||
#define CWM_MOVE 0x0001
|
||||
|
8
kbfunc.c
8
kbfunc.c
@ -49,8 +49,8 @@ kbfunc_client_raise(struct client_ctx *cc, union arg *arg)
|
||||
client_raise(cc);
|
||||
}
|
||||
|
||||
#define typemask (CWM_MOVE | CWM_RESIZE | CWM_PTRMOVE)
|
||||
#define movemask (CWM_UP | CWM_DOWN | CWM_LEFT | CWM_RIGHT)
|
||||
#define TYPEMASK (CWM_MOVE | CWM_RESIZE | CWM_PTRMOVE)
|
||||
#define MOVEMASK (CWM_UP | CWM_DOWN | CWM_LEFT | CWM_RIGHT)
|
||||
void
|
||||
kbfunc_moveresize(struct client_ctx *cc, union arg *arg)
|
||||
{
|
||||
@ -72,7 +72,7 @@ kbfunc_moveresize(struct client_ctx *cc, union arg *arg)
|
||||
amt = amt * 10;
|
||||
}
|
||||
|
||||
switch (flags & movemask) {
|
||||
switch (flags & MOVEMASK) {
|
||||
case CWM_UP:
|
||||
my -= amt;
|
||||
break;
|
||||
@ -86,7 +86,7 @@ kbfunc_moveresize(struct client_ctx *cc, union arg *arg)
|
||||
mx -= amt;
|
||||
break;
|
||||
}
|
||||
switch (flags & typemask) {
|
||||
switch (flags & TYPEMASK) {
|
||||
case CWM_MOVE:
|
||||
cc->geom.y += my;
|
||||
if (cc->geom.y + cc->geom.height < 0)
|
||||
|
10
menu.c
10
menu.c
@ -113,11 +113,11 @@ menu_filter(struct screen_ctx *sc, struct menu_q *menuq, char *prompt,
|
||||
ysave = mc.y;
|
||||
|
||||
if (prompt == NULL) {
|
||||
evmask = MenuMask;
|
||||
evmask = MENUMASK;
|
||||
mc.promptstr[0] = '\0';
|
||||
mc.list = 1;
|
||||
} else {
|
||||
evmask = MenuMask | KeyMask; /* only accept keys if prompt */
|
||||
evmask = MENUMASK | KEYMASK; /* only accept keys if prompt */
|
||||
snprintf(mc.promptstr, sizeof(mc.promptstr), "%s%s", prompt,
|
||||
PROMPT_SCHAR);
|
||||
snprintf(mc.dispstr, sizeof(mc.dispstr), "%s%s%s", mc.promptstr,
|
||||
@ -140,7 +140,7 @@ menu_filter(struct screen_ctx *sc, struct menu_q *menuq, char *prompt,
|
||||
XSelectInput(X_Dpy, sc->menuwin, evmask);
|
||||
XMapRaised(X_Dpy, sc->menuwin);
|
||||
|
||||
if (xu_ptr_grab(sc->menuwin, MenuGrabMask, Cursor_question) < 0) {
|
||||
if (xu_ptr_grab(sc->menuwin, MENUGRABMASK, Cursor_question) < 0) {
|
||||
XUnmapWindow(X_Dpy, sc->menuwin);
|
||||
return (NULL);
|
||||
}
|
||||
@ -405,11 +405,11 @@ menu_handle_move(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc)
|
||||
XFillRectangle(X_Dpy, sc->menuwin, sc->gc, 0,
|
||||
font_height(sc) * mc->prev, mc->width, font_height(sc));
|
||||
if (mc->entry != -1) {
|
||||
xu_ptr_regrab(MenuGrabMask, Cursor_normal);
|
||||
xu_ptr_regrab(MENUGRABMASK, Cursor_normal);
|
||||
XFillRectangle(X_Dpy, sc->menuwin, sc->gc, 0,
|
||||
font_height(sc) * mc->entry, mc->width, font_height(sc));
|
||||
} else
|
||||
xu_ptr_regrab(MenuGrabMask, Cursor_default);
|
||||
xu_ptr_regrab(MENUGRABMASK, Cursor_default);
|
||||
}
|
||||
|
||||
static struct menu *
|
||||
|
@ -88,14 +88,14 @@ mousefunc_window_resize(struct client_ctx *cc, void *arg)
|
||||
client_raise(cc);
|
||||
client_ptrsave(cc);
|
||||
|
||||
if (xu_ptr_grab(cc->win, MouseMask, Cursor_resize) < 0)
|
||||
if (xu_ptr_grab(cc->win, MOUSEMASK, Cursor_resize) < 0)
|
||||
return;
|
||||
|
||||
xu_ptr_setpos(cc->win, cc->geom.width, cc->geom.height);
|
||||
mousefunc_sweep_draw(cc);
|
||||
|
||||
for (;;) {
|
||||
XMaskEvent(X_Dpy, MouseMask|ExposureMask, &ev);
|
||||
XMaskEvent(X_Dpy, MOUSEMASK|ExposureMask, &ev);
|
||||
|
||||
switch (ev.type) {
|
||||
case Expose:
|
||||
@ -144,13 +144,13 @@ mousefunc_window_move(struct client_ctx *cc, void *arg)
|
||||
if (cc->flags & CLIENT_FREEZE)
|
||||
return;
|
||||
|
||||
if (xu_ptr_grab(cc->win, MouseMask, Cursor_move) < 0)
|
||||
if (xu_ptr_grab(cc->win, MOUSEMASK, Cursor_move) < 0)
|
||||
return;
|
||||
|
||||
xu_ptr_getpos(cc->win, &px, &py);
|
||||
|
||||
for (;;) {
|
||||
XMaskEvent(X_Dpy, MouseMask|ExposureMask, &ev);
|
||||
XMaskEvent(X_Dpy, MOUSEMASK|ExposureMask, &ev);
|
||||
|
||||
switch (ev.type) {
|
||||
case Expose:
|
||||
|
Loading…
Reference in New Issue
Block a user