From f66eec92482dabb782d5457caef4ca1dbfb82b59 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 12 May 2024 10:42:19 +0200 Subject: [PATCH 1/5] Cursor: don't hide while pointer constraint active Fixes: https://codeberg.org/river/river/issues/1053 --- river/Cursor.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/river/Cursor.zig b/river/Cursor.zig index 3b4e0a3..29e7ed9 100644 --- a/river/Cursor.zig +++ b/river/Cursor.zig @@ -769,6 +769,14 @@ fn handleRequestSetCursor( pub fn hide(cursor: *Cursor) void { if (cursor.pressed_count > 0) return; + + // Hiding the cursor and sending wl_pointer.leave whlie a pointer constraint + // is active does not make much sense. In particular, doing so seems to interact + // poorly with Xwayland's pointer constraints implementation. + if (cursor.constraint) |constraint| { + if (constraint.state == .active) return; + } + cursor.hidden = true; cursor.wlr_cursor.unsetImage(); cursor.xcursor_name = null; From 1e3ef88bd573e4940f7e9dcffdbf119161473e4d Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 12 May 2024 09:58:14 +0200 Subject: [PATCH 2/5] Keyboard: fix redundant leave/enter on creation Currently if a second keyboard input device is created river will send a wl_keyboard.leave event immediately followed by a wl_keyboard.enter event. This serves no purpose and can confuse clients, in particular due to fctix creating/destroying virtual keyboards on focus change. Fixes: https://codeberg.org/river/river/issues/1062 References: https://github.com/fcitx/fcitx5/issues/1044 --- river/Seat.zig | 1 - 1 file changed, 1 deletion(-) diff --git a/river/Seat.zig b/river/Seat.zig index 8751aa7..6fc7c65 100644 --- a/river/Seat.zig +++ b/river/Seat.zig @@ -489,7 +489,6 @@ fn tryAddDevice(seat: *Seat, wlr_device: *wlr.InputDevice) !void { seat.wlr_seat.setKeyboard(keyboard.device.wlr_device.toKeyboard()); if (seat.wlr_seat.keyboard_state.focused_surface) |wlr_surface| { - seat.wlr_seat.keyboardNotifyClearFocus(); seat.keyboardNotifyEnter(wlr_surface); } }, From ad0b71c3106ecfcd6313a2fba95c461acd515af7 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 14 May 2024 12:55:27 +0200 Subject: [PATCH 3/5] github: automatically close prs --- .github/workflows/close_prs.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/close_prs.yml diff --git a/.github/workflows/close_prs.yml b/.github/workflows/close_prs.yml new file mode 100644 index 0000000..af5122e --- /dev/null +++ b/.github/workflows/close_prs.yml @@ -0,0 +1,18 @@ +name: Close Pull Request + +on: + pull_request_target: + types: [opened] + +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your interest in contributing to river! + + Unfortunately, you are in the wrong place. As stated in the README, this github repo is a read-only mirror and development happens on codeberg: https://codeberg.org/river/river. + + Please open a pull request on codeberg instead. From bed50f0dd2099e06c85f0fd0cc3bbdb10f3c9353 Mon Sep 17 00:00:00 2001 From: ymcx <89810988+ymcx@users.noreply.github.com> Date: Tue, 14 May 2024 20:23:18 +0300 Subject: [PATCH 4/5] command/swap: fix cursor warp on focus change --- river/command/view_operations.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/river/command/view_operations.zig b/river/command/view_operations.zig index 285717d..4f1319b 100644 --- a/river/command/view_operations.zig +++ b/river/command/view_operations.zig @@ -67,6 +67,7 @@ pub fn swap( assert(!target.pending.float); assert(!target.pending.fullscreen); seat.focused.view.pending_wm_stack_link.swapWith(&target.pending_wm_stack_link); + seat.cursor.may_need_warp = true; server.root.applyPending(); } } From b5a80c7b9b34a42b2546d8724498b0b6d59f6cec Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Wed, 15 May 2024 09:48:55 +0200 Subject: [PATCH 5/5] Server: fix filtering of newly created globals Fixes: https://codeberg.org/river/river/issues/1068 --- river/Server.zig | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/river/Server.zig b/river/Server.zig index e1fda5f..895f1cc 100644 --- a/river/Server.zig +++ b/river/Server.zig @@ -289,21 +289,17 @@ fn allowlist(server: *Server, global: *const wl.Global) bool { if (server.drm) |drm| if (global == drm.global) return true; if (server.linux_dmabuf) |linux_dmabuf| if (global == linux_dmabuf.global) return true; - { - var it = server.root.all_outputs.iterator(.forward); - while (it.next()) |output| { - if (global == output.wlr_output.global) return true; - } - } - - { - var it = server.input_manager.seats.first; - while (it) |node| : (it = node.next) { - if (global == node.data.wlr_seat.global) return true; - } - } - - return global == hackGlobal(server.shm) or + // We must use the getInterface() approach for dynamically created globals + // such as wl_output and wl_seat since the wl_global_create() function will + // advertise the global to clients and invoke this filter before returning + // the new global pointer. + // + // For other globals I like the current pointer comparison approach as it + // should catch river accidentally exposing multiple copies of e.g. wl_shm + // with an assertion failure. + return global.getInterface() == wl.Output.getInterface() or + global.getInterface() == wl.Seat.getInterface() or + global == hackGlobal(server.shm) or global == hackGlobal(server.single_pixel_buffer_manager) or global == server.viewporter.global or global == server.fractional_scale_manager.global or