diff options
author | emersion <contact@emersion.fr> | 2018-03-31 00:13:26 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-03-31 00:24:38 -0400 |
commit | b237fa0b22d36e52fc0be7fe785e02ea1d2456f7 (patch) | |
tree | 122d850bff4e052b5f76238d5c8d38346a1291fc /sway/server.c | |
parent | 212b5039927842f22295c95f4e0a4f914b243194 (diff) |
Set xwayland cursor
Diffstat (limited to 'sway/server.c')
-rw-r--r-- | sway/server.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/server.c b/sway/server.c index 728e624e..9c1671c3 100644 --- a/sway/server.c +++ b/sway/server.c @@ -11,6 +11,7 @@ #include <wlr/types/wlr_layer_shell.h> #include <wlr/types/wlr_screenshooter.h> #include <wlr/types/wlr_wl_shell.h> +#include <wlr/types/wlr_xcursor_manager.h> #include <wlr/util/log.h> // TODO WLR: make Xwayland optional #include <wlr/xwayland.h> @@ -78,6 +79,18 @@ bool server_init(struct sway_server *server) { // TODO: call server_ready now if xwayland is not enabled server->xwayland_ready.notify = server_ready; + // TODO: configurable cursor theme and size + server->xcursor_manager = wlr_xcursor_manager_create(NULL, 24); + wlr_xcursor_manager_load(server->xcursor_manager, 1); + struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor( + server->xcursor_manager, "left_ptr", 1); + if (xcursor != NULL) { + struct wlr_xcursor_image *image = xcursor->images[0]; + wlr_xwayland_set_cursor(server->xwayland, image->buffer, + image->width * 4, image->width, image->height, image->hotspot_x, + image->hotspot_y); + } + server->wl_shell = wlr_wl_shell_create(server->wl_display); wl_signal_add(&server->wl_shell->events.new_surface, &server->wl_shell_surface); |