Add configuration option for disabling mouse warping

This patch adds a new configuration option "mouse_warping [output|none]".

When mouse warping is disabled, mouse cursor does not jump to middle of current
screen when changing workspaces between multiple outputs. This introduces a
"special" cursor state, where focus is in one window and cursor on another.
Useful for eg. scrolling a web page with mouse wheel while typing into another
window on keyboard.
This commit is contained in:
Atte Peltomaki
2014-03-24 19:03:05 +02:00
committed by Michael Stapelberg
parent f41e81bd96
commit 62ea60ba42
9 changed files with 125 additions and 2 deletions

View File

@ -298,6 +298,13 @@ CFGFUN(focus_follows_mouse, const char *value) {
config.disable_focus_follows_mouse = !eval_boolstr(value);
}
CFGFUN(mouse_warping, const char *value) {
if (strcmp(value, "none") == 0)
config.mouse_warping = POINTER_WARPING_NONE;
else if (strcmp(value, "output") == 0)
config.mouse_warping = POINTER_WARPING_OUTPUT;
}
CFGFUN(force_xinerama, const char *value) {
config.force_xinerama = eval_boolstr(value);
}

View File

@ -1142,7 +1142,8 @@ void x_set_i3_atoms(void) {
*/
void x_set_warp_to(Rect *rect)
{
if (!config.disable_focus_follows_mouse)
if (!config.disable_focus_follows_mouse &&
config.mouse_warping != POINTER_WARPING_NONE)
warp_to = rect;
}