aboutsummaryrefslogtreecommitdiff
path: root/sway/server.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-31 00:35:50 -0400
committerGitHub <noreply@github.com>2018-03-31 00:35:50 -0400
commit6a1a94b87c7e3e3c7145087c23024f9039a8a08c (patch)
tree7df0cfeafe5a0559244b8981ecc1f7ec52a373fa /sway/server.c
parent18173fb5ade5af0d09a3e270701207f55bb5f97e (diff)
parentb237fa0b22d36e52fc0be7fe785e02ea1d2456f7 (diff)
Merge pull request #1678 from emersion/xwayland-xcursor
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 @@
#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);