Introduction
Introduction Statistics Contact Development Disclaimer Help
tchanged grabkeys, removed initmodmap - dwm - [fork] customized build of dwm, t…
git clone git://src.adamsgaard.dk/dwm
Log
Files
Refs
README
LICENSE
---
commit 85da53785614bcaa626cd1346ce8753291b01760
parent 2b4157eccd649682c200de837193dd0a24129dc7
Author: Anselm R Garbe <[email protected]>
Date: Sat, 23 Aug 2008 09:31:28 +0100
changed grabkeys, removed initmodmap
Diffstat:
M dwm.c | 47 ++++++++++++++---------------…
1 file changed, 21 insertions(+), 26 deletions(-)
---
diff --git a/dwm.c b/dwm.c
t@@ -158,7 +158,6 @@ static Bool gettextprop(Window w, Atom atom, char *text, u…
static void grabbuttons(Client *c, Bool focused);
static void grabkeys(void);
static void initfont(const char *fontstr);
-static void initmodmap(void);
static Bool isprotodel(Client *c);
static void keypress(XEvent *e);
static void killclient(const Arg *arg);
t@@ -752,15 +751,27 @@ grabbuttons(Client *c, Bool focused) {
void
grabkeys(void) {
unsigned int i, j;
- unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|Loc…
- KeyCode code;
+ XModifierKeymap *modmap;
- XUngrabKey(dpy, AnyKey, AnyModifier, root);
- for(i = 0; i < LENGTH(keys); i++) {
- code = XKeysymToKeycode(dpy, keys[i].keysym);
- for(j = 0; j < LENGTH(modifiers); j++)
- XGrabKey(dpy, code, keys[i].mod | modifiers[j], root, …
- GrabModeAsync, GrabModeAsync);
+ /* update modifier map */
+ modmap = XGetModifierMapping(dpy);
+ for(i = 0; i < 8; i++)
+ for(j = 0; j < modmap->max_keypermod; j++)
+ if(modmap->modifiermap[i * modmap->max_keypermod + j] …
+ numlockmask = (1 << i);
+ XFreeModifiermap(modmap);
+
+ { /* grab keys */
+ unsigned int modifiers[] = { 0, LockMask, numlockmask, numlock…
+ KeyCode code;
+
+ XUngrabKey(dpy, AnyKey, AnyModifier, root);
+ for(i = 0; i < LENGTH(keys); i++) {
+ code = XKeysymToKeycode(dpy, keys[i].keysym);
+ for(j = 0; j < LENGTH(modifiers); j++)
+ XGrabKey(dpy, code, keys[i].mod | modifiers[j]…
+ GrabModeAsync, GrabModeAsync);
+ }
}
}
t@@ -804,19 +815,6 @@ initfont(const char *fontstr) {
dc.font.height = dc.font.ascent + dc.font.descent;
}
-void
-initmodmap(void) {
- unsigned int i, j;
- XModifierKeymap *modmap;
-
- modmap = XGetModifierMapping(dpy);
- for(i = 0; i < 8; i++)
- for(j = 0; j < modmap->max_keypermod; j++)
- if(modmap->modifiermap[i * modmap->max_keypermod + j] …
- numlockmask = (1 << i);
- XFreeModifiermap(modmap);
-}
-
Bool
isprotodel(Client *c) {
int i, n;
t@@ -929,10 +927,8 @@ mappingnotify(XEvent *e) {
XMappingEvent *ev = &e->xmapping;
XRefreshKeyboardMapping(ev);
- if(ev->request == MappingKeyboard) {
- initmodmap();
+ if(ev->request == MappingKeyboard)
grabkeys();
- }
}
void
t@@ -1379,7 +1375,6 @@ setup(void) {
XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa);
XSelectInput(dpy, root, wa.event_mask);
- initmodmap();
grabkeys();
}
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.