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. 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; 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); } }, 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 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(); } }