From 3be7c15fdf9a228f9f82309f49b7c6423317d800 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 14 Jan 2026 09:28:58 +0800 Subject: [PATCH] chase: wlr_xwayland_set_cursor arg change in wlroots0.20 --- meson.build | 2 +- src/animation/client.h | 3 ++- src/mango.c | 19 +++++++++++-------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index c538c927..9248321e 100644 --- a/meson.build +++ b/meson.build @@ -38,7 +38,7 @@ xkbcommon_dep = dependency('xkbcommon') libinput_dep = dependency('libinput',version: '>=1.27.1') libwayland_client_dep = dependency('wayland-client') pcre2_dep = dependency('libpcre2-8') -libscenefx_dep = dependency('scenefx-0.4',version: '>=0.4.1') +libscenefx_dep = dependency('scenefx-0.5',version: '>=0.5.0') # 获取版本信息 diff --git a/src/animation/client.h b/src/animation/client.h index 9e910c47..dd237a0f 100644 --- a/src/animation/client.h +++ b/src/animation/client.h @@ -11,7 +11,8 @@ void set_rect_size(struct wlr_scene_rect *rect, int32_t width, int32_t height) { struct fx_corner_radii set_client_corner_location(Client *c) { struct fx_corner_radii current_corner_location = corner_radii_all(config.border_radius); - struct wlr_box target_geom = config.animations ? c->animation.current : c->geom; + struct wlr_box target_geom = + config.animations ? c->animation.current : c->geom; if (target_geom.x + config.border_radius <= c->mon->m.x) { current_corner_location.top_left = 0; // 清除左标志位 current_corner_location.bottom_left = 0; // 清除左标志位 diff --git a/src/mango.c b/src/mango.c index 79b540b0..87022f17 100644 --- a/src/mango.c +++ b/src/mango.c @@ -2417,8 +2417,9 @@ void maplayersurfacenotify(struct wl_listener *listener, void *data) { if (layer_surface->current.layer != ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM && layer_surface->current.layer != ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND) { if (layer_surface->current.exclusive_zone == 0) { - l->shadow = wlr_scene_shadow_create(l->scene, 0, 0, config.border_radius, - config.shadows_blur, config.shadowscolor); + l->shadow = wlr_scene_shadow_create( + l->scene, 0, 0, config.border_radius, config.shadows_blur, + config.shadowscolor); wlr_scene_node_lower_to_bottom(&l->shadow->node); wlr_scene_node_set_enabled(&l->shadow->node, true); } @@ -4132,7 +4133,8 @@ mapnotify(struct wl_listener *listener, void *data) { c->scene, 0, 0, c->isurgent ? config.urgentcolor : config.bordercolor); wlr_scene_node_lower_to_bottom(&c->border->node); wlr_scene_node_set_position(&c->border->node, 0, 0); - wlr_scene_rect_set_corner_radii(c->border, corner_radii_all(config.border_radius)); + wlr_scene_rect_set_corner_radii(c->border, + corner_radii_all(config.border_radius)); wlr_scene_node_set_enabled(&c->border->node, true); c->shadow = @@ -6590,11 +6592,12 @@ void xwaylandready(struct wl_listener *listener, void *data) { wlr_xwayland_set_seat(xwayland, seat); /* Set the default XWayland cursor to match the rest of dwl. */ - if ((xcursor = wlr_xcursor_manager_get_xcursor(cursor_mgr, "default", 1))) - wlr_xwayland_set_cursor( - xwayland, xcursor->images[0]->buffer, xcursor->images[0]->width * 4, - xcursor->images[0]->width, xcursor->images[0]->height, - xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y); + if ((xcursor = wlr_xcursor_manager_get_xcursor(cursor_mgr, "default", 1))) { + struct wlr_xcursor_image *image = xcursor->images[0]; + struct wlr_buffer *buffer = wlr_xcursor_image_get_buffer(image); + wlr_xwayland_set_cursor(xwayland, buffer, xcursor->images[0]->hotspot_x, + xcursor->images[0]->hotspot_y); + } /* xwayland can't auto sync the keymap, so we do it manually and we need to wait the xwayland completely inited */