mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-28 05:40:18 -04:00
react to wlroots changes
This commit is contained in:
parent
88ce9ad366
commit
19339ac6a0
3 changed files with 17 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue