Cursor: revive 'always' focus-follows-cursor mode

This was removed a while back because it was buggy and I didn't know
of anyone using it. Since refactoring it is now trivial to implement
and I know of at least one person using it, so I don't mind reviving it.
This commit is contained in:
Isaac Freund
2022-06-03 11:09:18 +02:00
parent 2df2151afa
commit 50c9e3d81b
6 changed files with 12 additions and 6 deletions

View File

@ -902,7 +902,9 @@ pub fn checkFocusFollowsCursor(self: *Self) void {
if (self.seat.pointer_drag) return;
if (server.config.focus_follows_cursor == .disabled) return;
if (self.surfaceAt()) |result| {
if (self.seat.wlr_seat.pointer_state.focused_surface != result.surface) {
if (server.config.focus_follows_cursor == .always or
self.seat.wlr_seat.pointer_state.focused_surface != result.surface)
{
switch (result.parent) {
.view => |view| {
if (self.seat.focused != .view or self.seat.focused.view != view) {