Introduction
Introduction Statistics Contact Development Disclaimer Help
tremoved grabkeys, not necessary - dwm - [fork] customized build of dwm, the dy…
git clone git://src.adamsgaard.dk/dwm
Log
Files
Refs
README
LICENSE
---
commit 2d7bb8d7c974c1ae5430fa1561c850f0ea4623d3
parent 0235a84ef286db5c97239615ae525ce973641941
Author: Anselm R. Garbe <[email protected]>
Date: Sat, 15 Sep 2007 22:31:24 +0200
removed grabkeys, not necessary
Diffstat:
M dwm.c | 47 ++++++++++++++---------------…
1 file changed, 21 insertions(+), 26 deletions(-)
---
diff --git a/dwm.c b/dwm.c
t@@ -129,7 +129,6 @@ static void mappingnotify(XEvent *e);
static void maprequest(XEvent *e);
static void propertynotify(XEvent *e);
static void unmapnotify(XEvent *e);
-static void grabkeys(void);
static unsigned int idxoftag(const char *tag);
static void floating(void); /* default floating layout */
static void applyrules(Client *c);
t@@ -1070,9 +1069,26 @@ keypress(XEvent *e) {
KEYS
unsigned int len = sizeof keys / sizeof keys[0];
unsigned int i;
+ KeyCode code;
KeySym keysym;
- XKeyEvent *ev = &e->xkey;
-
+ XKeyEvent *ev;
+
+ if(!e) { /* grabkeys */
+ XUngrabKey(dpy, AnyKey, AnyModifier, root);
+ for(i = 0; i < len; i++) {
+ code = XKeysymToKeycode(dpy, keys[i].keysym);
+ XGrabKey(dpy, code, keys[i].mod, root, True,
+ GrabModeAsync, GrabModeAsync);
+ XGrabKey(dpy, code, keys[i].mod | LockMask, root, True,
+ GrabModeAsync, GrabModeAsync);
+ XGrabKey(dpy, code, keys[i].mod | numlockmask, root, T…
+ GrabModeAsync, GrabModeAsync);
+ XGrabKey(dpy, code, keys[i].mod | numlockmask | LockMa…
+ GrabModeAsync, GrabModeAsync);
+ }
+ return;
+ }
+ ev = &e->xkey;
keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
for(i = 0; i < len; i++)
if(keysym == keys[i].keysym
t@@ -1099,7 +1115,7 @@ mappingnotify(XEvent *e) {
XRefreshKeyboardMapping(ev);
if(ev->request == MappingKeyboard)
- grabkeys();
+ keypress(NULL);
}
static void
t@@ -1152,27 +1168,6 @@ unmapnotify(XEvent *e) {
unmanage(c);
}
-static void
-grabkeys(void) {
- KEYS
- unsigned int len = sizeof keys / sizeof keys[0];
- unsigned int i;
- KeyCode code;
-
- XUngrabKey(dpy, AnyKey, AnyModifier, root);
- for(i = 0; i < len; i++) {
- code = XKeysymToKeycode(dpy, keys[i].keysym);
- XGrabKey(dpy, code, keys[i].mod, root, True,
- GrabModeAsync, GrabModeAsync);
- XGrabKey(dpy, code, keys[i].mod | LockMask, root, True,
- GrabModeAsync, GrabModeAsync);
- XGrabKey(dpy, code, keys[i].mod | numlockmask, root, True,
- GrabModeAsync, GrabModeAsync);
- XGrabKey(dpy, code, keys[i].mod | numlockmask | LockMask, root…
- GrabModeAsync, GrabModeAsync);
- }
-}
-
static unsigned int
idxoftag(const char *tag) {
unsigned int i;
t@@ -1546,7 +1541,7 @@ setup(void) {
wa.cursor = cursor[CurNormal];
XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa);
XSelectInput(dpy, root, wa.event_mask);
- grabkeys();
+ keypress(NULL); /* grabkeys */
compileregs();
for(ntags = 0; tags[ntags]; ntags++);
seltags = emallocz(sizeof(Bool) * ntags);
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.