This commit is contained in:
Alexander Rosenberg 2024-05-15 04:36:26 -07:00
commit 929db0098a
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
5 changed files with 38 additions and 16 deletions

18
.github/workflows/close_prs.yml vendored Normal file
View File

@ -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.

View File

@ -769,6 +769,14 @@ fn handleRequestSetCursor(
pub fn hide(cursor: *Cursor) void { pub fn hide(cursor: *Cursor) void {
if (cursor.pressed_count > 0) return; 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.hidden = true;
cursor.wlr_cursor.unsetImage(); cursor.wlr_cursor.unsetImage();
cursor.xcursor_name = null; cursor.xcursor_name = null;

View File

@ -489,7 +489,6 @@ fn tryAddDevice(seat: *Seat, wlr_device: *wlr.InputDevice) !void {
seat.wlr_seat.setKeyboard(keyboard.device.wlr_device.toKeyboard()); seat.wlr_seat.setKeyboard(keyboard.device.wlr_device.toKeyboard());
if (seat.wlr_seat.keyboard_state.focused_surface) |wlr_surface| { if (seat.wlr_seat.keyboard_state.focused_surface) |wlr_surface| {
seat.wlr_seat.keyboardNotifyClearFocus();
seat.keyboardNotifyEnter(wlr_surface); seat.keyboardNotifyEnter(wlr_surface);
} }
}, },

View File

@ -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.drm) |drm| if (global == drm.global) return true;
if (server.linux_dmabuf) |linux_dmabuf| if (global == linux_dmabuf.global) return true; if (server.linux_dmabuf) |linux_dmabuf| if (global == linux_dmabuf.global) return true;
{ // We must use the getInterface() approach for dynamically created globals
var it = server.root.all_outputs.iterator(.forward); // such as wl_output and wl_seat since the wl_global_create() function will
while (it.next()) |output| { // advertise the global to clients and invoke this filter before returning
if (global == output.wlr_output.global) return true; // 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.
var it = server.input_manager.seats.first; return global.getInterface() == wl.Output.getInterface() or
while (it) |node| : (it = node.next) { global.getInterface() == wl.Seat.getInterface() or
if (global == node.data.wlr_seat.global) return true; global == hackGlobal(server.shm) or
}
}
return global == hackGlobal(server.shm) or
global == hackGlobal(server.single_pixel_buffer_manager) or global == hackGlobal(server.single_pixel_buffer_manager) or
global == server.viewporter.global or global == server.viewporter.global or
global == server.fractional_scale_manager.global or global == server.fractional_scale_manager.global or

View File

@ -67,6 +67,7 @@ pub fn swap(
assert(!target.pending.float); assert(!target.pending.float);
assert(!target.pending.fullscreen); assert(!target.pending.fullscreen);
seat.focused.view.pending_wm_stack_link.swapWith(&target.pending_wm_stack_link); seat.focused.view.pending_wm_stack_link.swapWith(&target.pending_wm_stack_link);
seat.cursor.may_need_warp = true;
server.root.applyPending(); server.root.applyPending();
} }
} }