enable new window focus by default, revert latest suckless commit since

it breaks some stuff
This commit is contained in:
speedie 2022-12-22 18:48:01 +01:00
parent cfa58a91a9
commit fe1c9cf3f0
4 changed files with 16 additions and 23 deletions

View file

@ -1,5 +1,4 @@
# speedwm # speedwm
![image](/docs/preview.png)
## What is speedwm? ## What is speedwm?
@ -368,7 +367,7 @@ Below is a list of all .Xresources values you can define.
- speedwm.client.autoresize: 1 - speedwm.client.autoresize: 1
- speedwm.client.decorhints: 1 - speedwm.client.decorhints: 1
- speedwm.client.hide.border: 0 - 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.hide.single.border: 1
- speedwm.client.fade.inactive: 1 - speedwm.client.fade.inactive: 1
- speedwm.client.fade.windows: 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.layout: 0
- speedwm.color.selectedtitle: 0 - speedwm.color.selectedtitle: 0
- speedwm.bar.powerline.tag.shape: 0 - speedwm.bar.powerline.tag.shape: 0
- speedwm.focus.spawned: 0 - speedwm.focus.spawned: 1
- speedwm.fullscreen.hidebar: 1 - speedwm.fullscreen.hidebar: 1
- speedwm.fullscreen.lockfullscreen: 1 - speedwm.fullscreen.lockfullscreen: 1
- speedwm.fullscreen.movefullscreenmon: 0 - speedwm.fullscreen.movefullscreenmon: 0

View file

@ -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: /) speedwm.bar.powerline.tag.shape: 0 ! Shape of the tag powerlines (0: >, 1: /)
!! Focus options !! 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 !! Fullscreen options
speedwm.fullscreen.hidebar: 1 ! Hide the bar when a client is fullscreened (0/1) speedwm.fullscreen.hidebar: 1 ! Hide the bar when a client is fullscreened (0/1)

View file

@ -54,7 +54,7 @@ static int swallowfloating = 1; /* Swallow floating windows b
static int centerfloating = 1; /* Center floating windows by default */ static int centerfloating = 1; /* Center floating windows by default */
static int startontag = 1; /* Start on a tag or not? */ static int startontag = 1; /* Start on a tag or not? */
static int floatscratchpad = 0; /* Float the scratchpad window on hide (1/0) */ 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 */ /* 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 */ static int autofocus = 1; /* Allow clients to automatically be focused when they request it. This comes with the side effect of potentially being annoying */

View file

@ -2695,27 +2695,21 @@ grabkeys(void)
{ {
updatenumlockmask(); updatenumlockmask();
{ {
unsigned int i, j, k; unsigned int i, j;
unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
int start, end, skip; KeyCode code;
KeySym *syms; KeyCode chain;
XUngrabKey(dpy, AnyKey, AnyModifier, root); 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++) for (i = 0; i < LENGTH(keys); i++)
/* skip modifier codes, we do that ourselves */ if ((code = XKeysymToKeycode(dpy, keys[i].keysym))) {
if (keys[i].keysym == syms[(k - start) * skip]) { if (keys[i].chain != -1 &&
((chain = XKeysymToKeycode(dpy, keys[i].chain))))
code = chain;
for (j = 0; j < LENGTH(modifiers); j++) for (j = 0; j < LENGTH(modifiers); j++)
XGrabKey(dpy, k, XGrabKey(dpy, code, keys[i].mod | modifiers[j], root,
keys[i].mod | modifiers[j], True, GrabModeAsync, GrabModeAsync);
root, True,
GrabModeAsync, GrabModeAsync);
} }
XFree(syms);
} }
} }