Permalink
Browse files

Add a new value for focus_mode -> "disable": When focus_mode is set t…

…o this value, window focus will not follow the cursor (on mouse over focus)
  • Loading branch information...
1 parent 336c03f commit 82cb6d3b80c8b6b40dbd2c03b17c2d1471e49bba @piffio committed Mar 8, 2012
Showing with 9 additions and 1 deletion.
  1. +4 −0 spectrwm.1
  2. +5 −1 spectrwm.c
View
@@ -139,6 +139,10 @@ Using a value of
.Pa follow_cursor
will make the window manager focus the window
under the mouse when switching workspaces and creating windows.
+.Pp
+Using a value of
+.Pa disabled
+will disable the default "follow_cursor" behaviour.
.It Ic keyboard_mapping
Clear all key bindings and load new key bindings from the specified file.
This allows you to load pre-defined key bindings for your keyboard layout.
View
@@ -188,6 +188,7 @@ u_int32_t swm_debug = 0
#define SWM_FOCUS_DEFAULT (0)
#define SWM_FOCUS_SYNERGY (1)
#define SWM_FOCUS_FOLLOW (2)
+#define SWM_FOCUS_DONT_FOLLOW (3)
#define SWM_CONF_DEFAULT (0)
#define SWM_CONF_KEYMAPPING (1)
@@ -5279,6 +5280,8 @@ setconfvalue(char *selector, char *value, int flags)
focus_mode = SWM_FOCUS_FOLLOW;
else if (!strcmp(value, "synergy"))
focus_mode = SWM_FOCUS_SYNERGY;
+ else if (!strcmp(value, "disabled"))
+ focus_mode = SWM_FOCUS_DONT_FOLLOW;
else
errx(1, "focus_mode");
break;
@@ -6287,7 +6290,8 @@ enternotify(XEvent *e)
return;
}
- focus_magic(win);
+ if (focus_mode != SWM_FOCUS_DONT_FOLLOW)
+ focus_magic(win);
}
/* lets us use one switch statement for arbitrary mode/detail combinations */

0 comments on commit 82cb6d3

Please sign in to comment.