react to wlroots changes

This commit is contained in:
Keith Bowes 2024-04-21 14:16:29 -04:00
parent f967bfae17
commit 3a64d3955c
5 changed files with 13 additions and 5 deletions

View file

@ -136,7 +136,11 @@ static void handle_cursor_button(struct wl_listener *listener, void *data) {
struct wlr_surface *surface = NULL;
struct wb_toplevel *toplevel = get_toplevel_at(cursor->server,
cursor->server->cursor->cursor->x, cursor->server->cursor->cursor->y, &surface, &sx, &sy);
#if WLR_CHECK_VERSION(0, 18, 0)
if (event->state == WL_POINTER_BUTTON_STATE_RELEASED) {
#else
if (event->state == WLR_BUTTON_RELEASED) {
#endif
/* If you released any buttons, we exit interactive move/resize mode. */
reset_cursor_mode(cursor->server);
} else {

View file

@ -133,6 +133,9 @@ bool wb_terminate(struct wb_server* server) {
deinit_config(server->config);
wl_display_destroy_clients(server->wl_display);
wlr_output_layout_destroy(server->output_layout);
wlr_allocator_destroy(server->allocator);
wlr_renderer_destroy(server->renderer);
wlr_backend_destroy(server->backend);
wl_display_destroy(server->wl_display);
wb_seat_destroy(server->seat);
wlr_scene_node_destroy(&server->scene->tree.node);

View file

@ -330,9 +330,10 @@ static void xdg_toplevel_request_resize(
static void xdg_popup_commit(struct wl_listener *listener, void *data) {
struct wb_popup *popup = wl_container_of(listener, popup, commit);
if (!popup->xdg_popup) return;
struct wlr_xdg_surface *base = popup->xdg_popup->base;
if (base->initial_commit) {
if (base && base->initial_commit) {
update_fractional_scale(base->surface);
wlr_xdg_surface_schedule_configure(base);
}
@ -340,7 +341,8 @@ static void xdg_popup_commit(struct wl_listener *listener, void *data) {
static void xdg_popup_destroy(struct wl_listener *listener, void *data) {
struct wb_popup *popup = wl_container_of(listener, popup, destroy);
update_fractional_scale(popup->xdg_popup->base->surface);
if (popup->xdg_popup)
update_fractional_scale(popup->xdg_popup->base->surface);
wl_list_remove(&popup->commit.link);
wl_list_remove(&popup->destroy.link);