mirror of https://github.com/0intro/wmii
some refactoring of defines
This commit is contained in:
parent
4a93c03dbc
commit
8820d14146
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue