examples, tinywl: use "default" cursor instead of "left_ptr"

"left_ptr" is the X11 name, "default" is the cursor spec name.
Simon Ser 2 years ago
parent 4097eb20f3
commit 3668c9d86c

@ -615,14 +615,14 @@ int main(int argc, char **argv) {
struct wl_cursor *cursor = struct wl_cursor *cursor =
wl_cursor_theme_get_cursor(cursor_theme, "crosshair"); wl_cursor_theme_get_cursor(cursor_theme, "crosshair");
if (cursor == NULL) { if (cursor == NULL) {
cursor = wl_cursor_theme_get_cursor(cursor_theme, "left_ptr"); cursor = wl_cursor_theme_get_cursor(cursor_theme, "default");
} }
assert(cursor); assert(cursor);
cursor_image = cursor->images[0]; cursor_image = cursor->images[0];
cursor = wl_cursor_theme_get_cursor(cursor_theme, "tcross"); cursor = wl_cursor_theme_get_cursor(cursor_theme, "tcross");
if (cursor == NULL) { if (cursor == NULL) {
cursor = wl_cursor_theme_get_cursor(cursor_theme, "left_ptr"); cursor = wl_cursor_theme_get_cursor(cursor_theme, "default");
} }
assert(cursor); assert(cursor);
popup_cursor_image = cursor->images[0]; popup_cursor_image = cursor->images[0];

@ -298,9 +298,9 @@ int main(int argc, char *argv[]) {
wlr_log(WLR_ERROR, "Failed to load cursor theme"); wlr_log(WLR_ERROR, "Failed to load cursor theme");
return 1; return 1;
} }
state.xcursor = wlr_xcursor_theme_get_cursor(theme, "left_ptr"); state.xcursor = wlr_xcursor_theme_get_cursor(theme, "default");
if (!state.xcursor) { if (!state.xcursor) {
wlr_log(WLR_ERROR, "Failed to load left_ptr cursor"); wlr_log(WLR_ERROR, "Failed to load default cursor");
return 1; return 1;
} }

@ -266,7 +266,7 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
wlr_output_layout_add_auto(sample->layout, sample_output->output); wlr_output_layout_add_auto(sample->layout, sample_output->output);
wlr_xcursor_manager_load(sample->xcursor_manager, output->scale); wlr_xcursor_manager_load(sample->xcursor_manager, output->scale);
wlr_xcursor_manager_set_cursor_image(sample->xcursor_manager, "left_ptr", wlr_xcursor_manager_set_cursor_image(sample->xcursor_manager, "default",
sample->cursor); sample->cursor);
struct wlr_output_mode *mode = wlr_output_preferred_mode(output); struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
@ -388,11 +388,11 @@ int main(int argc, char *argv[]) {
state.xcursor_manager = wlr_xcursor_manager_create("default", 24); state.xcursor_manager = wlr_xcursor_manager_create("default", 24);
if (!state.xcursor_manager) { if (!state.xcursor_manager) {
wlr_log(WLR_ERROR, "Failed to load left_ptr cursor"); wlr_log(WLR_ERROR, "Failed to load default cursor");
return 1; return 1;
} }
wlr_xcursor_manager_set_cursor_image(state.xcursor_manager, "left_ptr", wlr_xcursor_manager_set_cursor_image(state.xcursor_manager, "default",
state.cursor); state.cursor);
clock_gettime(CLOCK_MONOTONIC, &state.last_frame); clock_gettime(CLOCK_MONOTONIC, &state.last_frame);

@ -105,7 +105,7 @@ struct wlr_xcursor_theme *wlr_xcursor_theme_load(const char *name, int size);
void wlr_xcursor_theme_destroy(struct wlr_xcursor_theme *theme); void wlr_xcursor_theme_destroy(struct wlr_xcursor_theme *theme);
/** /**
* Obtain a cursor for the specified name (e.g. "left_ptr"). * Obtain a cursor for the specified name (e.g. "default").
* *
* If the cursor could not be found, NULL is returned. * If the cursor could not be found, NULL is returned.
*/ */

@ -450,7 +450,7 @@ static void process_cursor_motion(struct tinywl_server *server, uint32_t time) {
* default. This is what makes the cursor image appear when you move it * default. This is what makes the cursor image appear when you move it
* around the screen, not over any views. */ * around the screen, not over any views. */
wlr_xcursor_manager_set_cursor_image( wlr_xcursor_manager_set_cursor_image(
server->cursor_mgr, "left_ptr", server->cursor); server->cursor_mgr, "default", server->cursor);
} }
if (surface) { if (surface) {
/* /*

Loading…
Cancel
Save