Fix segfault with "xwayland false" (#4228)

Commit 190546fd31 failed to consider the
edge case where xwayland is disabled via the sway config. This leads to
a SEGFAULT when setting the xwayland cursor since the xwayland server is
not running.
This commit is contained in:
Aidan Harris 2019-06-08 14:28:10 +00:00 committed by Simon Ser
parent 9bfbb0dd49
commit f17eae9043

View file

@ -751,10 +751,10 @@ void seat_configure_xcursor(struct sway_seat *seat) {
} }
#if HAVE_XWAYLAND #if HAVE_XWAYLAND
if (!server.xwayland.xcursor_manager || if (config->xwayland && (!server.xwayland.xcursor_manager ||
!xcursor_manager_is_named(server.xwayland.xcursor_manager, !xcursor_manager_is_named(server.xwayland.xcursor_manager,
cursor_theme) || cursor_theme) ||
server.xwayland.xcursor_manager->size != cursor_size) { server.xwayland.xcursor_manager->size != cursor_size)) {
wlr_xcursor_manager_destroy(server.xwayland.xcursor_manager); wlr_xcursor_manager_destroy(server.xwayland.xcursor_manager);