some refactoring of defines

This commit is contained in:
Anselm R. Garbe 2006-03-13 09:22:35 +01:00
parent 4a93c03dbc
commit 8820d14146
4 changed files with 5 additions and 8 deletions

View File

@ -170,7 +170,7 @@ send_client_message(Window w, Atom a, long value)
void
kill_client(Client * c)
{
if(c->proto & PROTO_DEL)
if(c->proto & WM_PROTOCOL_DELWIN)
send_client_message(c->win, wm_atom[WMProtocols], wm_atom[WMDelete]);
else
XKillClient(dpy, c->win);

View File

@ -10,14 +10,12 @@
#include "wm.h"
#define NUM_MASKS 8
void
init_lock_modifiers()
{
XModifierKeymap *modmap;
KeyCode num_lock;
static int masks[NUM_MASKS] = {
static int masks[] = {
ShiftMask, LockMask, ControlMask, Mod1Mask,
Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask
};
@ -28,7 +26,7 @@ init_lock_modifiers()
num_lock = XKeysymToKeycode(dpy, XStringToKeysym("Num_Lock"));
if(modmap && modmap->max_keypermod > 0) {
int max = NUM_MASKS * modmap->max_keypermod;
int max = (sizeof(masks) / sizeof(int)) * modmap->max_keypermod;
for(i = 0; i < max; i++) {
if(num_lock && (modmap->modifiermap[i] == num_lock))
num_lock_mask = masks[i / modmap->max_keypermod];
@ -63,7 +61,6 @@ blitz_strtomod(char *val)
static void
grab_key(Key *k)
{
fprintf(stderr, "grabbing %s %ld %d\n", k->name, k->mod, k->key);
XGrabKey(dpy, k->key, k->mod, root,
True, GrabModeAsync, GrabModeAsync);
if(num_lock_mask) {

View File

@ -99,7 +99,7 @@ win_proto(Window w)
}
for(i = 0; i < res; i++) {
if(protocols[i] == wm_atom[WMDelete])
protos |= PROTO_DEL;
protos |= WM_PROTOCOL_DELWIN;
}
free((char *) protocols);
return protos;

View File

@ -73,12 +73,12 @@ enum {
FsFmode
};
#define PROTO_DEL 1
#define DEF_BORDER 3
#define DEF_SNAP 20
#define ROOT_MASK SubstructureRedirectMask
#define CLIENT_MASK (StructureNotifyMask | PropertyChangeMask)
#define WM_PROTOCOL_DELWIN 1
typedef struct Tag Tag;
typedef struct Area Area;