Posts

Showing posts from June, 2024

Modifying dwl.c to warp cursor in dwl, Wayland Compositor

The Wayland compositor called dwl is written in C in line with suckless philosophy . dwl is a compact, hackable compositor for Wayland based on wlroots . It is intended to fill the same space in the Wayland world that dwm does in X11, primarily in terms of functionality, and secondarily in terms of philosophy. To add cursorwarp function in dwl, the best way is inserting snippet of codes in focusclient and focusmon functions. The following snippets of codes goes into focusclient and focusclient functions respectively. /* cursorwarp - msh added for simple cursorwarp */ if (c && cursor_mode == CurNormal && (cursor->x < c->geom.x || cursor->x > c->geom.x + c->geom.width || cursor->y < c->geom.y || cursor->y > c->geom.y + c->geom.height)) { wlr_cursor_warp_closest(cursor, NULL, c->geom.x + c->geom.width / 2.0, c->geom.y + c->geom.height / ...