aboutsummaryrefslogtreecommitdiffstats
path: root/sway/server.c
diff options
context:
space:
mode:
authorLibravatar Daniel Eklöf <daniel@ekloef.se>2019-06-01 21:05:09 +0200
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-06-05 11:00:10 -0400
commit190546fd315a24c04006fb1b177069933f4350da (patch)
treedb0910b4931625d259f14b22a56b54095a8466bd /sway/server.c
parentcmd_hide_edge_borders: add missing arg count check (diff)
downloadsway-190546fd315a24c04006fb1b177069933f4350da.tar.gz
sway-190546fd315a24c04006fb1b177069933f4350da.tar.zst
sway-190546fd315a24c04006fb1b177069933f4350da.zip
add seat sub command 'xcursor_theme'
New 'seat <name> xcursor_theme <theme> [<size>]' command that configures the default xcursor theme. The default seat's xcursor theme is also propagated to XWayland, and exported through the XCURSOR_THEME and XCURSOR_SIZE environment variables. This is done every time the default seat's configuration is changed.
Diffstat (limited to 'sway/server.c')
-rw-r--r--sway/server.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/sway/server.c b/sway/server.c
index a403d8b3..b50e3ccc 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -168,17 +168,6 @@ void server_fini(struct sway_server *server) {
168} 168}
169 169
170bool server_start(struct sway_server *server) { 170bool server_start(struct sway_server *server) {
171 // TODO: configurable cursor theme and size
172 int cursor_size = 24;
173 const char *cursor_theme = NULL;
174
175 char cursor_size_fmt[16];
176 snprintf(cursor_size_fmt, sizeof(cursor_size_fmt), "%d", cursor_size);
177 setenv("XCURSOR_SIZE", cursor_size_fmt, 1);
178 if (cursor_theme != NULL) {
179 setenv("XCURSOR_THEME", cursor_theme, 1);
180 }
181
182#if HAVE_XWAYLAND 171#if HAVE_XWAYLAND
183 if (config->xwayland) { 172 if (config->xwayland) {
184 sway_log(SWAY_DEBUG, "Initializing Xwayland"); 173 sway_log(SWAY_DEBUG, "Initializing Xwayland");
@@ -193,17 +182,7 @@ bool server_start(struct sway_server *server) {
193 182
194 setenv("DISPLAY", server->xwayland.wlr_xwayland->display_name, true); 183 setenv("DISPLAY", server->xwayland.wlr_xwayland->display_name, true);
195 184
196 server->xwayland.xcursor_manager = 185 /* xcursor configured by the default seat */
197 wlr_xcursor_manager_create(cursor_theme, cursor_size);
198 wlr_xcursor_manager_load(server->xwayland.xcursor_manager, 1);
199 struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor(
200 server->xwayland.xcursor_manager, "left_ptr", 1);
201 if (xcursor != NULL) {
202 struct wlr_xcursor_image *image = xcursor->images[0];
203 wlr_xwayland_set_cursor(server->xwayland.wlr_xwayland, image->buffer,
204 image->width * 4, image->width, image->height, image->hotspot_x,
205 image->hotspot_y);
206 }
207 } 186 }
208#endif 187#endif
209 188