aboutsummaryrefslogtreecommitdiffstats
path: root/sway/server.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-03-31 00:13:26 -0400
committerLibravatar emersion <contact@emersion.fr>2018-03-31 00:24:38 -0400
commitb237fa0b22d36e52fc0be7fe785e02ea1d2456f7 (patch)
tree122d850bff4e052b5f76238d5c8d38346a1291fc /sway/server.c
parentUse wlr_surface_point_accepts_input (diff)
downloadsway-b237fa0b22d36e52fc0be7fe785e02ea1d2456f7.tar.gz
sway-b237fa0b22d36e52fc0be7fe785e02ea1d2456f7.tar.zst
sway-b237fa0b22d36e52fc0be7fe785e02ea1d2456f7.zip
Set xwayland cursor
Diffstat (limited to 'sway/server.c')
-rw-r--r--sway/server.c13
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 @@
11#include <wlr/types/wlr_layer_shell.h> 11#include <wlr/types/wlr_layer_shell.h>
12#include <wlr/types/wlr_screenshooter.h> 12#include <wlr/types/wlr_screenshooter.h>
13#include <wlr/types/wlr_wl_shell.h> 13#include <wlr/types/wlr_wl_shell.h>
14#include <wlr/types/wlr_xcursor_manager.h>
14#include <wlr/util/log.h> 15#include <wlr/util/log.h>
15// TODO WLR: make Xwayland optional 16// TODO WLR: make Xwayland optional
16#include <wlr/xwayland.h> 17#include <wlr/xwayland.h>
@@ -78,6 +79,18 @@ bool server_init(struct sway_server *server) {
78 // TODO: call server_ready now if xwayland is not enabled 79 // TODO: call server_ready now if xwayland is not enabled
79 server->xwayland_ready.notify = server_ready; 80 server->xwayland_ready.notify = server_ready;
80 81
82 // TODO: configurable cursor theme and size
83 server->xcursor_manager = wlr_xcursor_manager_create(NULL, 24);
84 wlr_xcursor_manager_load(server->xcursor_manager, 1);
85 struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor(
86 server->xcursor_manager, "left_ptr", 1);
87 if (xcursor != NULL) {
88 struct wlr_xcursor_image *image = xcursor->images[0];
89 wlr_xwayland_set_cursor(server->xwayland, image->buffer,
90 image->width * 4, image->width, image->height, image->hotspot_x,
91 image->hotspot_y);
92 }
93
81 server->wl_shell = wlr_wl_shell_create(server->wl_display); 94 server->wl_shell = wlr_wl_shell_create(server->wl_display);
82 wl_signal_add(&server->wl_shell->events.new_surface, 95 wl_signal_add(&server->wl_shell->events.new_surface,
83 &server->wl_shell_surface); 96 &server->wl_shell_surface);