mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-26 19:26:32 +00:00
fix segfault in xwayland cursor manager
This commit is contained in:
parent
7b320a195c
commit
7b1b5c75e9
1 changed files with 6 additions and 8 deletions
14
dwl.c
14
dwl.c
|
@ -2148,13 +2148,11 @@ setup(void)
|
||||||
*/
|
*/
|
||||||
xcursor_mgr = wlr_xcursor_manager_create(NULL, 24);
|
xcursor_mgr = wlr_xcursor_manager_create(NULL, 24);
|
||||||
wlr_xcursor_manager_load(xcursor_mgr, 1);
|
wlr_xcursor_manager_load(xcursor_mgr, 1);
|
||||||
xcursor = wlr_xcursor_manager_get_xcursor(xcursor_mgr, "left_ptr", 1);
|
if ((xcursor = wlr_xcursor_manager_get_xcursor(xcursor_mgr, "left_ptr", 1)))
|
||||||
if (xcursor) {
|
|
||||||
wlr_xwayland_set_cursor(xwayland,
|
wlr_xwayland_set_cursor(xwayland,
|
||||||
xcursor->images[0]->buffer, xcursor->images[0]->width * 4,
|
xcursor->images[0]->buffer, xcursor->images[0]->width * 4,
|
||||||
xcursor->images[0]->width, xcursor->images[0]->height,
|
xcursor->images[0]->width, xcursor->images[0]->height,
|
||||||
xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y);
|
xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y);
|
||||||
}
|
|
||||||
|
|
||||||
setenv("DISPLAY", xwayland->display_name, 1);
|
setenv("DISPLAY", xwayland->display_name, 1);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2532,11 +2530,11 @@ xwaylandready(struct wl_listener *listener, void *data)
|
||||||
wlr_xwayland_set_seat(xwayland, seat);
|
wlr_xwayland_set_seat(xwayland, seat);
|
||||||
|
|
||||||
/* Set the default XWayland cursor to match the rest of dwl. */
|
/* Set the default XWayland cursor to match the rest of dwl. */
|
||||||
xcursor = wlr_xcursor_manager_get_xcursor(cursor_mgr, "left_ptr", 1);
|
if ((xcursor = wlr_xcursor_manager_get_xcursor(cursor_mgr, "left_ptr", 1)))
|
||||||
wlr_xwayland_set_cursor(xwayland,
|
wlr_xwayland_set_cursor(xwayland,
|
||||||
xcursor->images[0]->buffer, xcursor->images[0]->width * 4,
|
xcursor->images[0]->buffer, xcursor->images[0]->width * 4,
|
||||||
xcursor->images[0]->width, xcursor->images[0]->height,
|
xcursor->images[0]->width, xcursor->images[0]->height,
|
||||||
xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y);
|
xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y);
|
||||||
|
|
||||||
xcb_disconnect(xc);
|
xcb_disconnect(xc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue