aboutsummaryrefslogtreecommitdiff
path: root/src/cursor.zig
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-04-25 21:40:26 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2020-04-26 12:29:08 +0200
commit454e2454b68841a90cb321b672adaeac8d10ed87 (patch)
tree16f904a82df0198ac0e7129994dc773e380bd349 /src/cursor.zig
parent609eeae6f446247f2cc3219d65b25647de828cb3 (diff)
downloadriver-454e2454b68841a90cb321b672adaeac8d10ed87.tar.gz
river-454e2454b68841a90cb321b672adaeac8d10ed87.tar.xz
Separate View from its implementation
This is done in preperation for Xwayland support
Diffstat (limited to 'src/cursor.zig')
-rw-r--r--src/cursor.zig16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/cursor.zig b/src/cursor.zig
index fb7d30b..0903ef8 100644
--- a/src/cursor.zig
+++ b/src/cursor.zig
@@ -373,13 +373,15 @@ pub const Cursor = struct {
if (view.floating != floating) {
continue;
}
- const surface = c.wlr_xdg_surface_surface_at(
- view.wlr_xdg_surface,
- ox - @intToFloat(f64, view.current_box.x),
- oy - @intToFloat(f64, view.current_box.y),
- sx,
- sy,
- );
+ const surface = switch (view.impl) {
+ .xdg_toplevel => |xdg_toplevel| c.wlr_xdg_surface_surface_at(
+ xdg_toplevel.wlr_xdg_surface,
+ ox - @intToFloat(f64, view.current_box.x),
+ oy - @intToFloat(f64, view.current_box.y),
+ sx,
+ sy,
+ ),
+ };
if (surface) |found| {
return found;
}