diff options
| author | Drew DeVault <sir@cmpwn.com> | 2018-10-17 22:19:01 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-17 22:19:01 +0200 | 
| commit | 103b7bc47d656e91406f5493a3e1317cb9ce5c02 (patch) | |
| tree | fc6b9ec4e101ad9ab271a0f9485b840d88d42272 | |
| parent | 10d07478ad95336ad0bf40d53c60bbaf85fd2c4d (diff) | |
| parent | fd9198a3a4f50b62a66f65780985ddf0a5cdf895 (diff) | |
| download | sway-103b7bc47d656e91406f5493a3e1317cb9ce5c02.tar.xz | |
Merge pull request #2868 from emersion/xcursor-env
Export XCURSOR_SIZE and XCURSOR_THEME
| -rw-r--r-- | sway/server.c | 15 | 
1 files changed, 13 insertions, 2 deletions
| diff --git a/sway/server.c b/sway/server.c index 63bfa7e1..1fd7b7fa 100644 --- a/sway/server.c +++ b/sway/server.c @@ -83,6 +83,17 @@ bool server_init(struct sway_server *server) {  		&server->xdg_shell_surface);  	server->xdg_shell_surface.notify = handle_xdg_shell_surface; +	// TODO: configurable cursor theme and size +	int cursor_size = 24; +	const char *cursor_theme = NULL; + +	char cursor_size_fmt[16]; +	snprintf(cursor_size_fmt, sizeof(cursor_size_fmt), "%d", cursor_size); +	setenv("XCURSOR_SIZE", cursor_size_fmt, 1); +	if (cursor_theme != NULL) { +		setenv("XCURSOR_THEME", cursor_theme, 1); +	} +  #ifdef HAVE_XWAYLAND  	server->xwayland.wlr_xwayland =  		wlr_xwayland_create(server->wl_display, server->compositor, true); @@ -93,8 +104,8 @@ bool server_init(struct sway_server *server) {  		&server->xwayland_ready);  	server->xwayland_ready.notify = handle_xwayland_ready; -	// TODO: configurable cursor theme and size -	server->xwayland.xcursor_manager = wlr_xcursor_manager_create(NULL, 24); +	server->xwayland.xcursor_manager = +		wlr_xcursor_manager_create(cursor_theme, cursor_size);  	wlr_xcursor_manager_load(server->xwayland.xcursor_manager, 1);  	struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor(  		server->xwayland.xcursor_manager, "left_ptr", 1); | 
