backend: rename backend to multi in wlr_backend_autocreate()

This function deals with multiple kinds of backends. Make it more
obvious that this variable holds the multi backend which is returned
to the user.
This commit is contained in:
Simon Ser 2022-11-03 18:32:10 +01:00 committed by Alexander Orzechowski
parent e7c556fcf6
commit 77d9fc0848
1 changed files with 10 additions and 10 deletions

View File

@ -285,8 +285,8 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
} }
struct wlr_session *session = NULL; struct wlr_session *session = NULL;
struct wlr_backend *backend = wlr_multi_backend_create(display); struct wlr_backend *multi = wlr_multi_backend_create(display);
if (!backend) { if (!multi) {
wlr_log(WLR_ERROR, "could not allocate multibackend"); wlr_log(WLR_ERROR, "could not allocate multibackend");
return NULL; return NULL;
} }
@ -305,7 +305,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
char *saveptr; char *saveptr;
char *name = strtok_r(names, ",", &saveptr); char *name = strtok_r(names, ",", &saveptr);
while (name != NULL) { while (name != NULL) {
if (!attempt_backend_by_name(display, backend, name, &session)) { if (!attempt_backend_by_name(display, multi, name, &session)) {
wlr_log(WLR_ERROR, "failed to add backend '%s'", name); wlr_log(WLR_ERROR, "failed to add backend '%s'", name);
free(names); free(names);
goto error; goto error;
@ -324,7 +324,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
goto error; goto error;
} }
wlr_multi_backend_add(backend, wl_backend); wlr_multi_backend_add(multi, wl_backend);
goto success; goto success;
} }
@ -337,7 +337,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
goto error; goto error;
} }
wlr_multi_backend_add(backend, x11_backend); wlr_multi_backend_add(multi, x11_backend);
goto success; goto success;
} }
#endif #endif
@ -356,7 +356,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
wlr_log(WLR_ERROR, "Failed to start libinput backend"); wlr_log(WLR_ERROR, "Failed to start libinput backend");
goto error; goto error;
} }
wlr_multi_backend_add(backend, libinput); wlr_multi_backend_add(multi, libinput);
#else #else
if (env_parse_bool("WLR_LIBINPUT_NO_DEVICES")) { if (env_parse_bool("WLR_LIBINPUT_NO_DEVICES")) {
wlr_log(WLR_INFO, "WLR_LIBINPUT_NO_DEVICES is set, " wlr_log(WLR_INFO, "WLR_LIBINPUT_NO_DEVICES is set, "
@ -371,23 +371,23 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
#if WLR_HAS_DRM_BACKEND #if WLR_HAS_DRM_BACKEND
struct wlr_backend *primary_drm = struct wlr_backend *primary_drm =
attempt_drm_backend(display, backend, session); attempt_drm_backend(display, multi, session);
if (!primary_drm) { if (!primary_drm) {
wlr_log(WLR_ERROR, "Failed to open any DRM device"); wlr_log(WLR_ERROR, "Failed to open any DRM device");
goto error; goto error;
} }
drm_backend_monitor_create(backend, primary_drm, session); drm_backend_monitor_create(multi, primary_drm, session);
#endif #endif
success: success:
if (session_ptr != NULL) { if (session_ptr != NULL) {
*session_ptr = session; *session_ptr = session;
} }
return backend; return multi;
error: error:
wlr_backend_destroy(backend); wlr_backend_destroy(multi);
wlr_session_destroy(session); wlr_session_destroy(session);
return NULL; return NULL;
} }