enable new window focus by default, revert latest suckless commit since
it breaks some stuff
This commit is contained in:
parent
cfa58a91a9
commit
fe1c9cf3f0
|
@ -1,5 +1,4 @@
|
|||
# speedwm
|
||||
![image](/docs/preview.png)
|
||||
|
||||
## What is speedwm?
|
||||
|
||||
|
@ -368,7 +367,7 @@ Below is a list of all .Xresources values you can define.
|
|||
- speedwm.client.autoresize: 1
|
||||
- speedwm.client.decorhints: 1
|
||||
- speedwm.client.hide.border: 0
|
||||
- speedwm.client.hide.unselected.border: 0
|
||||
- speedwm.client.hide.unselected.border: 1
|
||||
- speedwm.client.hide.single.border: 1
|
||||
- speedwm.client.fade.inactive: 1
|
||||
- speedwm.client.fade.windows: 1
|
||||
|
@ -478,7 +477,7 @@ Below is a list of all .Xresources values you can define.
|
|||
- speedwm.color.layout: 0
|
||||
- speedwm.color.selectedtitle: 0
|
||||
- speedwm.bar.powerline.tag.shape: 0
|
||||
- speedwm.focus.spawned: 0
|
||||
- speedwm.focus.spawned: 1
|
||||
- speedwm.fullscreen.hidebar: 1
|
||||
- speedwm.fullscreen.lockfullscreen: 1
|
||||
- speedwm.fullscreen.movefullscreenmon: 0
|
||||
|
|
|
@ -190,7 +190,7 @@ speedwm.color.selectedtitle: 0 ! Color the selected title (0/1)
|
|||
speedwm.bar.powerline.tag.shape: 0 ! Shape of the tag powerlines (0: >, 1: /)
|
||||
|
||||
!! Focus options
|
||||
speedwm.focus.spawned: 0 ! Focus the newly spawned window or keep focus (0/1)
|
||||
speedwm.focus.spawned: 1 ! Focus the newly spawned window or keep focus (0/1)
|
||||
|
||||
!! Fullscreen options
|
||||
speedwm.fullscreen.hidebar: 1 ! Hide the bar when a client is fullscreened (0/1)
|
||||
|
|
|
@ -54,7 +54,7 @@ static int swallowfloating = 1; /* Swallow floating windows b
|
|||
static int centerfloating = 1; /* Center floating windows by default */
|
||||
static int startontag = 1; /* Start on a tag or not? */
|
||||
static int floatscratchpad = 0; /* Float the scratchpad window on hide (1/0) */
|
||||
static int focusspawn = 0; /* Automatically focus the next spawned window. If warp is enabled, this is useless and will be disabled. (1/0) */
|
||||
static int focusspawn = 1; /* Automatically focus the next spawned window. If warp is enabled, this is useless and will be disabled. (1/0) */
|
||||
|
||||
/* Client properties */
|
||||
static int autofocus = 1; /* Allow clients to automatically be focused when they request it. This comes with the side effect of potentially being annoying */
|
||||
|
|
30
speedwm.c
30
speedwm.c
|
@ -2695,27 +2695,21 @@ grabkeys(void)
|
|||
{
|
||||
updatenumlockmask();
|
||||
{
|
||||
unsigned int i, j, k;
|
||||
unsigned int i, j;
|
||||
unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
|
||||
int start, end, skip;
|
||||
KeySym *syms;
|
||||
KeyCode code;
|
||||
KeyCode chain;
|
||||
|
||||
XUngrabKey(dpy, AnyKey, AnyModifier, root);
|
||||
XDisplayKeycodes(dpy, &start, &end);
|
||||
syms = XGetKeyboardMapping(dpy, start, end - start + 1, &skip);
|
||||
if (!syms)
|
||||
return;
|
||||
for (k = start; k <= end; k++)
|
||||
for (i = 0; i < LENGTH(keys); i++)
|
||||
/* skip modifier codes, we do that ourselves */
|
||||
if (keys[i].keysym == syms[(k - start) * skip]) {
|
||||
for (j = 0; j < LENGTH(modifiers); j++)
|
||||
XGrabKey(dpy, k,
|
||||
keys[i].mod | modifiers[j],
|
||||
root, True,
|
||||
GrabModeAsync, GrabModeAsync);
|
||||
}
|
||||
XFree(syms);
|
||||
for (i = 0; i < LENGTH(keys); i++)
|
||||
if ((code = XKeysymToKeycode(dpy, keys[i].keysym))) {
|
||||
if (keys[i].chain != -1 &&
|
||||
((chain = XKeysymToKeycode(dpy, keys[i].chain))))
|
||||
code = chain;
|
||||
for (j = 0; j < LENGTH(modifiers); j++)
|
||||
XGrabKey(dpy, code, keys[i].mod | modifiers[j], root,
|
||||
True, GrabModeAsync, GrabModeAsync);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue