diff options
| author | Isaac Freund <mail@isaacfreund.com> | 2022-12-24 17:38:02 +0100 |
|---|---|---|
| committer | Isaac Freund <mail@isaacfreund.com> | 2022-12-24 17:38:02 +0100 |
| commit | 05c9194ebaa1b66bb30ffec8d9d636dc4343b53b (patch) | |
| tree | 49f97d4208228e6aab6035356a98b9e2a98b1692 | |
| parent | 096e175ceca0b0ce313da58cd2d00b189f5ac458 (diff) | |
| download | river-05c9194ebaa1b66bb30ffec8d9d636dc4343b53b.tar.gz river-05c9194ebaa1b66bb30ffec8d9d636dc4343b53b.tar.xz | |
build: handle wlroots built without xwayland support
| m--------- | deps/zig-wlroots | 0 | ||||
| -rw-r--r-- | river/Cursor.zig | 15 | ||||
| -rw-r--r-- | river/Seat.zig | 4 |
3 files changed, 13 insertions, 6 deletions
diff --git a/deps/zig-wlroots b/deps/zig-wlroots -Subproject 199463a741061511561f6c139d49d4b00212d5b +Subproject b485332edb2bfc8db42d474a019e7df835a7d1b diff --git a/river/Cursor.zig b/river/Cursor.zig index 3f15f3b..1ee4d97 100644 --- a/river/Cursor.zig +++ b/river/Cursor.zig @@ -1125,11 +1125,16 @@ fn warp(self: *Self) void { .width = view.current.box.width, .height = view.current.box.height, }, - .xwayland_override_redirect => |or_window| wlr.Box{ - .x = or_window.xwayland_surface.x, - .y = or_window.xwayland_surface.y, - .width = or_window.xwayland_surface.width, - .height = or_window.xwayland_surface.height, + .xwayland_override_redirect => |or_window| blk: { + assert(build_options.xwayland); + // TODO(zig): remove this line when updating to the self hosted compiler. + if (!build_options.xwayland) return; + break :blk wlr.Box{ + .x = or_window.xwayland_surface.x, + .y = or_window.xwayland_surface.y, + .width = or_window.xwayland_surface.width, + .height = or_window.xwayland_surface.height, + }; }, }, }; diff --git a/river/Seat.zig b/river/Seat.zig index d678e83..1ffddaa 100644 --- a/river/Seat.zig +++ b/river/Seat.zig @@ -49,7 +49,7 @@ const PointerConstraint = @import("PointerConstraint.zig"); pub const FocusTarget = union(enum) { view: *View, - xwayland_override_redirect: *XwaylandOverrideRedirect, + xwayland_override_redirect: if (build_options.xwayland) *XwaylandOverrideRedirect else void, layer: *LayerSurface, lock_surface: *LockSurface, none: void, @@ -221,6 +221,8 @@ pub fn setFocusRaw(self: *Self, new_focus: FocusTarget) void { .view => |target_view| target_view.surface.?, .xwayland_override_redirect => |target_override_redirect| blk: { assert(build_options.xwayland); + // TODO(zig): remove this line when updating to the self hosted compiler. + if (!build_options.xwayland) return; break :blk target_override_redirect.xwayland_surface.surface; }, .layer => |target_layer| target_layer.wlr_layer_surface.surface, |
