Skip to content

Commit

Permalink
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Report proper error message when trying to use absolute resizing on a managed window [#661](https://github.com/koekeishiya/yabai/issues/661)
- Space/Window commands that utilize the scripting addition should correctly return a non-zero exit code upon failure [#181](https://github.com/koekeishiya/yabai/issues/181)
- Undo [#545](https://github.com/koekeishiya/yabai/issues/545) because it created weird issues with focus [#660](https://github.com/koekeishiya/yabai/issues/660)
- Allow disabling *mouse_follows_focus* for specific windows using rules [#675](https://github.com/koekeishiya/yabai/issues/675)
- Allow enabling/disabling *mouse_follows_focus* for specific windows using rules, overriding the global setting [#675](https://github.com/koekeishiya/yabai/issues/675)

## [3.3.4] - 2020-11-14
### Changed
2 changes: 1 addition & 1 deletion doc/yabai.1
Original file line number Diff line number Diff line change
@@ -562,7 +562,7 @@ Window appears on all spaces.
.sp
\fBmouse_follows_focus=\fI<BOOL_SEL>\fP\fP
.RS 4
Window should respect the value of the global setting \fBmouse_follows_focus\fP.
When focusing the window, put the mouse at its center. Overrides the global \fBmouse_follows_focus\fP setting.
.RE
.sp
\fBlayer=\fI<LAYER>\fP\fP
2 changes: 1 addition & 1 deletion doc/yabai.asciidoc
Original file line number Diff line number Diff line change
@@ -413,7 +413,7 @@ ARGUMENT
Window appears on all spaces.

*mouse_follows_focus='<BOOL_SEL>'*::
Window should respect the value of the global setting *mouse_follows_focus*.
When focusing the window, put the mouse at its center. Overrides the global *mouse_follows_focus* setting.

*layer='<LAYER>'*::
Window is ordered within the given stacking layer.
3 changes: 2 additions & 1 deletion src/window.h
Original file line number Diff line number Diff line change
@@ -44,7 +44,8 @@ struct window
float opacity;
bool rule_manage;
bool rule_fullscreen;
bool disable_mff;
bool rule_mff;
bool enable_mff;
struct border border;
};

13 changes: 9 additions & 4 deletions src/window_manager.c
Original file line number Diff line number Diff line change
@@ -140,9 +140,11 @@ void window_manager_apply_rule_to_window(struct space_manager *sm, struct window
}

if (rule->mff == RULE_PROP_ON) {
window->disable_mff = false;
window->rule_mff = true;
window->enable_mff = true;
} else if (rule->mff == RULE_PROP_OFF) {
window->disable_mff = true;
window->rule_mff = true;
window->enable_mff = false;
}

if (rule->layer) {
@@ -258,8 +260,11 @@ void window_manager_set_window_opacity_enabled(struct window_manager *wm, bool e

void window_manager_center_mouse(struct window_manager *wm, struct window *window)
{
if (!wm->enable_mff) return;
if (window->disable_mff) return;
if (window->rule_mff) {
if (!window->enable_mff) return;
} else {
if (!wm->enable_mff) return;
}

CGPoint cursor;
SLSGetCurrentCursorLocation(g_connection, &cursor);

0 comments on commit 8efc57c

Please sign in to comment.