diff --git a/waybox/cursor.c b/waybox/cursor.c index 9a0dc98..2a9b175 100644 --- a/waybox/cursor.c +++ b/waybox/cursor.c @@ -50,8 +50,12 @@ static void process_cursor_resize(struct wb_server *server) { } } +#if WLR_CHECK_VERSION(0, 19, 0) + struct wlr_box geo_box = toplevel->xdg_toplevel->base->geometry; +#else struct wlr_box geo_box; wlr_xdg_surface_get_geometry(toplevel->xdg_toplevel->base, &geo_box); +#endif toplevel->geometry.x = new_left - geo_box.x; toplevel->geometry.y = new_top - geo_box.y; wlr_scene_node_set_position(&toplevel->scene_tree->node, diff --git a/waybox/seat.c b/waybox/seat.c index 5f9dff1..9a979e1 100644 --- a/waybox/seat.c +++ b/waybox/seat.c @@ -123,8 +123,12 @@ static bool handle_keybinding(struct wb_server *server, xkb_keysym_t sym, uint32 if (key_binding->action & ACTION_SHADE) { struct wb_toplevel *toplevel = wl_container_of(server->toplevels.next, toplevel, link); if (toplevel->scene_tree->node.enabled) { +#if WLR_CHECK_VERSION(0, 19, 0) + struct wlr_box geo_box = toplevel->xdg_toplevel->base->geometry; +#else struct wlr_box geo_box; wlr_xdg_surface_get_geometry(toplevel->xdg_toplevel->base, &geo_box); +#endif int decoration_height = MAX(geo_box.y - toplevel->geometry.y, TITLEBAR_HEIGHT); toplevel->previous_geometry = toplevel->geometry; diff --git a/waybox/xdg_shell.c b/waybox/xdg_shell.c index 6d96e78..5187c08 100644 --- a/waybox/xdg_shell.c +++ b/waybox/xdg_shell.c @@ -101,9 +101,13 @@ static void xdg_toplevel_map(struct wl_listener *listener, void *data) { return; struct wb_config *config = toplevel->server->config; - struct wlr_box geo_box = {0}; struct wlr_box usable_area = get_usable_area(toplevel); +#if WLR_CHECK_VERSION(0, 19, 0) + struct wlr_box geo_box = toplevel->xdg_toplevel->base->geometry; +#else + struct wlr_box geo_box = {0}; wlr_xdg_surface_get_geometry(toplevel->xdg_toplevel->base, &geo_box); +#endif if (config) { toplevel->geometry.height = MIN(geo_box.height, @@ -318,8 +322,12 @@ static void begin_interactive(struct wb_toplevel *toplevel, server->grab_x = server->cursor->cursor->x - toplevel->geometry.x; server->grab_y = server->cursor->cursor->y - toplevel->geometry.y; } else if (mode == WB_CURSOR_RESIZE) { +#if WLR_CHECK_VERSION(0, 19, 0) + struct wlr_box geo_box = toplevel->xdg_toplevel->base->geometry; +#else struct wlr_box geo_box; wlr_xdg_surface_get_geometry(toplevel->xdg_toplevel->base, &geo_box); +#endif double border_x = (toplevel->geometry.x + geo_box.x) + ((edges & WLR_EDGE_RIGHT) ? geo_box.width : 0);