From 7cbef152063e1fbb24e6204339ff4587a74be04b Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 9 Jul 2018 22:49:54 +0100 Subject: [PATCH] util: add wlr_ prefix to log symbols --- CONTRIBUTING.md | 4 +- backend/backend.c | 24 +++--- backend/drm/atomic.c | 16 ++-- backend/drm/backend.c | 14 ++-- backend/drm/drm.c | 102 +++++++++++------------ backend/drm/legacy.c | 6 +- backend/drm/properties.c | 4 +- backend/drm/renderer.c | 8 +- backend/drm/util.c | 2 +- backend/headless/backend.c | 8 +- backend/headless/input_device.c | 10 +-- backend/headless/output.c | 8 +- backend/libinput/backend.c | 22 ++--- backend/libinput/events.c | 10 +-- backend/libinput/keyboard.c | 2 +- backend/libinput/pointer.c | 10 +-- backend/libinput/tablet_pad.c | 8 +- backend/libinput/tablet_tool.c | 10 +-- backend/libinput/touch.c | 10 +-- backend/multi/backend.c | 8 +- backend/session/direct-freebsd.c | 26 +++--- backend/session/direct-ipc.c | 8 +- backend/session/direct.c | 26 +++--- backend/session/logind.c | 52 ++++++------ backend/session/session.c | 22 ++--- backend/wayland/backend.c | 14 ++-- backend/wayland/output.c | 10 +-- backend/wayland/registry.c | 2 +- backend/wayland/wl_seat.c | 14 ++-- backend/x11/backend.c | 8 +- backend/x11/output.c | 2 +- examples/idle.c | 2 +- examples/layer-shell.c | 12 +-- examples/multi-pointer.c | 12 +-- examples/output-layout.c | 6 +- examples/pointer.c | 10 +-- examples/rotation.c | 12 +-- examples/screenshot.c | 2 +- examples/simple.c | 8 +- examples/tablet.c | 8 +- examples/touch.c | 10 +-- glgen.sh | 2 +- include/render/gles2.h | 2 +- include/wlr/util/log.h | 33 ++++---- render/egl.c | 68 +++++++-------- render/gles2/renderer.c | 32 +++---- render/gles2/texture.c | 16 ++-- render/gles2/util.c | 4 +- render/wlr_renderer.c | 6 +- rootston/config.c | 40 ++++----- rootston/cursor.c | 2 +- rootston/desktop.c | 6 +- rootston/input.c | 8 +- rootston/keyboard.c | 10 +-- rootston/layer_shell.c | 4 +- rootston/main.c | 12 +-- rootston/output.c | 10 +-- rootston/seat.c | 14 ++-- rootston/virtual_keyboard.c | 2 +- rootston/wl_shell.c | 4 +- rootston/xdg_shell.c | 4 +- rootston/xdg_shell_v6.c | 4 +- rootston/xwayland.c | 2 +- types/data_device/wlr_data_device.c | 4 +- types/seat/wlr_seat.c | 6 +- types/seat/wlr_seat_keyboard.c | 2 +- types/seat/wlr_seat_touch.c | 12 +-- types/wlr_buffer.c | 4 +- types/wlr_compositor.c | 6 +- types/wlr_cursor.c | 20 ++--- types/wlr_gamma_control.c | 2 +- types/wlr_idle.c | 4 +- types/wlr_idle_inhibit_v1.c | 4 +- types/wlr_input_device.c | 2 +- types/wlr_keyboard.c | 6 +- types/wlr_layer_shell.c | 2 +- types/wlr_linux_dmabuf.c | 4 +- types/wlr_output.c | 6 +- types/wlr_output_layout.c | 6 +- types/wlr_screenshooter.c | 12 +-- types/wlr_server_decoration.c | 2 +- types/wlr_surface.c | 4 +- types/wlr_virtual_keyboard_v1.c | 2 +- types/wlr_wl_shell.c | 16 ++-- types/xdg_shell/wlr_xdg_surface.c | 6 +- types/xdg_shell/wlr_xdg_toplevel.c | 20 ++--- types/xdg_shell_v6/wlr_xdg_surface_v6.c | 6 +- types/xdg_shell_v6/wlr_xdg_toplevel_v6.c | 16 ++-- util/log.c | 26 +++--- wlroots.syms | 1 + xcursor/wlr_xcursor.c | 4 +- xwayland/selection/dnd.c | 16 ++-- xwayland/selection/incoming.c | 28 +++---- xwayland/selection/outgoing.c | 52 ++++++------ xwayland/selection/selection.c | 2 +- xwayland/sockets.c | 8 +- xwayland/xwayland.c | 32 +++---- xwayland/xwm.c | 80 +++++++++--------- 98 files changed, 631 insertions(+), 629 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9085f454..10e3ac22 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -192,13 +192,13 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display) { struct wlr_session *session = wlr_session_create(display); if (!session) { - wlr_log(L_ERROR, "Failed to start a DRM session"); + wlr_log(WLR_ERROR, "Failed to start a DRM session"); return NULL; } int gpu = wlr_session_find_gpu(session); if (gpu == -1) { - wlr_log(L_ERROR, "Failed to open DRM device"); + wlr_log(WLR_ERROR, "Failed to open DRM device"); goto error_session; } diff --git a/backend/backend.c b/backend/backend.c index 07e05fca..78b90007 100644 --- a/backend/backend.c +++ b/backend/backend.c @@ -65,7 +65,7 @@ static size_t parse_outputs_env(const char *name) { char *end; int outputs = (int)strtol(outputs_str, &end, 10); if (*end || outputs < 0) { - wlr_log(L_ERROR, "%s specified with invalid integer, ignoring", name); + wlr_log(WLR_ERROR, "%s specified with invalid integer, ignoring", name); return 1; } @@ -125,13 +125,13 @@ static struct wlr_backend *attempt_drm_backend(struct wl_display *display, int gpus[8]; size_t num_gpus = wlr_session_find_gpus(session, 8, gpus); struct wlr_backend *primary_drm = NULL; - wlr_log(L_INFO, "Found %zu GPUs", num_gpus); + wlr_log(WLR_INFO, "Found %zu GPUs", num_gpus); for (size_t i = 0; i < num_gpus; ++i) { struct wlr_backend *drm = wlr_drm_backend_create(display, session, gpus[i], primary_drm, create_renderer_func); if (!drm) { - wlr_log(L_ERROR, "Failed to open DRM device %d", gpus[i]); + wlr_log(WLR_ERROR, "Failed to open DRM device %d", gpus[i]); continue; } @@ -160,7 +160,7 @@ static struct wlr_backend *attempt_backend_by_name(struct wl_display *display, // DRM and libinput need a session *session = wlr_session_create(display); if (!*session) { - wlr_log(L_ERROR, "failed to start a session"); + wlr_log(WLR_ERROR, "failed to start a session"); return NULL; } @@ -171,7 +171,7 @@ static struct wlr_backend *attempt_backend_by_name(struct wl_display *display, } } - wlr_log(L_ERROR, "unrecognized backend '%s'", name); + wlr_log(WLR_ERROR, "unrecognized backend '%s'", name); return NULL; } @@ -179,7 +179,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display, wlr_renderer_create_func_t create_renderer_func) { struct wlr_backend *backend = wlr_multi_backend_create(display); if (!backend) { - wlr_log(L_ERROR, "could not allocate multibackend"); + wlr_log(WLR_ERROR, "could not allocate multibackend"); return NULL; } @@ -189,7 +189,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display, if (names) { names = strdup(names); if (names == NULL) { - wlr_log(L_ERROR, "allocation failed"); + wlr_log(WLR_ERROR, "allocation failed"); wlr_backend_destroy(backend); return NULL; } @@ -200,7 +200,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display, struct wlr_backend *subbackend = attempt_backend_by_name(display, backend, &session, name, create_renderer_func); if (subbackend == NULL) { - wlr_log(L_ERROR, "failed to start backend '%s'", name); + wlr_log(WLR_ERROR, "failed to start backend '%s'", name); wlr_backend_destroy(backend); wlr_session_destroy(session); free(names); @@ -208,7 +208,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display, } if (!wlr_multi_backend_add(backend, subbackend)) { - wlr_log(L_ERROR, "failed to add backend '%s'", name); + wlr_log(WLR_ERROR, "failed to add backend '%s'", name); wlr_backend_destroy(backend); wlr_session_destroy(session); free(names); @@ -247,14 +247,14 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display, // Attempt DRM+libinput session = wlr_session_create(display); if (!session) { - wlr_log(L_ERROR, "Failed to start a DRM session"); + wlr_log(WLR_ERROR, "Failed to start a DRM session"); wlr_backend_destroy(backend); return NULL; } struct wlr_backend *libinput = wlr_libinput_backend_create(display, session); if (!libinput) { - wlr_log(L_ERROR, "Failed to start libinput backend"); + wlr_log(WLR_ERROR, "Failed to start libinput backend"); wlr_backend_destroy(backend); wlr_session_destroy(session); return NULL; @@ -264,7 +264,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display, struct wlr_backend *primary_drm = attempt_drm_backend(display, backend, session, create_renderer_func); if (!primary_drm) { - wlr_log(L_ERROR, "Failed to open any DRM device"); + wlr_log(WLR_ERROR, "Failed to open any DRM device"); wlr_backend_destroy(libinput); wlr_backend_destroy(backend); wlr_session_destroy(session); diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c index 41b6424c..61d2f6e1 100644 --- a/backend/drm/atomic.c +++ b/backend/drm/atomic.c @@ -17,7 +17,7 @@ static void atomic_begin(struct wlr_drm_crtc *crtc, struct atomic *atom) { if (!crtc->atomic) { crtc->atomic = drmModeAtomicAlloc(); if (!crtc->atomic) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); atom->failed = true; return; } @@ -35,7 +35,7 @@ static bool atomic_end(int drm_fd, struct atomic *atom) { uint32_t flags = DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_ATOMIC_NONBLOCK; if (drmModeAtomicCommit(drm_fd, atom->req, flags, NULL)) { - wlr_log_errno(L_ERROR, "Atomic test failed"); + wlr_log_errno(WLR_ERROR, "Atomic test failed"); drmModeAtomicSetCursor(atom->req, atom->cursor); return false; } @@ -51,13 +51,13 @@ static bool atomic_commit(int drm_fd, struct atomic *atom, int ret = drmModeAtomicCommit(drm_fd, atom->req, flags, conn); if (ret) { - wlr_log_errno(L_ERROR, "%s: Atomic commit failed (%s)", + wlr_log_errno(WLR_ERROR, "%s: Atomic commit failed (%s)", conn->output.name, modeset ? "modeset" : "pageflip"); // Try to commit without new changes drmModeAtomicSetCursor(atom->req, atom->cursor); if (drmModeAtomicCommit(drm_fd, atom->req, flags, conn)) { - wlr_log_errno(L_ERROR, + wlr_log_errno(WLR_ERROR, "%s: Atomic commit without new changes failed (%s)", conn->output.name, modeset ? "modeset" : "pageflip"); } @@ -70,7 +70,7 @@ static bool atomic_commit(int drm_fd, struct atomic *atom, static inline void atomic_add(struct atomic *atom, uint32_t id, uint32_t prop, uint64_t val) { if (!atom->failed && drmModeAtomicAddProperty(atom->req, id, prop, val) < 0) { - wlr_log_errno(L_ERROR, "Failed to add atomic DRM property"); + wlr_log_errno(WLR_ERROR, "Failed to add atomic DRM property"); atom->failed = true; } } @@ -105,7 +105,7 @@ static bool atomic_crtc_pageflip(struct wlr_drm_backend *drm, } if (drmModeCreatePropertyBlob(drm->fd, mode, sizeof(*mode), &crtc->mode_id)) { - wlr_log_errno(L_ERROR, "Unable to create property blob"); + wlr_log_errno(WLR_ERROR, "Unable to create property blob"); return false; } } @@ -219,7 +219,7 @@ static bool atomic_crtc_set_gamma(struct wlr_drm_backend *drm, if (drmModeCreatePropertyBlob(drm->fd, gamma, sizeof(struct drm_color_lut) * size, &crtc->gamma_lut)) { - wlr_log_errno(L_ERROR, "Unable to create property blob"); + wlr_log_errno(WLR_ERROR, "Unable to create property blob"); return false; } @@ -239,7 +239,7 @@ static uint32_t atomic_crtc_get_gamma_size(struct wlr_drm_backend *drm, if (!get_drm_prop(drm->fd, crtc->id, crtc->props.gamma_lut_size, &gamma_lut_size)) { - wlr_log(L_ERROR, "Unable to get gamma lut size"); + wlr_log(WLR_ERROR, "Unable to get gamma lut size"); return 0; } diff --git a/backend/drm/backend.c b/backend/drm/backend.c index 7bb4dc32..5833d46e 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -70,7 +70,7 @@ static void session_signal(struct wl_listener *listener, void *data) { struct wlr_session *session = data; if (session->active) { - wlr_log(L_INFO, "DRM fd resumed"); + wlr_log(WLR_INFO, "DRM fd resumed"); scan_drm_connectors(drm); struct wlr_drm_connector *conn; @@ -92,7 +92,7 @@ static void session_signal(struct wl_listener *listener, void *data) { conn->cursor_y); } } else { - wlr_log(L_INFO, "DRM fd paused"); + wlr_log(WLR_INFO, "DRM fd paused"); } } @@ -101,7 +101,7 @@ static void drm_invalidated(struct wl_listener *listener, void *data) { wl_container_of(listener, drm, drm_invalidated); char *name = drmGetDeviceNameFromFd2(drm->fd); - wlr_log(L_DEBUG, "%s invalidated", name); + wlr_log(WLR_DEBUG, "%s invalidated", name); free(name); scan_drm_connectors(drm); @@ -121,13 +121,13 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display, char *name = drmGetDeviceNameFromFd2(gpu_fd); drmVersion *version = drmGetVersion(gpu_fd); - wlr_log(L_INFO, "Initializing DRM backend for %s (%s)", name, version->name); + wlr_log(WLR_INFO, "Initializing DRM backend for %s (%s)", name, version->name); free(name); drmFreeVersion(version); struct wlr_drm_backend *drm = calloc(1, sizeof(struct wlr_drm_backend)); if (!drm) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); return NULL; } wlr_backend_init(&drm->backend, &backend_impl); @@ -147,7 +147,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display, drm->drm_event = wl_event_loop_add_fd(event_loop, drm->fd, WL_EVENT_READABLE, handle_drm_event, NULL); if (!drm->drm_event) { - wlr_log(L_ERROR, "Failed to create DRM event source"); + wlr_log(WLR_ERROR, "Failed to create DRM event source"); goto error_fd; } @@ -163,7 +163,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display, } if (!init_drm_renderer(drm, &drm->renderer, create_renderer_func)) { - wlr_log(L_ERROR, "Failed to initialize renderer"); + wlr_log(WLR_ERROR, "Failed to initialize renderer"); goto error_event; } diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 05d3d1bd..c4674235 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -28,19 +28,19 @@ bool check_drm_features(struct wlr_drm_backend *drm) { if (drmSetClientCap(drm->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1)) { - wlr_log(L_ERROR, "DRM universal planes unsupported"); + wlr_log(WLR_ERROR, "DRM universal planes unsupported"); return false; } const char *no_atomic = getenv("WLR_DRM_NO_ATOMIC"); if (no_atomic && strcmp(no_atomic, "1") == 0) { - wlr_log(L_DEBUG, "WLR_DRM_NO_ATOMIC set, forcing legacy DRM interface"); + wlr_log(WLR_DEBUG, "WLR_DRM_NO_ATOMIC set, forcing legacy DRM interface"); drm->iface = &legacy_iface; } else if (drmSetClientCap(drm->fd, DRM_CLIENT_CAP_ATOMIC, 1)) { - wlr_log(L_DEBUG, "Atomic modesetting unsupported, using legacy DRM interface"); + wlr_log(WLR_DEBUG, "Atomic modesetting unsupported, using legacy DRM interface"); drm->iface = &legacy_iface; } else { - wlr_log(L_DEBUG, "Using atomic DRM interface"); + wlr_log(WLR_DEBUG, "Using atomic DRM interface"); drm->iface = &atomic_iface; } @@ -57,11 +57,11 @@ static int cmp_plane(const void *arg1, const void *arg2) { static bool init_planes(struct wlr_drm_backend *drm) { drmModePlaneRes *plane_res = drmModeGetPlaneResources(drm->fd); if (!plane_res) { - wlr_log_errno(L_ERROR, "Failed to get DRM plane resources"); + wlr_log_errno(WLR_ERROR, "Failed to get DRM plane resources"); return false; } - wlr_log(L_INFO, "Found %"PRIu32" DRM planes", plane_res->count_planes); + wlr_log(WLR_INFO, "Found %"PRIu32" DRM planes", plane_res->count_planes); if (plane_res->count_planes == 0) { drmModeFreePlaneResources(plane_res); @@ -71,7 +71,7 @@ static bool init_planes(struct wlr_drm_backend *drm) { drm->num_planes = plane_res->count_planes; drm->planes = calloc(drm->num_planes, sizeof(*drm->planes)); if (!drm->planes) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); goto error_res; } @@ -80,7 +80,7 @@ static bool init_planes(struct wlr_drm_backend *drm) { drmModePlane *plane = drmModeGetPlane(drm->fd, plane_res->planes[i]); if (!plane) { - wlr_log_errno(L_ERROR, "Failed to get DRM plane"); + wlr_log_errno(WLR_ERROR, "Failed to get DRM plane"); goto error_planes; } @@ -100,7 +100,7 @@ static bool init_planes(struct wlr_drm_backend *drm) { drmModeFreePlane(plane); } - wlr_log(L_INFO, "(%zu overlay, %zu primary, %zu cursor)", + wlr_log(WLR_INFO, "(%zu overlay, %zu primary, %zu cursor)", drm->num_overlay_planes, drm->num_primary_planes, drm->num_cursor_planes); @@ -126,16 +126,16 @@ error_res: bool init_drm_resources(struct wlr_drm_backend *drm) { drmModeRes *res = drmModeGetResources(drm->fd); if (!res) { - wlr_log_errno(L_ERROR, "Failed to get DRM resources"); + wlr_log_errno(WLR_ERROR, "Failed to get DRM resources"); return false; } - wlr_log(L_INFO, "Found %d DRM CRTCs", res->count_crtcs); + wlr_log(WLR_INFO, "Found %d DRM CRTCs", res->count_crtcs); drm->num_crtcs = res->count_crtcs; drm->crtcs = calloc(drm->num_crtcs, sizeof(drm->crtcs[0])); if (!drm->crtcs) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); goto error_res; } @@ -215,7 +215,7 @@ static bool drm_connector_swap_buffers(struct wlr_output *output, uint32_t fb_id = get_fb_for_bo(bo); if (conn->pageflip_pending) { - wlr_log(L_ERROR, "Skipping pageflip on output '%s'", conn->output.name); + wlr_log(WLR_ERROR, "Skipping pageflip on output '%s'", conn->output.name); return false; } @@ -278,7 +278,7 @@ static void drm_connector_start_renderer(struct wlr_drm_connector *conn) { return; } - wlr_log(L_DEBUG, "Starting renderer on output '%s'", conn->output.name); + wlr_log(WLR_DEBUG, "Starting renderer on output '%s'", conn->output.name); struct wlr_drm_backend *drm = (struct wlr_drm_backend *)conn->output.backend; struct wlr_drm_crtc *crtc = conn->crtc; @@ -322,7 +322,7 @@ void enable_drm_connector(struct wlr_output *output, bool enable) { static void realloc_planes(struct wlr_drm_backend *drm, const uint32_t *crtc_in, bool *changed_outputs) { - wlr_log(L_DEBUG, "Reallocating planes"); + wlr_log(WLR_DEBUG, "Reallocating planes"); // overlay, primary, cursor for (size_t type = 0; type < 3; ++type) { @@ -362,7 +362,7 @@ static void realloc_planes(struct wlr_drm_backend *drm, const uint32_t *crtc_in, struct wlr_drm_plane *new = &drm->type_planes[type][crtc_res[i]]; if (*old != new) { - wlr_log(L_DEBUG, "Assigning plane %d -> %d to CRTC %d", + wlr_log(WLR_DEBUG, "Assigning plane %d -> %d to CRTC %d", *old ? (int)(*old)->id : -1, new ? (int)new->id : -1, c->id); @@ -391,7 +391,7 @@ static void realloc_crtcs(struct wlr_drm_backend *drm, memset(possible_crtc, 0, sizeof(possible_crtc)); - wlr_log(L_DEBUG, "Reallocating CRTCs for output '%s'", conn->output.name); + wlr_log(WLR_DEBUG, "Reallocating CRTCs for output '%s'", conn->output.name); ssize_t index = -1, i = -1; struct wlr_drm_connector *c; @@ -401,7 +401,7 @@ static void realloc_crtcs(struct wlr_drm_backend *drm, index = i; } - wlr_log(L_DEBUG, "output '%s' crtc=%p state=%d", + wlr_log(WLR_DEBUG, "output '%s' crtc=%p state=%d", c->output.name, c->crtc, c->state); if (c->crtc) { @@ -428,14 +428,14 @@ static void realloc_crtcs(struct wlr_drm_backend *drm, // There is no point doing anything if this monitor doesn't get activated if (!matched[index]) { - wlr_log(L_DEBUG, "Could not match a CRTC for this output"); + wlr_log(WLR_DEBUG, "Could not match a CRTC for this output"); return; } for (size_t i = 0; i < drm->num_crtcs; ++i) { // We don't want any of the current monitors to be deactivated. if (crtc[i] != UNMATCHED && !matched[crtc[i]]) { - wlr_log(L_DEBUG, "Could not match a CRTC for other output %d", + wlr_log(WLR_DEBUG, "Could not match a CRTC for other output %d", crtc[i]); return; } @@ -460,7 +460,7 @@ static void realloc_crtcs(struct wlr_drm_backend *drm, } c->crtc = &drm->crtcs[i]; - wlr_log(L_DEBUG, "Assigning CRTC %d to output '%s'", + wlr_log(WLR_DEBUG, "Assigning CRTC %d to output '%s'", drm->crtcs[i].id, c->output.name); } } @@ -471,12 +471,12 @@ static void realloc_crtcs(struct wlr_drm_backend *drm, static uint32_t get_possible_crtcs(int fd, uint32_t conn_id) { drmModeConnector *conn = drmModeGetConnector(fd, conn_id); if (!conn) { - wlr_log_errno(L_ERROR, "Failed to get DRM connector"); + wlr_log_errno(WLR_ERROR, "Failed to get DRM connector"); return 0; } if (conn->connection != DRM_MODE_CONNECTED || conn->count_modes == 0) { - wlr_log(L_ERROR, "Output is not connected"); + wlr_log(WLR_ERROR, "Output is not connected"); goto error_conn; } @@ -486,7 +486,7 @@ static uint32_t get_possible_crtcs(int fd, uint32_t conn_id) { } if (!enc) { - wlr_log(L_ERROR, "Failed to get DRM encoder"); + wlr_log(WLR_ERROR, "Failed to get DRM encoder"); goto error_conn; } @@ -508,7 +508,7 @@ static bool drm_connector_set_mode(struct wlr_output *output, struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; bool changed_outputs[wl_list_length(&drm->outputs)]; - wlr_log(L_INFO, "Modesetting '%s' with '%ux%u@%u mHz'", conn->output.name, + wlr_log(WLR_INFO, "Modesetting '%s' with '%ux%u@%u mHz'", conn->output.name, mode->width, mode->height, mode->refresh); conn->possible_crtc = get_possible_crtcs(drm->fd, conn->id); @@ -521,10 +521,10 @@ static bool drm_connector_set_mode(struct wlr_output *output, struct wlr_drm_crtc *crtc = conn->crtc; if (!crtc) { - wlr_log(L_ERROR, "Unable to match %s with a CRTC", conn->output.name); + wlr_log(WLR_ERROR, "Unable to match %s with a CRTC", conn->output.name); goto error_conn; } - wlr_log(L_DEBUG, "%s: crtc=%td ovr=%td pri=%td cur=%td", conn->output.name, + wlr_log(WLR_DEBUG, "%s: crtc=%td ovr=%td pri=%td cur=%td", conn->output.name, crtc - drm->crtcs, crtc->overlay ? crtc->overlay - drm->overlay_planes : -1, crtc->primary ? crtc->primary - drm->primary_planes : -1, @@ -552,7 +552,7 @@ static bool drm_connector_set_mode(struct wlr_output *output, if (!init_drm_plane_surfaces(crtc->primary, drm, mode->width, mode->height, GBM_FORMAT_XRGB8888)) { - wlr_log(L_ERROR, "Failed to initialize renderer for plane"); + wlr_log(WLR_ERROR, "Failed to initialize renderer for plane"); goto error_conn; } @@ -585,7 +585,7 @@ bool wlr_drm_connector_add_mode(struct wlr_output *output, mode->wlr_mode.height = mode->drm_mode.vdisplay; mode->wlr_mode.refresh = mode->drm_mode.vrefresh; - wlr_log(L_INFO, "Registered custom mode " + wlr_log(WLR_INFO, "Registered custom mode " "%"PRId32"x%"PRId32"@%"PRId32, mode->wlr_mode.width, mode->wlr_mode.height, mode->wlr_mode.refresh); @@ -616,7 +616,7 @@ static bool drm_connector_set_cursor(struct wlr_output *output, // We don't have a real cursor plane, so we make a fake one plane = calloc(1, sizeof(*plane)); if (!plane) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); return false; } crtc->cursor = plane; @@ -632,14 +632,14 @@ static bool drm_connector_set_cursor(struct wlr_output *output, if (!init_drm_surface(&plane->surf, renderer, w, h, GBM_FORMAT_ARGB8888, 0)) { - wlr_log(L_ERROR, "Cannot allocate cursor resources"); + wlr_log(WLR_ERROR, "Cannot allocate cursor resources"); return false; } plane->cursor_bo = gbm_bo_create(renderer->gbm, w, h, GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE); if (!plane->cursor_bo) { - wlr_log_errno(L_ERROR, "Failed to create cursor bo"); + wlr_log_errno(WLR_ERROR, "Failed to create cursor bo"); return false; } } @@ -680,7 +680,7 @@ static bool drm_connector_set_cursor(struct wlr_output *output, height = height * output->scale / scale; if (width > (int)plane->surf.width || height > (int)plane->surf.height) { - wlr_log(L_ERROR, "Cursor too large (max %dx%d)", + wlr_log(WLR_ERROR, "Cursor too large (max %dx%d)", (int)plane->surf.width, (int)plane->surf.height); return false; } @@ -692,7 +692,7 @@ static bool drm_connector_set_cursor(struct wlr_output *output, void *bo_data; if (!gbm_bo_map(plane->cursor_bo, 0, 0, bo_width, bo_height, GBM_BO_TRANSFER_WRITE, &bo_stride, &bo_data)) { - wlr_log_errno(L_ERROR, "Unable to map buffer"); + wlr_log_errno(WLR_ERROR, "Unable to map buffer"); return false; } @@ -797,7 +797,7 @@ bool wlr_output_is_drm(struct wlr_output *output) { static int retry_pageflip(void *data) { struct wlr_drm_connector *conn = data; - wlr_log(L_INFO, "%s: Retrying pageflip", conn->output.name); + wlr_log(WLR_INFO, "%s: Retrying pageflip", conn->output.name); drm_connector_start_renderer(conn); return 0; } @@ -812,11 +812,11 @@ static const int32_t subpixel_map[] = { }; void scan_drm_connectors(struct wlr_drm_backend *drm) { - wlr_log(L_INFO, "Scanning DRM connectors"); + wlr_log(WLR_INFO, "Scanning DRM connectors"); drmModeRes *res = drmModeGetResources(drm->fd); if (!res) { - wlr_log_errno(L_ERROR, "Failed to get DRM resources"); + wlr_log_errno(WLR_ERROR, "Failed to get DRM resources"); return; } @@ -830,7 +830,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) { drmModeConnector *drm_conn = drmModeGetConnector(drm->fd, res->connectors[i]); if (!drm_conn) { - wlr_log_errno(L_ERROR, "Failed to get DRM connector"); + wlr_log_errno(WLR_ERROR, "Failed to get DRM connector"); continue; } drmModeEncoder *curr_enc = drmModeGetEncoder(drm->fd, @@ -849,7 +849,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) { if (!wlr_conn) { wlr_conn = calloc(1, sizeof(*wlr_conn)); if (!wlr_conn) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); drmModeFreeEncoder(curr_enc); drmModeFreeConnector(drm_conn); continue; @@ -874,7 +874,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) { drm_conn->connector_type_id); wl_list_insert(&drm->outputs, &wlr_conn->link); - wlr_log(L_INFO, "Found display '%s'", wlr_conn->output.name); + wlr_log(WLR_INFO, "Found display '%s'", wlr_conn->output.name); } else { seen[index] = true; } @@ -892,13 +892,13 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) { if (wlr_conn->state == WLR_DRM_CONN_DISCONNECTED && drm_conn->connection == DRM_MODE_CONNECTED) { - wlr_log(L_INFO, "'%s' connected", wlr_conn->output.name); - wlr_log(L_DEBUG, "Current CRTC: %d", + wlr_log(WLR_INFO, "'%s' connected", wlr_conn->output.name); + wlr_log(WLR_DEBUG, "Current CRTC: %d", wlr_conn->crtc ? (int)wlr_conn->crtc->id : -1); wlr_conn->output.phys_width = drm_conn->mmWidth; wlr_conn->output.phys_height = drm_conn->mmHeight; - wlr_log(L_INFO, "Physical size: %"PRId32"x%"PRId32, + wlr_log(WLR_INFO, "Physical size: %"PRId32"x%"PRId32, wlr_conn->output.phys_width, wlr_conn->output.phys_height); wlr_conn->output.subpixel = subpixel_map[drm_conn->subpixel]; @@ -910,12 +910,12 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) { parse_edid(&wlr_conn->output, edid_len, edid); free(edid); - wlr_log(L_INFO, "Detected modes:"); + wlr_log(WLR_INFO, "Detected modes:"); for (int i = 0; i < drm_conn->count_modes; ++i) { struct wlr_drm_mode *mode = calloc(1, sizeof(*mode)); if (!mode) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); continue; } mode->drm_mode = drm_conn->modes[i]; @@ -923,7 +923,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) { mode->wlr_mode.height = mode->drm_mode.vdisplay; mode->wlr_mode.refresh = calculate_refresh_rate(&mode->drm_mode); - wlr_log(L_INFO, " %"PRId32"x%"PRId32"@%"PRId32, + wlr_log(WLR_INFO, " %"PRId32"x%"PRId32"@%"PRId32, mode->wlr_mode.width, mode->wlr_mode.height, mode->wlr_mode.refresh); @@ -933,13 +933,13 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) { wlr_output_update_enabled(&wlr_conn->output, true); wlr_conn->state = WLR_DRM_CONN_NEEDS_MODESET; - wlr_log(L_INFO, "Sending modesetting signal for '%s'", + wlr_log(WLR_INFO, "Sending modesetting signal for '%s'", wlr_conn->output.name); wlr_signal_emit_safe(&drm->backend.events.new_output, &wlr_conn->output); } else if (wlr_conn->state == WLR_DRM_CONN_CONNECTED && drm_conn->connection != DRM_MODE_CONNECTED) { - wlr_log(L_INFO, "'%s' disconnected", wlr_conn->output.name); + wlr_log(WLR_INFO, "'%s' disconnected", wlr_conn->output.name); wlr_output_update_enabled(&wlr_conn->output, false); drm_connector_cleanup(wlr_conn); @@ -959,7 +959,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) { continue; } - wlr_log(L_INFO, "'%s' disappeared", conn->output.name); + wlr_log(WLR_INFO, "'%s' disappeared", conn->output.name); drm_connector_cleanup(conn); drmModeFreeCrtc(conn->old_crtc); @@ -1024,7 +1024,7 @@ void restore_drm_outputs(struct wlr_drm_backend *drm) { } if (to_close) { - wlr_log(L_ERROR, "Timed out stopping output renderers"); + wlr_log(WLR_ERROR, "Timed out stopping output renderers"); } wl_list_for_each(conn, &drm->outputs, link) { @@ -1077,7 +1077,7 @@ static void drm_connector_cleanup(struct wlr_drm_connector *conn) { conn->pageflip_pending = false; /* Fallthrough */ case WLR_DRM_CONN_NEEDS_MODESET: - wlr_log(L_INFO, "Emitting destruction signal for '%s'", + wlr_log(WLR_INFO, "Emitting destruction signal for '%s'", conn->output.name); wlr_signal_emit_safe(&conn->output.events.destroy, &conn->output); break; diff --git a/backend/drm/legacy.c b/backend/drm/legacy.c index 7c45ae21..d27cf137 100644 --- a/backend/drm/legacy.c +++ b/backend/drm/legacy.c @@ -12,13 +12,13 @@ static bool legacy_crtc_pageflip(struct wlr_drm_backend *drm, if (mode) { if (drmModeSetCrtc(drm->fd, crtc->id, fb_id, 0, 0, &conn->id, 1, mode)) { - wlr_log_errno(L_ERROR, "%s: Failed to set CRTC", conn->output.name); + wlr_log_errno(WLR_ERROR, "%s: Failed to set CRTC", conn->output.name); return false; } } if (drmModePageFlip(drm->fd, crtc->id, fb_id, DRM_MODE_PAGE_FLIP_EVENT, conn)) { - wlr_log_errno(L_ERROR, "%s: Failed to page flip", conn->output.name); + wlr_log_errno(WLR_ERROR, "%s: Failed to page flip", conn->output.name); return false; } @@ -47,7 +47,7 @@ bool legacy_crtc_set_cursor(struct wlr_drm_backend *drm, if (drmModeSetCursor(drm->fd, crtc->id, gbm_bo_get_handle(bo).u32, plane->surf.width, plane->surf.height)) { - wlr_log_errno(L_DEBUG, "Failed to set hardware cursor"); + wlr_log_errno(WLR_DEBUG, "Failed to set hardware cursor"); return false; } diff --git a/backend/drm/properties.c b/backend/drm/properties.c index c16d4b3a..372de232 100644 --- a/backend/drm/properties.c +++ b/backend/drm/properties.c @@ -63,14 +63,14 @@ static bool scan_properties(int fd, uint32_t id, uint32_t type, uint32_t *result const struct prop_info *info, size_t info_len) { drmModeObjectProperties *props = drmModeObjectGetProperties(fd, id, type); if (!props) { - wlr_log_errno(L_ERROR, "Failed to get DRM object properties"); + wlr_log_errno(WLR_ERROR, "Failed to get DRM object properties"); return false; } for (uint32_t i = 0; i < props->count_props; ++i) { drmModePropertyRes *prop = drmModeGetProperty(fd, props->props[i]); if (!prop) { - wlr_log_errno(L_ERROR, "Failed to get DRM object property"); + wlr_log_errno(WLR_ERROR, "Failed to get DRM object property"); continue; } diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c index 0ab63c86..38e6315d 100644 --- a/backend/drm/renderer.c +++ b/backend/drm/renderer.c @@ -22,7 +22,7 @@ bool init_drm_renderer(struct wlr_drm_backend *drm, struct wlr_drm_renderer *renderer, wlr_renderer_create_func_t create_renderer_func) { renderer->gbm = gbm_create_device(drm->fd); if (!renderer->gbm) { - wlr_log(L_ERROR, "Failed to create GBM device"); + wlr_log(WLR_ERROR, "Failed to create GBM device"); return false; } @@ -34,7 +34,7 @@ bool init_drm_renderer(struct wlr_drm_backend *drm, EGL_PLATFORM_GBM_MESA, renderer->gbm, NULL, GBM_FORMAT_ARGB8888); if (!renderer->wlr_rend) { - wlr_log(L_ERROR, "Failed to create EGL/WLR renderer"); + wlr_log(WLR_ERROR, "Failed to create EGL/WLR renderer"); goto error_gbm; } @@ -83,13 +83,13 @@ bool init_drm_surface(struct wlr_drm_surface *surf, surf->gbm = gbm_surface_create(renderer->gbm, width, height, format, GBM_BO_USE_RENDERING | flags); if (!surf->gbm) { - wlr_log_errno(L_ERROR, "Failed to create GBM surface"); + wlr_log_errno(WLR_ERROR, "Failed to create GBM surface"); goto error_zero; } surf->egl = wlr_egl_create_surface(&renderer->egl, surf->gbm); if (surf->egl == EGL_NO_SURFACE) { - wlr_log(L_ERROR, "Failed to create EGL surface"); + wlr_log(WLR_ERROR, "Failed to create EGL surface"); goto error_gbm; } diff --git a/backend/drm/util.c b/backend/drm/util.c index 73669205..baacbfa8 100644 --- a/backend/drm/util.c +++ b/backend/drm/util.c @@ -174,7 +174,7 @@ uint32_t get_fb_for_bo(struct gbm_bo *bo) { uint32_t format = gbm_bo_get_format(bo); if (drmModeAddFB2(fd, width, height, format, handles, pitches, offsets, &id, 0)) { - wlr_log_errno(L_ERROR, "Unable to add DRM framebuffer"); + wlr_log_errno(WLR_ERROR, "Unable to add DRM framebuffer"); } gbm_bo_set_user_data(bo, (void *)(uintptr_t)id, free_fb); diff --git a/backend/headless/backend.c b/backend/headless/backend.c index 7015099e..0138166d 100644 --- a/backend/headless/backend.c +++ b/backend/headless/backend.c @@ -11,7 +11,7 @@ static bool backend_start(struct wlr_backend *wlr_backend) { struct wlr_headless_backend *backend = (struct wlr_headless_backend *)wlr_backend; - wlr_log(L_INFO, "Starting headless backend"); + wlr_log(WLR_INFO, "Starting headless backend"); struct wlr_headless_output *output; wl_list_for_each(output, &backend->outputs, link) { @@ -80,12 +80,12 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) { struct wlr_backend *wlr_headless_backend_create(struct wl_display *display, wlr_renderer_create_func_t create_renderer_func) { - wlr_log(L_INFO, "Creating headless backend"); + wlr_log(WLR_INFO, "Creating headless backend"); struct wlr_headless_backend *backend = calloc(1, sizeof(struct wlr_headless_backend)); if (!backend) { - wlr_log(L_ERROR, "Failed to allocate wlr_headless_backend"); + wlr_log(WLR_ERROR, "Failed to allocate wlr_headless_backend"); return NULL; } wlr_backend_init(&backend->backend, &backend_impl); @@ -111,7 +111,7 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_display *display, NULL, (EGLint*)config_attribs, 0); if (!backend->renderer) { - wlr_log(L_ERROR, "Failed to create renderer"); + wlr_log(WLR_ERROR, "Failed to create renderer"); free(backend); return NULL; } diff --git a/backend/headless/input_device.c b/backend/headless/input_device.c index 63d28e8e..e0411c27 100644 --- a/backend/headless/input_device.c +++ b/backend/headless/input_device.c @@ -38,7 +38,7 @@ struct wlr_input_device *wlr_headless_add_input_device( case WLR_INPUT_DEVICE_KEYBOARD: wlr_device->keyboard = calloc(1, sizeof(struct wlr_keyboard)); if (wlr_device->keyboard == NULL) { - wlr_log(L_ERROR, "Unable to allocate wlr_keyboard"); + wlr_log(WLR_ERROR, "Unable to allocate wlr_keyboard"); goto error; } wlr_keyboard_init(wlr_device->keyboard, NULL); @@ -46,7 +46,7 @@ struct wlr_input_device *wlr_headless_add_input_device( case WLR_INPUT_DEVICE_POINTER: wlr_device->pointer = calloc(1, sizeof(struct wlr_pointer)); if (wlr_device->pointer == NULL) { - wlr_log(L_ERROR, "Unable to allocate wlr_pointer"); + wlr_log(WLR_ERROR, "Unable to allocate wlr_pointer"); goto error; } wlr_pointer_init(wlr_device->pointer, NULL); @@ -54,7 +54,7 @@ struct wlr_input_device *wlr_headless_add_input_device( case WLR_INPUT_DEVICE_TOUCH: wlr_device->touch = calloc(1, sizeof(struct wlr_touch)); if (wlr_device->touch == NULL) { - wlr_log(L_ERROR, "Unable to allocate wlr_touch"); + wlr_log(WLR_ERROR, "Unable to allocate wlr_touch"); goto error; } wlr_touch_init(wlr_device->touch, NULL); @@ -62,7 +62,7 @@ struct wlr_input_device *wlr_headless_add_input_device( case WLR_INPUT_DEVICE_TABLET_TOOL: wlr_device->tablet_tool = calloc(1, sizeof(struct wlr_tablet_tool)); if (wlr_device->tablet_tool == NULL) { - wlr_log(L_ERROR, "Unable to allocate wlr_tablet_tool"); + wlr_log(WLR_ERROR, "Unable to allocate wlr_tablet_tool"); goto error; } wlr_tablet_tool_init(wlr_device->tablet_tool, NULL); @@ -70,7 +70,7 @@ struct wlr_input_device *wlr_headless_add_input_device( case WLR_INPUT_DEVICE_TABLET_PAD: wlr_device->tablet_pad = calloc(1, sizeof(struct wlr_tablet_pad)); if (wlr_device->tablet_pad == NULL) { - wlr_log(L_ERROR, "Unable to allocate wlr_tablet_pad"); + wlr_log(WLR_ERROR, "Unable to allocate wlr_tablet_pad"); goto error; } wlr_tablet_pad_init(wlr_device->tablet_pad, NULL); diff --git a/backend/headless/output.c b/backend/headless/output.c index f71b4cdb..24fc3bfd 100644 --- a/backend/headless/output.c +++ b/backend/headless/output.c @@ -13,7 +13,7 @@ static EGLSurface egl_create_surface(struct wlr_egl *egl, unsigned int width, EGLSurface surf = eglCreatePbufferSurface(egl->display, egl->config, attribs); if (surf == EGL_NO_SURFACE) { - wlr_log(L_ERROR, "Failed to create EGL surface"); + wlr_log(WLR_ERROR, "Failed to create EGL surface"); return EGL_NO_SURFACE; } return surf; @@ -33,7 +33,7 @@ static bool output_set_custom_mode(struct wlr_output *wlr_output, int32_t width, output->egl_surface = egl_create_surface(&backend->egl, width, height); if (output->egl_surface == EGL_NO_SURFACE) { - wlr_log(L_ERROR, "Failed to recreate EGL surface"); + wlr_log(WLR_ERROR, "Failed to recreate EGL surface"); wlr_output_destroy(wlr_output); return false; } @@ -102,7 +102,7 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend, struct wlr_headless_output *output = calloc(1, sizeof(struct wlr_headless_output)); if (output == NULL) { - wlr_log(L_ERROR, "Failed to allocate wlr_headless_output"); + wlr_log(WLR_ERROR, "Failed to allocate wlr_headless_output"); return NULL; } output->backend = backend; @@ -112,7 +112,7 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend, output->egl_surface = egl_create_surface(&backend->egl, width, height); if (output->egl_surface == EGL_NO_SURFACE) { - wlr_log(L_ERROR, "Failed to create EGL surface"); + wlr_log(WLR_ERROR, "Failed to create EGL surface"); goto error; } diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index 1dde5854..19dc779d 100644 --- a/backend/libinput/backend.c +++ b/backend/libinput/backend.c @@ -26,7 +26,7 @@ static const struct libinput_interface libinput_impl = { static int handle_libinput_readable(int fd, uint32_t mask, void *_backend) { struct wlr_libinput_backend *backend = _backend; if (libinput_dispatch(backend->libinput_context) != 0) { - wlr_log(L_ERROR, "Failed to dispatch libinput"); + wlr_log(WLR_ERROR, "Failed to dispatch libinput"); // TODO: some kind of abort? return 0; } @@ -40,24 +40,24 @@ static int handle_libinput_readable(int fd, uint32_t mask, void *_backend) { static void log_libinput(struct libinput *libinput_context, enum libinput_log_priority priority, const char *fmt, va_list args) { - _wlr_vlog(L_ERROR, fmt, args); + _wlr_vlog(WLR_ERROR, fmt, args); } static bool backend_start(struct wlr_backend *_backend) { struct wlr_libinput_backend *backend = (struct wlr_libinput_backend *)_backend; - wlr_log(L_DEBUG, "Initializing libinput"); + wlr_log(WLR_DEBUG, "Initializing libinput"); backend->libinput_context = libinput_udev_create_context(&libinput_impl, backend, backend->session->udev); if (!backend->libinput_context) { - wlr_log(L_ERROR, "Failed to create libinput context"); + wlr_log(WLR_ERROR, "Failed to create libinput context"); return false; } if (libinput_udev_assign_seat(backend->libinput_context, backend->session->seat) != 0) { - wlr_log(L_ERROR, "Failed to assign libinput seat"); + wlr_log(WLR_ERROR, "Failed to assign libinput seat"); return false; } @@ -75,8 +75,8 @@ static bool backend_start(struct wlr_backend *_backend) { if (!no_devs && backend->wlr_device_lists.length == 0) { handle_libinput_readable(libinput_fd, WL_EVENT_READABLE, backend); if (backend->wlr_device_lists.length == 0) { - wlr_log(L_ERROR, "libinput initialization failed, no input devices"); - wlr_log(L_ERROR, "Set WLR_LIBINPUT_NO_DEVICES=1 to suppress this check"); + wlr_log(WLR_ERROR, "libinput initialization failed, no input devices"); + wlr_log(WLR_ERROR, "Set WLR_LIBINPUT_NO_DEVICES=1 to suppress this check"); return false; } } @@ -89,10 +89,10 @@ static bool backend_start(struct wlr_backend *_backend) { backend->input_event = wl_event_loop_add_fd(event_loop, libinput_fd, WL_EVENT_READABLE, handle_libinput_readable, backend); if (!backend->input_event) { - wlr_log(L_ERROR, "Failed to create input event on event loop"); + wlr_log(WLR_ERROR, "Failed to create input event on event loop"); return false; } - wlr_log(L_DEBUG, "libinput successfully initialized"); + wlr_log(WLR_DEBUG, "libinput successfully initialized"); return true; } @@ -162,13 +162,13 @@ struct wlr_backend *wlr_libinput_backend_create(struct wl_display *display, struct wlr_libinput_backend *backend = calloc(1, sizeof(struct wlr_libinput_backend)); if (!backend) { - wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno)); + wlr_log(WLR_ERROR, "Allocation failed: %s", strerror(errno)); return NULL; } wlr_backend_init(&backend->backend, &backend_impl); if (!wlr_list_init(&backend->wlr_device_lists)) { - wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno)); + wlr_log(WLR_ERROR, "Allocation failed: %s", strerror(errno)); goto error_backend; } diff --git a/backend/libinput/events.c b/backend/libinput/events.c index 2e4b7f84..93664af2 100644 --- a/backend/libinput/events.c +++ b/backend/libinput/events.c @@ -79,11 +79,11 @@ static void handle_device_added(struct wlr_libinput_backend *backend, const char *name = libinput_device_get_name(libinput_dev); struct wl_list *wlr_devices = calloc(1, sizeof(struct wl_list)); if (!wlr_devices) { - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); return; } wl_list_init(wlr_devices); - wlr_log(L_DEBUG, "Added %s [%d:%d]", name, vendor, product); + wlr_log(WLR_DEBUG, "Added %s [%d:%d]", name, vendor, product); if (libinput_device_has_capability(libinput_dev, LIBINPUT_DEVICE_CAP_KEYBOARD)) { struct wlr_input_device *wlr_dev = allocate_device(backend, @@ -166,7 +166,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend, return; fail: - wlr_log(L_ERROR, "Could not allocate new device"); + wlr_log(WLR_ERROR, "Could not allocate new device"); struct wlr_input_device *dev, *tmp_dev; wl_list_for_each_safe(dev, tmp_dev, wlr_devices, link) { free(dev); @@ -180,7 +180,7 @@ static void handle_device_removed(struct wlr_libinput_backend *backend, int vendor = libinput_device_get_id_vendor(libinput_dev); int product = libinput_device_get_id_product(libinput_dev); const char *name = libinput_device_get_name(libinput_dev); - wlr_log(L_DEBUG, "Removing %s [%d:%d]", name, vendor, product); + wlr_log(WLR_DEBUG, "Removing %s [%d:%d]", name, vendor, product); if (!wlr_devices) { return; } @@ -261,7 +261,7 @@ void handle_libinput_event(struct wlr_libinput_backend *backend, handle_tablet_pad_strip(event, libinput_dev); break; default: - wlr_log(L_DEBUG, "Unknown libinput event %d", event_type); + wlr_log(WLR_DEBUG, "Unknown libinput event %d", event_type); break; } } diff --git a/backend/libinput/keyboard.c b/backend/libinput/keyboard.c index e17191e3..d0059e06 100644 --- a/backend/libinput/keyboard.c +++ b/backend/libinput/keyboard.c @@ -50,7 +50,7 @@ void handle_keyboard_key(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_KEYBOARD, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a keyboard event for a device with no keyboards?"); + wlr_log(WLR_DEBUG, "Got a keyboard event for a device with no keyboards?"); return; } struct libinput_event_keyboard *kbevent = diff --git a/backend/libinput/pointer.c b/backend/libinput/pointer.c index f628cf22..fb85cddd 100644 --- a/backend/libinput/pointer.c +++ b/backend/libinput/pointer.c @@ -13,7 +13,7 @@ struct wlr_pointer *create_libinput_pointer( assert(libinput_dev); struct wlr_pointer *wlr_pointer = calloc(1, sizeof(struct wlr_pointer)); if (!wlr_pointer) { - wlr_log(L_ERROR, "Unable to allocate wlr_pointer"); + wlr_log(WLR_ERROR, "Unable to allocate wlr_pointer"); return NULL; } wlr_pointer_init(wlr_pointer, NULL); @@ -25,7 +25,7 @@ void handle_pointer_motion(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_POINTER, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a pointer event for a device with no pointers?"); + wlr_log(WLR_DEBUG, "Got a pointer event for a device with no pointers?"); return; } struct libinput_event_pointer *pevent = @@ -44,7 +44,7 @@ void handle_pointer_motion_abs(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_POINTER, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a pointer event for a device with no pointers?"); + wlr_log(WLR_DEBUG, "Got a pointer event for a device with no pointers?"); return; } struct libinput_event_pointer *pevent = @@ -63,7 +63,7 @@ void handle_pointer_button(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_POINTER, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a pointer event for a device with no pointers?"); + wlr_log(WLR_DEBUG, "Got a pointer event for a device with no pointers?"); return; } struct libinput_event_pointer *pevent = @@ -89,7 +89,7 @@ void handle_pointer_axis(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_POINTER, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a pointer event for a device with no pointers?"); + wlr_log(WLR_DEBUG, "Got a pointer event for a device with no pointers?"); return; } struct libinput_event_pointer *pevent = diff --git a/backend/libinput/tablet_pad.c b/backend/libinput/tablet_pad.c index aa8b26d9..626c2219 100644 --- a/backend/libinput/tablet_pad.c +++ b/backend/libinput/tablet_pad.c @@ -13,7 +13,7 @@ struct wlr_tablet_pad *create_libinput_tablet_pad( assert(libinput_dev); struct wlr_tablet_pad *wlr_tablet_pad = calloc(1, sizeof(struct wlr_tablet_pad)); if (!wlr_tablet_pad) { - wlr_log(L_ERROR, "Unable to allocate wlr_tablet_pad"); + wlr_log(WLR_ERROR, "Unable to allocate wlr_tablet_pad"); return NULL; } wlr_tablet_pad_init(wlr_tablet_pad, NULL); @@ -25,7 +25,7 @@ void handle_tablet_pad_button(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TABLET_PAD, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a tablet pad event for a device with no tablet pad?"); + wlr_log(WLR_DEBUG, "Got a tablet pad event for a device with no tablet pad?"); return; } struct libinput_event_tablet_pad *pevent = @@ -51,7 +51,7 @@ void handle_tablet_pad_ring(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TABLET_PAD, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a tablet pad event for a device with no tablet pad?"); + wlr_log(WLR_DEBUG, "Got a tablet pad event for a device with no tablet pad?"); return; } struct libinput_event_tablet_pad *pevent = @@ -78,7 +78,7 @@ void handle_tablet_pad_strip(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TABLET_PAD, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a tablet pad event for a device with no tablet pad?"); + wlr_log(WLR_DEBUG, "Got a tablet pad event for a device with no tablet pad?"); return; } struct libinput_event_tablet_pad *pevent = diff --git a/backend/libinput/tablet_tool.c b/backend/libinput/tablet_tool.c index b0bcfff5..e9308b65 100644 --- a/backend/libinput/tablet_tool.c +++ b/backend/libinput/tablet_tool.c @@ -13,7 +13,7 @@ struct wlr_tablet_tool *create_libinput_tablet_tool( assert(libinput_dev); struct wlr_tablet_tool *wlr_tablet_tool = calloc(1, sizeof(struct wlr_tablet_tool)); if (!wlr_tablet_tool) { - wlr_log(L_ERROR, "Unable to allocate wlr_tablet_tool"); + wlr_log(WLR_ERROR, "Unable to allocate wlr_tablet_tool"); return NULL; } wlr_tablet_tool_init(wlr_tablet_tool, NULL); @@ -25,7 +25,7 @@ void handle_tablet_tool_axis(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TABLET_TOOL, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a tablet tool event for a device with no tablet tools?"); + wlr_log(WLR_DEBUG, "Got a tablet tool event for a device with no tablet tools?"); return; } struct libinput_event_tablet_tool *tevent = @@ -78,7 +78,7 @@ void handle_tablet_tool_proximity(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TABLET_TOOL, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a tablet tool event for a device with no tablet tools?"); + wlr_log(WLR_DEBUG, "Got a tablet tool event for a device with no tablet tools?"); return; } struct libinput_event_tablet_tool *tevent = @@ -104,7 +104,7 @@ void handle_tablet_tool_tip(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TABLET_TOOL, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a tablet tool event for a device with no tablet tools?"); + wlr_log(WLR_DEBUG, "Got a tablet tool event for a device with no tablet tools?"); return; } handle_tablet_tool_axis(event, libinput_dev); @@ -130,7 +130,7 @@ void handle_tablet_tool_button(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TABLET_TOOL, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a tablet tool event for a device with no tablet tools?"); + wlr_log(WLR_DEBUG, "Got a tablet tool event for a device with no tablet tools?"); return; } handle_tablet_tool_axis(event, libinput_dev); diff --git a/backend/libinput/touch.c b/backend/libinput/touch.c index d79b2a97..cb9b0e36 100644 --- a/backend/libinput/touch.c +++ b/backend/libinput/touch.c @@ -13,7 +13,7 @@ struct wlr_touch *create_libinput_touch( assert(libinput_dev); struct wlr_touch *wlr_touch = calloc(1, sizeof(struct wlr_touch)); if (!wlr_touch) { - wlr_log(L_ERROR, "Unable to allocate wlr_touch"); + wlr_log(WLR_ERROR, "Unable to allocate wlr_touch"); return NULL; } wlr_touch_init(wlr_touch, NULL); @@ -25,7 +25,7 @@ void handle_touch_down(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TOUCH, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a touch event for a device with no touch?"); + wlr_log(WLR_DEBUG, "Got a touch event for a device with no touch?"); return; } struct libinput_event_touch *tevent = @@ -45,7 +45,7 @@ void handle_touch_up(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TOUCH, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a touch event for a device with no touch?"); + wlr_log(WLR_DEBUG, "Got a touch event for a device with no touch?"); return; } struct libinput_event_touch *tevent = @@ -63,7 +63,7 @@ void handle_touch_motion(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TOUCH, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a touch event for a device with no touch?"); + wlr_log(WLR_DEBUG, "Got a touch event for a device with no touch?"); return; } struct libinput_event_touch *tevent = @@ -83,7 +83,7 @@ void handle_touch_cancel(struct libinput_event *event, struct wlr_input_device *wlr_dev = get_appropriate_device(WLR_INPUT_DEVICE_TOUCH, libinput_dev); if (!wlr_dev) { - wlr_log(L_DEBUG, "Got a touch event for a device with no touch?"); + wlr_log(WLR_DEBUG, "Got a touch event for a device with no touch?"); return; } struct libinput_event_touch *tevent = diff --git a/backend/multi/backend.c b/backend/multi/backend.c index 33dfc6c5..f1d50347 100644 --- a/backend/multi/backend.c +++ b/backend/multi/backend.c @@ -22,7 +22,7 @@ static bool multi_backend_start(struct wlr_backend *wlr_backend) { struct subbackend_state *sub; wl_list_for_each(sub, &backend->backends, link) { if (!wlr_backend_start(sub->backend)) { - wlr_log(L_ERROR, "Failed to initialize backend."); + wlr_log(WLR_ERROR, "Failed to initialize backend."); return false; } } @@ -81,7 +81,7 @@ struct wlr_backend *wlr_multi_backend_create(struct wl_display *display) { struct wlr_multi_backend *backend = calloc(1, sizeof(struct wlr_multi_backend)); if (!backend) { - wlr_log(L_ERROR, "Backend allocation failed"); + wlr_log(WLR_ERROR, "Backend allocation failed"); return NULL; } @@ -144,14 +144,14 @@ bool wlr_multi_backend_add(struct wlr_backend *_multi, multi_backend_get_renderer(&multi->backend); struct wlr_renderer *backend_renderer = wlr_backend_get_renderer(backend); if (multi_renderer != NULL && backend_renderer != NULL) { - wlr_log(L_ERROR, "Could not add backend: multiple renderers at the " + wlr_log(WLR_ERROR, "Could not add backend: multiple renderers at the " "same time aren't supported"); return false; } struct subbackend_state *sub = calloc(1, sizeof(struct subbackend_state)); if (sub == NULL) { - wlr_log(L_ERROR, "Could not add backend: allocation failed"); + wlr_log(WLR_ERROR, "Could not add backend: allocation failed"); return false; } wl_list_insert(&multi->backends, &sub->link); diff --git a/backend/session/direct-freebsd.c b/backend/session/direct-freebsd.c index 6e23bf1b..63e1be01 100644 --- a/backend/session/direct-freebsd.c +++ b/backend/session/direct-freebsd.c @@ -35,7 +35,7 @@ static int direct_session_open(struct wlr_session *base, const char *path) { int fd = direct_ipc_open(session->sock, path); if (fd < 0) { - wlr_log(L_ERROR, "Failed to open %s: %s%s", path, strerror(-fd), + wlr_log(WLR_ERROR, "Failed to open %s: %s%s", path, strerror(-fd), fd == -EINVAL ? "; is another display server running?" : ""); return fd; } @@ -54,7 +54,7 @@ static void direct_session_close(struct wlr_session *base, int fd) { struct stat st; if (fstat(fd, &st) < 0) { - wlr_log_errno(L_ERROR, "Stat failed"); + wlr_log_errno(WLR_ERROR, "Stat failed"); close(fd); return; } @@ -80,7 +80,7 @@ static void direct_session_destroy(struct wlr_session *base) { ioctl(session->tty_fd, VT_SETMODE, &mode); if (errno) { - wlr_log(L_ERROR, "Failed to restore tty"); + wlr_log(WLR_ERROR, "Failed to restore tty"); } direct_ipc_finish(session->sock, session->child); @@ -110,21 +110,21 @@ static int vt_handler(int signo, void *data) { static bool setup_tty(struct direct_session *session, struct wl_display *display) { int fd = -1, tty = -1, tty0_fd = -1; if ((tty0_fd = open("/dev/ttyv0", O_RDWR | O_CLOEXEC)) < 0) { - wlr_log_errno(L_ERROR, "Could not open /dev/ttyv0 to find a free vt"); + wlr_log_errno(WLR_ERROR, "Could not open /dev/ttyv0 to find a free vt"); goto error; } if (ioctl(tty0_fd, VT_OPENQRY, &tty) != 0) { - wlr_log_errno(L_ERROR, "Could not find a free vt"); + wlr_log_errno(WLR_ERROR, "Could not find a free vt"); goto error; } close(tty0_fd); char tty_path[64]; snprintf(tty_path, sizeof(tty_path), "/dev/ttyv%d", tty - 1); - wlr_log(L_INFO, "Using tty %s", tty_path); + wlr_log(WLR_INFO, "Using tty %s", tty_path); fd = open(tty_path, O_RDWR | O_NOCTTY | O_CLOEXEC); if (fd == -1) { - wlr_log_errno(L_ERROR, "Cannot open tty"); + wlr_log_errno(WLR_ERROR, "Cannot open tty"); return false; } @@ -133,17 +133,17 @@ static bool setup_tty(struct direct_session *session, struct wl_display *display int old_kbmode; if (ioctl(fd, KDGKBMODE, &old_kbmode)) { - wlr_log_errno(L_ERROR, "Failed to read tty %d keyboard mode", tty); + wlr_log_errno(WLR_ERROR, "Failed to read tty %d keyboard mode", tty); goto error; } if (ioctl(fd, KDSKBMODE, K_CODE)) { - wlr_log_errno(L_ERROR, "Failed to set keyboard mode K_CODE on tty %d", tty); + wlr_log_errno(WLR_ERROR, "Failed to set keyboard mode K_CODE on tty %d", tty); goto error; } if (ioctl(fd, KDSETMODE, KD_GRAPHICS)) { - wlr_log_errno(L_ERROR, "Failed to set graphics mode on tty %d", tty); + wlr_log_errno(WLR_ERROR, "Failed to set graphics mode on tty %d", tty); goto error; } @@ -155,7 +155,7 @@ static bool setup_tty(struct direct_session *session, struct wl_display *display }; if (ioctl(fd, VT_SETMODE, &mode) < 0) { - wlr_log(L_ERROR, "Failed to take control of tty %d", tty); + wlr_log(WLR_ERROR, "Failed to take control of tty %d", tty); goto error; } @@ -182,7 +182,7 @@ error: static struct wlr_session *direct_session_create(struct wl_display *disp) { struct direct_session *session = calloc(1, sizeof(*session)); if (!session) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); return NULL; } @@ -195,7 +195,7 @@ static struct wlr_session *direct_session_create(struct wl_display *disp) { goto error_ipc; } - wlr_log(L_INFO, "Successfully loaded direct session"); + wlr_log(WLR_INFO, "Successfully loaded direct session"); snprintf(session->base.seat, sizeof(session->base.seat), "seat0"); session->base.impl = &session_direct; diff --git a/backend/session/direct-ipc.c b/backend/session/direct-ipc.c index 2dd777c8..5fdb95ac 100644 --- a/backend/session/direct-ipc.c +++ b/backend/session/direct-ipc.c @@ -32,7 +32,7 @@ static bool have_permissions(void) { cap_flag_value_t val; if (!cap || cap_get_flag(cap, CAP_SYS_ADMIN, CAP_PERMITTED, &val) || val != CAP_SET) { - wlr_log(L_ERROR, "Do not have CAP_SYS_ADMIN; cannot become DRM master"); + wlr_log(WLR_ERROR, "Do not have CAP_SYS_ADMIN; cannot become DRM master"); cap_free(cap); return false; } @@ -44,7 +44,7 @@ static bool have_permissions(void) { static bool have_permissions(void) { #ifdef __linux__ if (geteuid() != 0) { - wlr_log(L_ERROR, "Do not have root privileges; cannot become DRM master"); + wlr_log(WLR_ERROR, "Do not have root privileges; cannot become DRM master"); return false; } #endif @@ -229,13 +229,13 @@ int direct_ipc_init(pid_t *pid_out) { int sock[2]; if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, sock) < 0) { - wlr_log_errno(L_ERROR, "Failed to create socket pair"); + wlr_log_errno(WLR_ERROR, "Failed to create socket pair"); return -1; } pid_t pid = fork(); if (pid < 0) { - wlr_log_errno(L_ERROR, "Fork failed"); + wlr_log_errno(WLR_ERROR, "Fork failed"); close(sock[0]); close(sock[1]); return -1; diff --git a/backend/session/direct.c b/backend/session/direct.c index 7fa7d05b..ed7a0c65 100644 --- a/backend/session/direct.c +++ b/backend/session/direct.c @@ -38,7 +38,7 @@ static int direct_session_open(struct wlr_session *base, const char *path) { int fd = direct_ipc_open(session->sock, path); if (fd < 0) { - wlr_log(L_ERROR, "Failed to open %s: %s%s", path, strerror(-fd), + wlr_log(WLR_ERROR, "Failed to open %s: %s%s", path, strerror(-fd), fd == -EINVAL ? "; is another display server running?" : ""); return fd; } @@ -61,7 +61,7 @@ static void direct_session_close(struct wlr_session *base, int fd) { struct stat st; if (fstat(fd, &st) < 0) { - wlr_log_errno(L_ERROR, "Stat failed"); + wlr_log_errno(WLR_ERROR, "Stat failed"); close(fd); return; } @@ -100,7 +100,7 @@ static void direct_session_destroy(struct wlr_session *base) { ioctl(session->tty_fd, VT_SETMODE, &mode); if (errno) { - wlr_log(L_ERROR, "Failed to restore tty"); + wlr_log(WLR_ERROR, "Failed to restore tty"); } wl_event_source_remove(session->vt_source); @@ -150,13 +150,13 @@ static int vt_handler(int signo, void *data) { static bool setup_tty(struct direct_session *session, struct wl_display *display) { int fd = open("/dev/tty", O_RDWR); if (fd == -1) { - wlr_log_errno(L_ERROR, "Cannot open /dev/tty"); + wlr_log_errno(WLR_ERROR, "Cannot open /dev/tty"); return false; } struct vt_stat vt_stat; if (ioctl(fd, VT_GETSTATE, &vt_stat)) { - wlr_log_errno(L_ERROR, "Could not get current tty number"); + wlr_log_errno(WLR_ERROR, "Could not get current tty number"); goto error; } @@ -165,12 +165,12 @@ static bool setup_tty(struct direct_session *session, struct wl_display *display ret = ioctl(fd, KDGETMODE, &kd_mode); if (ret) { - wlr_log_errno(L_ERROR, "Failed to get tty mode"); + wlr_log_errno(WLR_ERROR, "Failed to get tty mode"); goto error; } if (kd_mode != KD_TEXT) { - wlr_log(L_ERROR, + wlr_log(WLR_ERROR, "tty already in graphics mode; is another display server running?"); goto error; } @@ -179,17 +179,17 @@ static bool setup_tty(struct direct_session *session, struct wl_display *display ioctl(fd, VT_WAITACTIVE, tty); if (ioctl(fd, KDGKBMODE, &old_kbmode)) { - wlr_log_errno(L_ERROR, "Failed to read keyboard mode"); + wlr_log_errno(WLR_ERROR, "Failed to read keyboard mode"); goto error; } if (ioctl(fd, KDSKBMODE, K_OFF)) { - wlr_log_errno(L_ERROR, "Failed to set keyboard mode"); + wlr_log_errno(WLR_ERROR, "Failed to set keyboard mode"); goto error; } if (ioctl(fd, KDSETMODE, KD_GRAPHICS)) { - wlr_log_errno(L_ERROR, "Failed to set graphics mode on tty"); + wlr_log_errno(WLR_ERROR, "Failed to set graphics mode on tty"); goto error; } @@ -200,7 +200,7 @@ static bool setup_tty(struct direct_session *session, struct wl_display *display }; if (ioctl(fd, VT_SETMODE, &mode) < 0) { - wlr_log(L_ERROR, "Failed to take control of tty"); + wlr_log(WLR_ERROR, "Failed to take control of tty"); goto error; } @@ -225,7 +225,7 @@ error: static struct wlr_session *direct_session_create(struct wl_display *disp) { struct direct_session *session = calloc(1, sizeof(*session)); if (!session) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); return NULL; } @@ -251,7 +251,7 @@ static struct wlr_session *direct_session_create(struct wl_display *disp) { snprintf(session->base.seat, sizeof(session->base.seat), "%s", seat); session->base.impl = &session_direct; - wlr_log(L_INFO, "Successfully loaded direct session"); + wlr_log(WLR_INFO, "Successfully loaded direct session"); return &session->base; error_ipc: diff --git a/backend/session/logind.c b/backend/session/logind.c index e01047e3..2f816b95 100644 --- a/backend/session/logind.c +++ b/backend/session/logind.c @@ -47,7 +47,7 @@ static int logind_take_device(struct wlr_session *base, const char *path) { struct stat st; if (stat(path, &st) < 0) { - wlr_log(L_ERROR, "Failed to stat '%s'", path); + wlr_log(WLR_ERROR, "Failed to stat '%s'", path); return -1; } @@ -55,14 +55,14 @@ static int logind_take_device(struct wlr_session *base, const char *path) { session->path, "org.freedesktop.login1.Session", "TakeDevice", &error, &msg, "uu", major(st.st_rdev), minor(st.st_rdev)); if (ret < 0) { - wlr_log(L_ERROR, "Failed to take device '%s': %s", path, error.message); + wlr_log(WLR_ERROR, "Failed to take device '%s': %s", path, error.message); goto error; } int paused = 0; ret = sd_bus_message_read(msg, "hb", &fd, &paused); if (ret < 0) { - wlr_log(L_ERROR, "Failed to parse D-Bus response for '%s': %s", + wlr_log(WLR_ERROR, "Failed to parse D-Bus response for '%s': %s", path, strerror(-ret)); goto error; } @@ -71,7 +71,7 @@ static int logind_take_device(struct wlr_session *base, const char *path) { // so we just clone it. fd = fcntl(fd, F_DUPFD_CLOEXEC, 0); if (fd == -1) { - wlr_log(L_ERROR, "Failed to clone file descriptor for '%s': %s", + wlr_log(WLR_ERROR, "Failed to clone file descriptor for '%s': %s", path, strerror(errno)); goto error; } @@ -91,7 +91,7 @@ static void logind_release_device(struct wlr_session *base, int fd) { struct stat st; if (fstat(fd, &st) < 0) { - wlr_log(L_ERROR, "Failed to stat device '%d'", fd); + wlr_log(WLR_ERROR, "Failed to stat device '%d'", fd); return; } @@ -99,7 +99,7 @@ static void logind_release_device(struct wlr_session *base, int fd) { session->path, "org.freedesktop.login1.Session", "ReleaseDevice", &error, &msg, "uu", major(st.st_rdev), minor(st.st_rdev)); if (ret < 0) { - wlr_log(L_ERROR, "Failed to release device '%d'", fd); + wlr_log(WLR_ERROR, "Failed to release device '%d'", fd); } sd_bus_error_free(&error); @@ -123,7 +123,7 @@ static bool logind_change_vt(struct wlr_session *base, unsigned vt) { "/org/freedesktop/login1/seat/self", "org.freedesktop.login1.Seat", "SwitchTo", &error, &msg, "u", (uint32_t)vt); if (ret < 0) { - wlr_log(L_ERROR, "Failed to change to vt '%d'", vt); + wlr_log(WLR_ERROR, "Failed to change to vt '%d'", vt); } sd_bus_error_free(&error); @@ -140,7 +140,7 @@ static bool find_session_path(struct logind_session *session) { "/org/freedesktop/login1", "org.freedesktop.login1.Manager", "GetSession", &error, &msg, "s", session->id); if (ret < 0) { - wlr_log(L_ERROR, "Failed to get session path: %s", strerror(-ret)); + wlr_log(WLR_ERROR, "Failed to get session path: %s", strerror(-ret)); goto out; } @@ -148,7 +148,7 @@ static bool find_session_path(struct logind_session *session) { ret = sd_bus_message_read(msg, "o", &path); if (ret < 0) { - wlr_log(L_ERROR, "Could not parse session path: %s", strerror(-ret)); + wlr_log(WLR_ERROR, "Could not parse session path: %s", strerror(-ret)); goto out; } @@ -170,7 +170,7 @@ static bool session_activate(struct logind_session *session) { session->path, "org.freedesktop.login1.Session", "Activate", &error, &msg, ""); if (ret < 0) { - wlr_log(L_ERROR, "Failed to activate session"); + wlr_log(WLR_ERROR, "Failed to activate session"); } sd_bus_error_free(&error); @@ -187,7 +187,7 @@ static bool take_control(struct logind_session *session) { session->path, "org.freedesktop.login1.Session", "TakeControl", &error, &msg, "b", false); if (ret < 0) { - wlr_log(L_ERROR, "Failed to take control of session"); + wlr_log(WLR_ERROR, "Failed to take control of session"); } sd_bus_error_free(&error); @@ -204,7 +204,7 @@ static void release_control(struct logind_session *session) { session->path, "org.freedesktop.login1.Session", "ReleaseControl", &error, &msg, ""); if (ret < 0) { - wlr_log(L_ERROR, "Failed to release control of session"); + wlr_log(WLR_ERROR, "Failed to release control of session"); } sd_bus_error_free(&error); @@ -224,7 +224,7 @@ static void logind_session_destroy(struct wlr_session *base) { } static int session_removed(sd_bus_message *msg, void *userdata, sd_bus_error *ret_error) { - wlr_log(L_INFO, "SessionRemoved signal received"); + wlr_log(WLR_INFO, "SessionRemoved signal received"); return 0; } @@ -237,7 +237,7 @@ static struct wlr_device *find_device(struct wlr_session *session, dev_t devnum) } } - wlr_log(L_ERROR, "Tried to use dev_t %lu not opened by session", + wlr_log(WLR_ERROR, "Tried to use dev_t %lu not opened by session", (unsigned long)devnum); assert(0); } @@ -250,7 +250,7 @@ static int pause_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_e const char *type; ret = sd_bus_message_read(msg, "uus", &major, &minor, &type); if (ret < 0) { - wlr_log(L_ERROR, "Failed to parse D-Bus response for PauseDevice: %s", + wlr_log(WLR_ERROR, "Failed to parse D-Bus response for PauseDevice: %s", strerror(-ret)); goto error; } @@ -265,7 +265,7 @@ static int pause_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_e session->path, "org.freedesktop.login1.Session", "PauseDeviceComplete", ret_error, &msg, "uu", major, minor); if (ret < 0) { - wlr_log(L_ERROR, "Failed to send PauseDeviceComplete signal: %s", + wlr_log(WLR_ERROR, "Failed to send PauseDeviceComplete signal: %s", strerror(-ret)); } } @@ -282,7 +282,7 @@ static int resume_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_ uint32_t major, minor; ret = sd_bus_message_read(msg, "uuh", &major, &minor, &fd); if (ret < 0) { - wlr_log(L_ERROR, "Failed to parse D-Bus response for ResumeDevice: %s", + wlr_log(WLR_ERROR, "Failed to parse D-Bus response for ResumeDevice: %s", strerror(-ret)); goto error; } @@ -314,21 +314,21 @@ static bool add_signal_matches(struct logind_session *session) { snprintf(str, sizeof(str), fmt, "Manager", "SessionRemoved", "/org/freedesktop/login1"); ret = sd_bus_add_match(session->bus, NULL, str, session_removed, session); if (ret < 0) { - wlr_log(L_ERROR, "Failed to add D-Bus match: %s", strerror(-ret)); + wlr_log(WLR_ERROR, "Failed to add D-Bus match: %s", strerror(-ret)); return false; } snprintf(str, sizeof(str), fmt, "Session", "PauseDevice", session->path); ret = sd_bus_add_match(session->bus, NULL, str, pause_device, session); if (ret < 0) { - wlr_log(L_ERROR, "Failed to add D-Bus match: %s", strerror(-ret)); + wlr_log(WLR_ERROR, "Failed to add D-Bus match: %s", strerror(-ret)); return false; } snprintf(str, sizeof(str), fmt, "Session", "ResumeDevice", session->path); ret = sd_bus_add_match(session->bus, NULL, str, resume_device, session); if (ret < 0) { - wlr_log(L_ERROR, "Failed to add D-Bus match: %s", strerror(-ret)); + wlr_log(WLR_ERROR, "Failed to add D-Bus match: %s", strerror(-ret)); return false; } @@ -347,20 +347,20 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) { int ret; struct logind_session *session = calloc(1, sizeof(*session)); if (!session) { - wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno)); + wlr_log(WLR_ERROR, "Allocation failed: %s", strerror(errno)); return NULL; } ret = sd_pid_get_session(getpid(), &session->id); if (ret < 0) { - wlr_log(L_ERROR, "Failed to get session id: %s", strerror(-ret)); + wlr_log(WLR_ERROR, "Failed to get session id: %s", strerror(-ret)); goto error; } char *seat; ret = sd_session_get_seat(session->id, &seat); if (ret < 0) { - wlr_log(L_ERROR, "Failed to get seat id: %s", strerror(-ret)); + wlr_log(WLR_ERROR, "Failed to get seat id: %s", strerror(-ret)); goto error; } snprintf(session->base.seat, sizeof(session->base.seat), "%s", seat); @@ -368,7 +368,7 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) { if (strcmp(seat, "seat0") == 0) { ret = sd_session_get_vt(session->id, &session->base.vtnr); if (ret < 0) { - wlr_log(L_ERROR, "Session not running in virtual terminal"); + wlr_log(WLR_ERROR, "Session not running in virtual terminal"); goto error; } } @@ -376,7 +376,7 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) { ret = sd_bus_default_system(&session->bus); if (ret < 0) { - wlr_log(L_ERROR, "Failed to open D-Bus connection: %s", strerror(-ret)); + wlr_log(WLR_ERROR, "Failed to open D-Bus connection: %s", strerror(-ret)); goto error; } @@ -401,7 +401,7 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) { goto error_bus; } - wlr_log(L_INFO, "Successfully loaded logind session"); + wlr_log(WLR_INFO, "Successfully loaded logind session"); session->base.impl = &session_logind; return &session->base; diff --git a/backend/session/session.c b/backend/session/session.c index 026040fd..8d74bafe 100644 --- a/backend/session/session.c +++ b/backend/session/session.c @@ -36,7 +36,7 @@ static int udev_event(int fd, uint32_t mask, void *data) { const char *action = udev_device_get_action(udev_dev); - wlr_log(L_DEBUG, "udev event for %s (%s)", + wlr_log(WLR_DEBUG, "udev event for %s (%s)", udev_device_get_sysname(udev_dev), action); if (!action || strcmp(action, "change") != 0) { @@ -73,7 +73,7 @@ struct wlr_session *wlr_session_create(struct wl_display *disp) { } if (!session) { - wlr_log(L_ERROR, "Failed to load session backend"); + wlr_log(WLR_ERROR, "Failed to load session backend"); return NULL; } @@ -83,13 +83,13 @@ struct wlr_session *wlr_session_create(struct wl_display *disp) { session->udev = udev_new(); if (!session->udev) { - wlr_log_errno(L_ERROR, "Failed to create udev context"); + wlr_log_errno(WLR_ERROR, "Failed to create udev context"); goto error_session; } session->mon = udev_monitor_new_from_netlink(session->udev, "udev"); if (!session->mon) { - wlr_log_errno(L_ERROR, "Failed to create udev monitor"); + wlr_log_errno(WLR_ERROR, "Failed to create udev monitor"); goto error_udev; } @@ -102,7 +102,7 @@ struct wlr_session *wlr_session_create(struct wl_display *disp) { session->udev_event = wl_event_loop_add_fd(event_loop, fd, WL_EVENT_READABLE, udev_event, session); if (!session->udev_event) { - wlr_log_errno(L_ERROR, "Failed to create udev event source"); + wlr_log_errno(WLR_ERROR, "Failed to create udev event source"); goto error_mon; } @@ -142,13 +142,13 @@ int wlr_session_open_file(struct wlr_session *session, const char *path) { struct wlr_device *dev = malloc(sizeof(*dev)); if (!dev) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); goto error; } struct stat st; if (fstat(fd, &st) < 0) { - wlr_log_errno(L_ERROR, "Stat failed"); + wlr_log_errno(WLR_ERROR, "Stat failed"); goto error; } @@ -173,7 +173,7 @@ static struct wlr_device *find_device(struct wlr_session *session, int fd) { } } - wlr_log(L_ERROR, "Tried to use fd %d not opened by session", fd); + wlr_log(WLR_ERROR, "Tried to use fd %d not opened by session", fd); assert(0); } @@ -240,7 +240,7 @@ static size_t explicit_find_gpus(struct wlr_session *session, size_t ret_len, int ret[static ret_len], const char *str) { char *gpus = strdup(str); if (!gpus) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); return 0; } @@ -254,7 +254,7 @@ static size_t explicit_find_gpus(struct wlr_session *session, ret[i] = open_if_kms(session, ptr); if (ret[i] < 0) { - wlr_log(L_ERROR, "Unable to open %s as DRM device", ptr); + wlr_log(WLR_ERROR, "Unable to open %s as DRM device", ptr); } else { ++i; } @@ -281,7 +281,7 @@ size_t wlr_session_find_gpus(struct wlr_session *session, struct udev_enumerate *en = udev_enumerate_new(session->udev); if (!en) { - wlr_log(L_ERROR, "Failed to create udev enumeration"); + wlr_log(WLR_ERROR, "Failed to create udev enumeration"); return -1; } diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c index 4f3fa2f3..506bcd5e 100644 --- a/backend/wayland/backend.c +++ b/backend/wayland/backend.c @@ -41,11 +41,11 @@ static int dispatch_events(int fd, uint32_t mask, void *data) { */ static bool backend_start(struct wlr_backend *_backend) { struct wlr_wl_backend *backend = (struct wlr_wl_backend *)_backend; - wlr_log(L_INFO, "Initializating wayland backend"); + wlr_log(WLR_INFO, "Initializating wayland backend"); poll_wl_registry(backend); if (!backend->compositor || !backend->shell) { - wlr_log_errno(L_ERROR, "Could not obtain retrieve required globals"); + wlr_log_errno(WLR_ERROR, "Could not obtain retrieve required globals"); return false; } @@ -140,11 +140,11 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) { struct wlr_backend *wlr_wl_backend_create(struct wl_display *display, const char *remote, wlr_renderer_create_func_t create_renderer_func) { - wlr_log(L_INFO, "Creating wayland backend"); + wlr_log(WLR_INFO, "Creating wayland backend"); struct wlr_wl_backend *backend = calloc(1, sizeof(struct wlr_wl_backend)); if (!backend) { - wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno)); + wlr_log(WLR_ERROR, "Allocation failed: %s", strerror(errno)); return NULL; } wlr_backend_init(&backend->backend, &backend_impl); @@ -156,13 +156,13 @@ struct wlr_backend *wlr_wl_backend_create(struct wl_display *display, backend->remote_display = wl_display_connect(remote); if (!backend->remote_display) { - wlr_log_errno(L_ERROR, "Could not connect to remote display"); + wlr_log_errno(WLR_ERROR, "Could not connect to remote display"); goto error_connect; } backend->registry = wl_display_get_registry(backend->remote_display); if (backend->registry == NULL) { - wlr_log_errno(L_ERROR, "Could not obtain reference to remote registry"); + wlr_log_errno(WLR_ERROR, "Could not obtain reference to remote registry"); goto error_registry; } @@ -183,7 +183,7 @@ struct wlr_backend *wlr_wl_backend_create(struct wl_display *display, backend->remote_display, config_attribs, WL_SHM_FORMAT_ARGB8888); if (backend->renderer == NULL) { - wlr_log(L_ERROR, "Could not create renderer"); + wlr_log(WLR_ERROR, "Could not create renderer"); goto error_renderer; } diff --git a/backend/wayland/output.c b/backend/wayland/output.c index 6aa59537..2fd35a3a 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -55,7 +55,7 @@ static bool output_swap_buffers(struct wlr_output *wlr_output, (struct wlr_wl_output *)wlr_output; if (output->frame_callback != NULL) { - wlr_log(L_ERROR, "Skipping buffer swap"); + wlr_log(WLR_ERROR, "Skipping buffer swap"); return false; } @@ -250,7 +250,7 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *_backend) { struct wlr_wl_output *output; if (!(output = calloc(sizeof(struct wlr_wl_output), 1))) { - wlr_log(L_ERROR, "Failed to allocate wlr_wl_output"); + wlr_log(WLR_ERROR, "Failed to allocate wlr_wl_output"); return NULL; } wlr_output_init(&output->wlr_output, &backend->backend, &output_impl, @@ -267,20 +267,20 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *_backend) { output->surface = wl_compositor_create_surface(backend->compositor); if (!output->surface) { - wlr_log_errno(L_ERROR, "Could not create output surface"); + wlr_log_errno(WLR_ERROR, "Could not create output surface"); goto error; } wl_surface_set_user_data(output->surface, output); output->xdg_surface = zxdg_shell_v6_get_xdg_surface(backend->shell, output->surface); if (!output->xdg_surface) { - wlr_log_errno(L_ERROR, "Could not get xdg surface"); + wlr_log_errno(WLR_ERROR, "Could not get xdg surface"); goto error; } output->xdg_toplevel = zxdg_surface_v6_get_toplevel(output->xdg_surface); if (!output->xdg_toplevel) { - wlr_log_errno(L_ERROR, "Could not get xdg toplevel"); + wlr_log_errno(WLR_ERROR, "Could not get xdg toplevel"); goto error; } diff --git a/backend/wayland/registry.c b/backend/wayland/registry.c index 0046df55..8b154750 100644 --- a/backend/wayland/registry.c +++ b/backend/wayland/registry.c @@ -19,7 +19,7 @@ static const struct zxdg_shell_v6_listener xdg_shell_listener = { static void registry_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct wlr_wl_backend *backend = data; - wlr_log(L_DEBUG, "Remote wayland global: %s v%d", interface, version); + wlr_log(WLR_DEBUG, "Remote wayland global: %s v%d", interface, version); if (strcmp(interface, wl_compositor_interface.name) == 0) { backend->compositor = wl_registry_bind(registry, name, diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c index d5001a51..5163e804 100644 --- a/backend/wayland/wl_seat.c +++ b/backend/wayland/wl_seat.c @@ -275,7 +275,7 @@ static struct wlr_wl_input_device *create_wl_input_device( struct wlr_wl_input_device *dev = calloc(1, sizeof(struct wlr_wl_input_device)); if (dev == NULL) { - wlr_log_errno(L_ERROR, "Allocation failed"); + wlr_log_errno(WLR_ERROR, "Allocation failed"); return NULL; } dev->backend = backend; @@ -331,7 +331,7 @@ void create_wl_pointer(struct wl_pointer *wl_pointer, struct wlr_wl_pointer *pointer = calloc(1, sizeof(struct wlr_wl_pointer)); if (pointer == NULL) { - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); return; } pointer->wl_pointer = wl_pointer; @@ -344,7 +344,7 @@ void create_wl_pointer(struct wl_pointer *wl_pointer, create_wl_input_device(backend, WLR_INPUT_DEVICE_POINTER); if (dev == NULL) { free(pointer); - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); return; } pointer->input_device = dev; @@ -363,7 +363,7 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, assert(backend->seat == wl_seat); if ((caps & WL_SEAT_CAPABILITY_POINTER)) { - wlr_log(L_DEBUG, "seat %p offered pointer", (void*) wl_seat); + wlr_log(WLR_DEBUG, "seat %p offered pointer", (void*) wl_seat); struct wl_pointer *wl_pointer = wl_seat_get_pointer(wl_seat); backend->pointer = wl_pointer; @@ -376,18 +376,18 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, wl_pointer_add_listener(wl_pointer, &pointer_listener, backend); } if ((caps & WL_SEAT_CAPABILITY_KEYBOARD)) { - wlr_log(L_DEBUG, "seat %p offered keyboard", (void*) wl_seat); + wlr_log(WLR_DEBUG, "seat %p offered keyboard", (void*) wl_seat); struct wlr_wl_input_device *dev = create_wl_input_device(backend, WLR_INPUT_DEVICE_KEYBOARD); if (dev == NULL) { - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); return; } struct wlr_input_device *wlr_dev = &dev->wlr_input_device; wlr_dev->keyboard = calloc(1, sizeof(struct wlr_keyboard)); if (!wlr_dev->keyboard) { free(dev); - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); return; } wlr_keyboard_init(wlr_dev->keyboard, NULL); diff --git a/backend/x11/backend.c b/backend/x11/backend.c index e35cbed7..cbe4833b 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -244,13 +244,13 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display, x11->xlib_conn = XOpenDisplay(x11_display); if (!x11->xlib_conn) { - wlr_log(L_ERROR, "Failed to open X connection"); + wlr_log(WLR_ERROR, "Failed to open X connection"); goto error_x11; } x11->xcb_conn = XGetXCBConnection(x11->xlib_conn); if (!x11->xcb_conn || xcb_connection_has_error(x11->xcb_conn)) { - wlr_log(L_ERROR, "Failed to open xcb connection"); + wlr_log(WLR_ERROR, "Failed to open xcb connection"); goto error_display; } @@ -261,7 +261,7 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display, int events = WL_EVENT_READABLE | WL_EVENT_ERROR | WL_EVENT_HANGUP; x11->event_source = wl_event_loop_add_fd(ev, fd, events, x11_event, x11); if (!x11->event_source) { - wlr_log(L_ERROR, "Could not create event source"); + wlr_log(WLR_ERROR, "Could not create event source"); goto error_display; } @@ -275,7 +275,7 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display, x11->xlib_conn, NULL, x11->screen->root_visual); if (x11->renderer == NULL) { - wlr_log(L_ERROR, "Failed to create renderer"); + wlr_log(WLR_ERROR, "Failed to create renderer"); goto error_event; } diff --git a/backend/x11/output.c b/backend/x11/output.c index c619d226..9f8918ab 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -134,7 +134,7 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) { output->surf = wlr_egl_create_surface(&x11->egl, &output->win); if (!output->surf) { - wlr_log(L_ERROR, "Failed to create EGL surface"); + wlr_log(WLR_ERROR, "Failed to create EGL surface"); free(output); return NULL; } diff --git a/examples/idle.c b/examples/idle.c index b65a81cf..30e106db 100644 --- a/examples/idle.c +++ b/examples/idle.c @@ -109,7 +109,7 @@ void *main_loop(void *data) { } int main(int argc, char *argv[]) { - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); if (parse_args(argc, argv) != 0) { return -1; diff --git a/examples/layer-shell.c b/examples/layer-shell.c index 21ef3e93..70ae21f0 100644 --- a/examples/layer-shell.c +++ b/examples/layer-shell.c @@ -179,7 +179,7 @@ static const struct xdg_surface_listener xdg_surface_listener = { static void xdg_popup_configure(void *data, struct xdg_popup *xdg_popup, int32_t x, int32_t y, int32_t width, int32_t height) { - wlr_log(L_DEBUG, "Popup configured %dx%d@%d,%d", + wlr_log(WLR_DEBUG, "Popup configured %dx%d@%d,%d", width, height, x, y); popup_width = width; popup_height = height; @@ -199,7 +199,7 @@ static void popup_destroy(void) { } static void xdg_popup_done(void *data, struct xdg_popup *xdg_popup) { - wlr_log(L_DEBUG, "Popup done"); + wlr_log(WLR_DEBUG, "Popup done"); popup_destroy(); } @@ -378,17 +378,17 @@ static void wl_keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard, static void wl_keyboard_enter(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { - wlr_log(L_DEBUG, "Keyboard enter"); + wlr_log(WLR_DEBUG, "Keyboard enter"); } static void wl_keyboard_leave(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, struct wl_surface *surface) { - wlr_log(L_DEBUG, "Keyboard leave"); + wlr_log(WLR_DEBUG, "Keyboard leave"); } static void wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) { - wlr_log(L_DEBUG, "Key event: %d %d", key, state); + wlr_log(WLR_DEBUG, "Key event: %d %d", key, state); } static void wl_keyboard_modifiers(void *data, struct wl_keyboard *wl_keyboard, @@ -474,7 +474,7 @@ static const struct wl_registry_listener registry_listener = { }; int main(int argc, char **argv) { - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); char *namespace = "wlroots"; int exclusive_zone = 0; int32_t margin_right = 0, margin_bottom = 0, margin_left = 0; diff --git a/examples/multi-pointer.c b/examples/multi-pointer.c index c5b2048f..58689649 100644 --- a/examples/multi-pointer.c +++ b/examples/multi-pointer.c @@ -73,7 +73,7 @@ struct sample_keyboard { void configure_cursor(struct wlr_cursor *cursor, struct wlr_input_device *device, struct sample_state *sample) { struct sample_output *output; - wlr_log(L_ERROR, "Configuring cursor %p for device %p", cursor, device); + wlr_log(WLR_ERROR, "Configuring cursor %p for device %p", cursor, device); // reset mappings wlr_cursor_map_to_output(cursor, NULL); @@ -237,7 +237,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { rules.options = getenv("XKB_DEFAULT_OPTIONS"); struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!context) { - wlr_log(L_ERROR, "Failed to create XKB context"); + wlr_log(WLR_ERROR, "Failed to create XKB context"); exit(1); } wlr_keyboard_set_keymap(device->keyboard, xkb_map_new_from_names(context, @@ -277,7 +277,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { } int main(int argc, char *argv[]) { - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); struct wl_display *display = wl_display_create(); struct sample_state state = { .default_color = { 0.25f, 0.25f, 0.25f, 1 }, @@ -303,17 +303,17 @@ int main(int argc, char *argv[]) { struct wlr_xcursor_theme *theme = wlr_xcursor_theme_load("default", 16); if (!theme) { - wlr_log(L_ERROR, "Failed to load cursor theme"); + wlr_log(WLR_ERROR, "Failed to load cursor theme"); return 1; } state.xcursor = wlr_xcursor_theme_get_cursor(theme, "left_ptr"); if (!state.xcursor) { - wlr_log(L_ERROR, "Failed to load left_ptr cursor"); + wlr_log(WLR_ERROR, "Failed to load left_ptr cursor"); return 1; } if (!wlr_backend_start(wlr)) { - wlr_log(L_ERROR, "Failed to start backend"); + wlr_log(WLR_ERROR, "Failed to start backend"); wlr_backend_destroy(wlr); exit(1); } diff --git a/examples/output-layout.c b/examples/output-layout.c index bdc8d352..2bfc5923 100644 --- a/examples/output-layout.c +++ b/examples/output-layout.c @@ -236,7 +236,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { rules.options = getenv("XKB_DEFAULT_OPTIONS"); struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!context) { - wlr_log(L_ERROR, "Failed to create XKB context"); + wlr_log(WLR_ERROR, "Failed to create XKB context"); exit(1); } wlr_keyboard_set_keymap(device->keyboard, xkb_map_new_from_names(context, @@ -250,7 +250,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { int main(int argc, char *argv[]) { - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); struct wl_display *display = wl_display_create(); struct sample_state state = { .x_vel = 500, @@ -277,7 +277,7 @@ int main(int argc, char *argv[]) { cat_tex.pixel_data); if (!wlr_backend_start(wlr)) { - wlr_log(L_ERROR, "Failed to start backend"); + wlr_log(WLR_ERROR, "Failed to start backend"); wlr_backend_destroy(wlr); exit(1); } diff --git a/examples/pointer.c b/examples/pointer.c index d6b4ed1c..e0f009b3 100644 --- a/examples/pointer.c +++ b/examples/pointer.c @@ -208,7 +208,7 @@ static void handle_touch_motion(struct wl_listener *listener, void *data) { } static void handle_touch_cancel(struct wl_listener *listener, void *data) { - wlr_log(L_DEBUG, "TODO: touch cancel"); + wlr_log(WLR_DEBUG, "TODO: touch cancel"); } static void handle_tablet_tool_axis(struct wl_listener *listener, void *data) { @@ -302,7 +302,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { rules.options = getenv("XKB_DEFAULT_OPTIONS"); struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!context) { - wlr_log(L_ERROR, "Failed to create XKB context"); + wlr_log(WLR_ERROR, "Failed to create XKB context"); exit(1); } wlr_keyboard_set_keymap(device->keyboard, xkb_map_new_from_names(context, @@ -316,7 +316,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { int main(int argc, char *argv[]) { - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); struct wl_display *display = wl_display_create(); struct sample_state state = { .default_color = { 0.25f, 0.25f, 0.25f, 1 }, @@ -375,7 +375,7 @@ int main(int argc, char *argv[]) { state.xcursor_manager = wlr_xcursor_manager_create("default", 24); if (!state.xcursor_manager) { - wlr_log(L_ERROR, "Failed to load left_ptr cursor"); + wlr_log(WLR_ERROR, "Failed to load left_ptr cursor"); return 1; } @@ -385,7 +385,7 @@ int main(int argc, char *argv[]) { clock_gettime(CLOCK_MONOTONIC, &state.last_frame); if (!wlr_backend_start(wlr)) { - wlr_log(L_ERROR, "Failed to start backend"); + wlr_log(WLR_ERROR, "Failed to start backend"); wlr_backend_destroy(wlr); exit(1); } diff --git a/examples/rotation.c b/examples/rotation.c index 9e9e059a..2d2fb179 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -186,7 +186,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { rules.options = getenv("XKB_DEFAULT_OPTIONS"); struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!context) { - wlr_log(L_ERROR, "Failed to create XKB context"); + wlr_log(WLR_ERROR, "Failed to create XKB context"); exit(1); } wlr_keyboard_set_keymap(device->keyboard, xkb_map_new_from_names(context, @@ -220,14 +220,14 @@ int main(int argc, char *argv[]) { } else if (strcmp(optarg, "flipped-270") == 0) { transform = WL_OUTPUT_TRANSFORM_FLIPPED_270; } else { - wlr_log(L_ERROR, "got unknown transform value: %s", optarg); + wlr_log(WLR_ERROR, "got unknown transform value: %s", optarg); } break; default: break; } } - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); struct wl_display *display = wl_display_create(); struct sample_state state = { .display = display, @@ -248,7 +248,7 @@ int main(int argc, char *argv[]) { state.renderer = wlr_backend_get_renderer(wlr); if (!state.renderer) { - wlr_log(L_ERROR, "Could not start compositor, OOM"); + wlr_log(WLR_ERROR, "Could not start compositor, OOM"); wlr_backend_destroy(wlr); exit(EXIT_FAILURE); } @@ -256,12 +256,12 @@ int main(int argc, char *argv[]) { WL_SHM_FORMAT_ABGR8888, cat_tex.width * 4, cat_tex.width, cat_tex.height, cat_tex.pixel_data); if (!state.cat_texture) { - wlr_log(L_ERROR, "Could not start compositor, OOM"); + wlr_log(WLR_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); } if (!wlr_backend_start(wlr)) { - wlr_log(L_ERROR, "Failed to start backend"); + wlr_log(WLR_ERROR, "Failed to start backend"); wlr_backend_destroy(wlr); exit(1); } diff --git a/examples/screenshot.c b/examples/screenshot.c index fb37f32c..aa4dcaa0 100644 --- a/examples/screenshot.c +++ b/examples/screenshot.c @@ -200,7 +200,7 @@ static void write_image(const char *filename, int width, int height, } int main(int argc, char *argv[]) { - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); struct wl_display * display = wl_display_connect(NULL); if (display == NULL) { diff --git a/examples/simple.c b/examples/simple.c index cbe60c98..f161dc22 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -37,7 +37,7 @@ struct sample_keyboard { }; void output_frame_notify(struct wl_listener *listener, void *data) { - wlr_log(L_DEBUG, "Output removed"); + wlr_log(WLR_DEBUG, "Output removed"); struct sample_output *sample_output = wl_container_of(listener, sample_output, frame); struct sample_state *sample = sample_output->sample; struct timespec now; @@ -131,7 +131,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { rules.options = getenv("XKB_DEFAULT_OPTIONS"); struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!context) { - wlr_log(L_ERROR, "Failed to create XKB context"); + wlr_log(WLR_ERROR, "Failed to create XKB context"); exit(1); } wlr_keyboard_set_keymap(device->keyboard, xkb_map_new_from_names(context, @@ -144,7 +144,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { } int main(void) { - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); struct wl_display *display = wl_display_create(); struct sample_state state = { .color = { 1.0, 0.0, 0.0 }, @@ -163,7 +163,7 @@ int main(void) { clock_gettime(CLOCK_MONOTONIC, &state.last_frame); if (!wlr_backend_start(wlr)) { - wlr_log(L_ERROR, "Failed to start backend"); + wlr_log(WLR_ERROR, "Failed to start backend"); wlr_backend_destroy(wlr); exit(1); } diff --git a/examples/tablet.c b/examples/tablet.c index e734ca84..7332afe0 100644 --- a/examples/tablet.c +++ b/examples/tablet.c @@ -295,7 +295,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { rules.options = getenv("XKB_DEFAULT_OPTIONS"); struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!context) { - wlr_log(L_ERROR, "Failed to create XKB context"); + wlr_log(WLR_ERROR, "Failed to create XKB context"); exit(1); } wlr_keyboard_set_keymap(device->keyboard, xkb_map_new_from_names(context, @@ -340,7 +340,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { int main(int argc, char *argv[]) { - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); struct wl_display *display = wl_display_create(); struct sample_state state = { .display = display, @@ -362,11 +362,11 @@ int main(int argc, char *argv[]) { state.renderer = wlr_backend_get_renderer(wlr); if (!state.renderer) { - wlr_log(L_ERROR, "Could not start compositor, OOM"); + wlr_log(WLR_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); } if (!wlr_backend_start(wlr)) { - wlr_log(L_ERROR, "Failed to start backend"); + wlr_log(WLR_ERROR, "Failed to start backend"); wlr_backend_destroy(wlr); exit(1); } diff --git a/examples/touch.c b/examples/touch.c index 0e77b48e..9954cdbd 100644 --- a/examples/touch.c +++ b/examples/touch.c @@ -208,7 +208,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { rules.options = getenv("XKB_DEFAULT_OPTIONS"); struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!context) { - wlr_log(L_ERROR, "Failed to create XKB context"); + wlr_log(WLR_ERROR, "Failed to create XKB context"); exit(1); } wlr_keyboard_set_keymap(device->keyboard, xkb_map_new_from_names(context, @@ -236,7 +236,7 @@ void new_input_notify(struct wl_listener *listener, void *data) { int main(int argc, char *argv[]) { - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); struct wl_display *display = wl_display_create(); struct sample_state state = { .display = display @@ -258,19 +258,19 @@ int main(int argc, char *argv[]) { state.renderer = wlr_backend_get_renderer(wlr); if (!state.renderer) { - wlr_log(L_ERROR, "Could not start compositor, OOM"); + wlr_log(WLR_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); } state.cat_texture = wlr_texture_from_pixels(state.renderer, WL_SHM_FORMAT_ARGB8888, cat_tex.width * 4, cat_tex.width, cat_tex.height, cat_tex.pixel_data); if (!state.cat_texture) { - wlr_log(L_ERROR, "Could not start compositor, OOM"); + wlr_log(WLR_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); } if (!wlr_backend_start(wlr)) { - wlr_log(L_ERROR, "Failed to start backend"); + wlr_log(WLR_ERROR, "Failed to start backend"); wlr_backend_destroy(wlr); exit(1); } diff --git a/glgen.sh b/glgen.sh index 5cb23225..0356cf98 100755 --- a/glgen.sh +++ b/glgen.sh @@ -26,7 +26,7 @@ DECL_FMT='extern %s %s;' DEFN_FMT='%s %s;' LOADER_FMT='%s = (%s)eglGetProcAddress("%s");' CHECK_FMT='if (!%s) { - wlr_log(L_ERROR, "Unable to load %s"); + wlr_log(WLR_ERROR, "Unable to load %s"); return false; }' diff --git a/include/render/gles2.h b/include/render/gles2.h index 67d4e9f5..8b036f80 100644 --- a/include/render/gles2.h +++ b/include/render/gles2.h @@ -93,7 +93,7 @@ struct wlr_gles2_texture *get_gles2_texture_in_context( void push_gles2_marker(const char *file, const char *func); void pop_gles2_marker(void); -#define PUSH_GLES2_DEBUG push_gles2_marker(wlr_strip_path(__FILE__), __func__) +#define PUSH_GLES2_DEBUG push_gles2_marker(_wlr_strip_path(__FILE__), __func__) #define POP_GLES2_DEBUG pop_gles2_marker() #endif diff --git a/include/wlr/util/log.h b/include/wlr/util/log.h index 5528664b..098a020d 100644 --- a/include/wlr/util/log.h +++ b/include/wlr/util/log.h @@ -6,35 +6,36 @@ #include #include -typedef enum { - L_SILENT = 0, - L_ERROR = 1, - L_INFO = 2, - L_DEBUG = 3, - L_LAST, -} log_importance_t; +enum wlr_log_importance { + WLR_SILENT = 0, + WLR_ERROR = 1, + WLR_INFO = 2, + WLR_DEBUG = 3, + WLR_LOG_IMPORTANCE_LAST, +}; -typedef void (*log_callback_t)(log_importance_t importance, const char *fmt, va_list args); +typedef void (*wlr_log_func_t)(enum wlr_log_importance importance, + const char *fmt, va_list args); // Will log all messages less than or equal to `verbosity` // If `callback` is NULL, wlr will use its default logger. -void wlr_log_init(log_importance_t verbosity, log_callback_t callback); +void wlr_log_init(enum wlr_log_importance verbosity, wlr_log_func_t callback); #ifdef __GNUC__ -#define ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end))) +#define _WLR_ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end))) #else -#define ATTRIB_PRINTF(start, end) +#define _WLR_ATTRIB_PRINTF(start, end) #endif -void _wlr_log(log_importance_t verbosity, const char *format, ...) ATTRIB_PRINTF(2, 3); -void _wlr_vlog(log_importance_t verbosity, const char *format, va_list args) ATTRIB_PRINTF(2, 0); -const char *wlr_strip_path(const char *filepath); +void _wlr_log(enum wlr_log_importance verbosity, const char *format, ...) _WLR_ATTRIB_PRINTF(2, 3); +void _wlr_vlog(enum wlr_log_importance verbosity, const char *format, va_list args) _WLR_ATTRIB_PRINTF(2, 0); +const char *_wlr_strip_path(const char *filepath); #define wlr_log(verb, fmt, ...) \ - _wlr_log(verb, "[%s:%d] " fmt, wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) + _wlr_log(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) #define wlr_vlog(verb, fmt, args) \ - _wlr_vlog(verb, "[%s:%d] " fmt, wlr_strip_path(__FILE__), __LINE__, args) + _wlr_vlog(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, args) #define wlr_log_errno(verb, fmt, ...) \ wlr_log(verb, fmt ": %s", ##__VA_ARGS__, strerror(errno)) diff --git a/render/egl.c b/render/egl.c index 7f910e86..96e48c06 100644 --- a/render/egl.c +++ b/render/egl.c @@ -13,7 +13,7 @@ static bool egl_get_config(EGLDisplay disp, EGLint *attribs, EGLConfig *out, ret = eglGetConfigs(disp, NULL, 0, &count); if (ret == EGL_FALSE || count == 0) { - wlr_log(L_ERROR, "eglGetConfigs returned no configs"); + wlr_log(WLR_ERROR, "eglGetConfigs returned no configs"); return false; } @@ -21,7 +21,7 @@ static bool egl_get_config(EGLDisplay disp, EGLint *attribs, EGLConfig *out, ret = eglChooseConfig(disp, attribs, configs, count, &matched); if (ret == EGL_FALSE) { - wlr_log(L_ERROR, "eglChooseConfig failed"); + wlr_log(WLR_ERROR, "eglChooseConfig failed"); return false; } @@ -38,17 +38,17 @@ static bool egl_get_config(EGLDisplay disp, EGLint *attribs, EGLConfig *out, } } - wlr_log(L_ERROR, "no valid egl config found"); + wlr_log(WLR_ERROR, "no valid egl config found"); return false; } -static log_importance_t egl_log_importance_to_wlr(EGLint type) { +static enum wlr_log_importance egl_log_importance_to_wlr(EGLint type) { switch (type) { - case EGL_DEBUG_MSG_CRITICAL_KHR: return L_ERROR; - case EGL_DEBUG_MSG_ERROR_KHR: return L_ERROR; - case EGL_DEBUG_MSG_WARN_KHR: return L_ERROR; - case EGL_DEBUG_MSG_INFO_KHR: return L_INFO; - default: return L_INFO; + case EGL_DEBUG_MSG_CRITICAL_KHR: return WLR_ERROR; + case EGL_DEBUG_MSG_ERROR_KHR: return WLR_ERROR; + case EGL_DEBUG_MSG_WARN_KHR: return WLR_ERROR; + case EGL_DEBUG_MSG_INFO_KHR: return WLR_INFO; + default: return WLR_INFO; } } @@ -92,7 +92,7 @@ static void print_dmabuf_formats(struct wlr_egl *egl) { snprintf(&str_formats[i*5], (num - i) * 5 + 1, "%.4s ", (char*)&formats[i]); } - wlr_log(L_DEBUG, "Supported dmabuf buffer formats: %s", str_formats); + wlr_log(WLR_DEBUG, "Supported dmabuf buffer formats: %s", str_formats); free(formats); } @@ -114,7 +114,7 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display, } if (eglBindAPI(EGL_OPENGL_ES_API) == EGL_FALSE) { - wlr_log(L_ERROR, "Failed to bind to the OpenGL ES API"); + wlr_log(WLR_ERROR, "Failed to bind to the OpenGL ES API"); goto error; } @@ -125,26 +125,26 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display, egl->display = eglGetPlatformDisplayEXT(platform, remote_display, NULL); } if (egl->display == EGL_NO_DISPLAY) { - wlr_log(L_ERROR, "Failed to create EGL display"); + wlr_log(WLR_ERROR, "Failed to create EGL display"); goto error; } EGLint major, minor; if (eglInitialize(egl->display, &major, &minor) == EGL_FALSE) { - wlr_log(L_ERROR, "Failed to initialize EGL"); + wlr_log(WLR_ERROR, "Failed to initialize EGL"); goto error; } if (!egl_get_config(egl->display, config_attribs, &egl->config, visual_id)) { - wlr_log(L_ERROR, "Failed to get EGL config"); + wlr_log(WLR_ERROR, "Failed to get EGL config"); goto error; } egl->exts_str = eglQueryString(egl->display, EGL_EXTENSIONS); - wlr_log(L_INFO, "Using EGL %d.%d", (int)major, (int)minor); - wlr_log(L_INFO, "Supported EGL extensions: %s", egl->exts_str); - wlr_log(L_INFO, "EGL vendor: %s", eglQueryString(egl->display, EGL_VENDOR)); + wlr_log(WLR_INFO, "Using EGL %d.%d", (int)major, (int)minor); + wlr_log(WLR_INFO, "Supported EGL extensions: %s", egl->exts_str); + wlr_log(WLR_INFO, "EGL vendor: %s", eglQueryString(egl->display, EGL_VENDOR)); egl->exts.image_base_khr = check_egl_ext(egl->exts_str, "EGL_KHR_image_base") @@ -201,7 +201,7 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display, egl->context = eglCreateContext(egl->display, egl->config, EGL_NO_CONTEXT, attribs); if (egl->context == EGL_NO_CONTEXT) { - wlr_log(L_ERROR, "Failed to create EGL context"); + wlr_log(WLR_ERROR, "Failed to create EGL context"); goto error; } @@ -210,15 +210,15 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display, eglQueryContext(egl->display, egl->context, EGL_CONTEXT_PRIORITY_LEVEL_IMG, &priority); if (priority != EGL_CONTEXT_PRIORITY_HIGH_IMG) { - wlr_log(L_INFO, "Failed to obtain a high priority context"); + wlr_log(WLR_INFO, "Failed to obtain a high priority context"); } else { - wlr_log(L_DEBUG, "Obtained high priority context"); + wlr_log(WLR_DEBUG, "Obtained high priority context"); } } if (!eglMakeCurrent(egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, egl->context)) { - wlr_log(L_ERROR, "Failed to make EGL context current"); + wlr_log(WLR_ERROR, "Failed to make EGL context current"); goto error; } @@ -277,7 +277,7 @@ EGLSurface wlr_egl_create_surface(struct wlr_egl *egl, void *window) { EGLSurface surf = eglCreatePlatformWindowSurfaceEXT(egl->display, egl->config, window, NULL); if (surf == EGL_NO_SURFACE) { - wlr_log(L_ERROR, "Failed to create EGL surface"); + wlr_log(WLR_ERROR, "Failed to create EGL surface"); return EGL_NO_SURFACE; } return surf; @@ -292,7 +292,7 @@ static int egl_get_buffer_age(struct wlr_egl *egl, EGLSurface surface) { EGLBoolean ok = eglQuerySurface(egl->display, surface, EGL_BUFFER_AGE_EXT, &buffer_age); if (!ok) { - wlr_log(L_ERROR, "Failed to get EGL surface buffer age"); + wlr_log(WLR_ERROR, "Failed to get EGL surface buffer age"); return -1; } @@ -302,7 +302,7 @@ static int egl_get_buffer_age(struct wlr_egl *egl, EGLSurface surface) { bool wlr_egl_make_current(struct wlr_egl *egl, EGLSurface surface, int *buffer_age) { if (!eglMakeCurrent(egl->display, surface, surface, egl->context)) { - wlr_log(L_ERROR, "eglMakeCurrent failed"); + wlr_log(WLR_ERROR, "eglMakeCurrent failed"); return false; } @@ -344,7 +344,7 @@ bool wlr_egl_swap_buffers(struct wlr_egl *egl, EGLSurface surface, } if (!ret) { - wlr_log(L_ERROR, "eglSwapBuffers failed"); + wlr_log(WLR_ERROR, "eglSwapBuffers failed"); return false; } return true; @@ -462,24 +462,24 @@ int wlr_egl_get_dmabuf_formats(struct wlr_egl *egl, int **formats) { if (!egl->exts.image_dmabuf_import_ext || !egl->exts.image_dmabuf_import_modifiers_ext) { - wlr_log(L_DEBUG, "dmabuf extension not present"); + wlr_log(WLR_DEBUG, "dmabuf extension not present"); return -1; } EGLint num; if (!eglQueryDmaBufFormatsEXT(egl->display, 0, NULL, &num)) { - wlr_log(L_ERROR, "failed to query number of dmabuf formats"); + wlr_log(WLR_ERROR, "failed to query number of dmabuf formats"); return -1; } *formats = calloc(num, sizeof(int)); if (*formats == NULL) { - wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno)); + wlr_log(WLR_ERROR, "Allocation failed: %s", strerror(errno)); return -1; } if (!eglQueryDmaBufFormatsEXT(egl->display, num, *formats, &num)) { - wlr_log(L_ERROR, "failed to query dmabuf format"); + wlr_log(WLR_ERROR, "failed to query dmabuf format"); free(*formats); return -1; } @@ -490,26 +490,26 @@ int wlr_egl_get_dmabuf_modifiers(struct wlr_egl *egl, int format, uint64_t **modifiers) { if (!egl->exts.image_dmabuf_import_ext || !egl->exts.image_dmabuf_import_modifiers_ext) { - wlr_log(L_DEBUG, "dmabuf extension not present"); + wlr_log(WLR_DEBUG, "dmabuf extension not present"); return -1; } EGLint num; if (!eglQueryDmaBufModifiersEXT(egl->display, format, 0, NULL, NULL, &num)) { - wlr_log(L_ERROR, "failed to query dmabuf number of modifiers"); + wlr_log(WLR_ERROR, "failed to query dmabuf number of modifiers"); return -1; } *modifiers = calloc(num, sizeof(uint64_t)); if (*modifiers == NULL) { - wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno)); + wlr_log(WLR_ERROR, "Allocation failed: %s", strerror(errno)); return -1; } if (!eglQueryDmaBufModifiersEXT(egl->display, format, num, *modifiers, NULL, &num)) { - wlr_log(L_ERROR, "failed to query dmabuf modifiers"); + wlr_log(WLR_ERROR, "failed to query dmabuf modifiers"); free(*modifiers); return -1; } @@ -531,7 +531,7 @@ bool wlr_egl_export_image_to_dmabuf(struct wlr_egl *egl, EGLImageKHR image, return false; } if (attribs->n_planes > WLR_DMABUF_MAX_PLANES) { - wlr_log(L_ERROR, "EGL returned %d planes, but only %d are supported", + wlr_log(WLR_ERROR, "EGL returned %d planes, but only %d are supported", attribs->n_planes, WLR_DMABUF_MAX_PLANES); return false; } diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index 5233ed1b..27c16e52 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -258,7 +258,7 @@ static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer, const struct wlr_gles2_pixel_format *fmt = get_gles2_format_from_wl(wl_fmt); if (fmt == NULL) { - wlr_log(L_ERROR, "Cannot read pixels: unsupported pixel format"); + wlr_log(WLR_ERROR, "Cannot read pixels: unsupported pixel format"); return false; } @@ -325,7 +325,7 @@ static void gles2_init_wl_display(struct wlr_renderer *wlr_renderer, struct wlr_gles2_renderer *renderer = gles2_get_renderer_in_context(wlr_renderer); if (!wlr_egl_bind_display(renderer->egl, wl_display)) { - wlr_log(L_INFO, "failed to bind wl_display to EGL"); + wlr_log(WLR_INFO, "failed to bind wl_display to EGL"); } } @@ -389,18 +389,18 @@ void pop_gles2_marker(void) { } } -static log_importance_t gles2_log_importance_to_wlr(GLenum type) { +static enum wlr_log_importance gles2_log_importance_to_wlr(GLenum type) { switch (type) { - case GL_DEBUG_TYPE_ERROR_KHR: return L_ERROR; - case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR: return L_DEBUG; - case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR: return L_ERROR; - case GL_DEBUG_TYPE_PORTABILITY_KHR: return L_DEBUG; - case GL_DEBUG_TYPE_PERFORMANCE_KHR: return L_DEBUG; - case GL_DEBUG_TYPE_OTHER_KHR: return L_DEBUG; - case GL_DEBUG_TYPE_MARKER_KHR: return L_DEBUG; - case GL_DEBUG_TYPE_PUSH_GROUP_KHR: return L_DEBUG; - case GL_DEBUG_TYPE_POP_GROUP_KHR: return L_DEBUG; - default: return L_DEBUG; + case GL_DEBUG_TYPE_ERROR_KHR: return WLR_ERROR; + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR: return WLR_DEBUG; + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR: return WLR_ERROR; + case GL_DEBUG_TYPE_PORTABILITY_KHR: return WLR_DEBUG; + case GL_DEBUG_TYPE_PERFORMANCE_KHR: return WLR_DEBUG; + case GL_DEBUG_TYPE_OTHER_KHR: return WLR_DEBUG; + case GL_DEBUG_TYPE_MARKER_KHR: return WLR_DEBUG; + case GL_DEBUG_TYPE_PUSH_GROUP_KHR: return WLR_DEBUG; + case GL_DEBUG_TYPE_POP_GROUP_KHR: return WLR_DEBUG; + default: return WLR_DEBUG; } } @@ -490,9 +490,9 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) { wlr_egl_make_current(renderer->egl, EGL_NO_SURFACE, NULL); renderer->exts_str = (const char*) glGetString(GL_EXTENSIONS); - wlr_log(L_INFO, "Using %s", glGetString(GL_VERSION)); - wlr_log(L_INFO, "GL vendor: %s", glGetString(GL_VENDOR)); - wlr_log(L_INFO, "Supported GLES2 extensions: %s", renderer->exts_str); + wlr_log(WLR_INFO, "Using %s", glGetString(GL_VERSION)); + wlr_log(WLR_INFO, "GL vendor: %s", glGetString(GL_VENDOR)); + wlr_log(WLR_INFO, "Supported GLES2 extensions: %s", renderer->exts_str); if (glDebugMessageCallbackKHR && glDebugMessageControlKHR) { glEnable(GL_DEBUG_OUTPUT_KHR); diff --git a/render/gles2/texture.c b/render/gles2/texture.c index 0ef9d759..3c70a235 100644 --- a/render/gles2/texture.c +++ b/render/gles2/texture.c @@ -44,13 +44,13 @@ static bool gles2_texture_write_pixels(struct wlr_texture *wlr_texture, get_gles2_texture_in_context(wlr_texture); if (texture->type != WLR_GLES2_TEXTURE_GLTEX) { - wlr_log(L_ERROR, "Cannot write pixels to immutable texture"); + wlr_log(WLR_ERROR, "Cannot write pixels to immutable texture"); return false; } const struct wlr_gles2_pixel_format *fmt = get_gles2_format_from_wl(wl_fmt); if (fmt == NULL) { - wlr_log(L_ERROR, "Unsupported pixel format %"PRIu32, wl_fmt); + wlr_log(WLR_ERROR, "Unsupported pixel format %"PRIu32, wl_fmt); return false; } @@ -141,14 +141,14 @@ struct wlr_texture *wlr_gles2_texture_from_pixels(struct wlr_egl *egl, const struct wlr_gles2_pixel_format *fmt = get_gles2_format_from_wl(wl_fmt); if (fmt == NULL) { - wlr_log(L_ERROR, "Unsupported pixel format %"PRIu32, wl_fmt); + wlr_log(WLR_ERROR, "Unsupported pixel format %"PRIu32, wl_fmt); return NULL; } struct wlr_gles2_texture *texture = calloc(1, sizeof(struct wlr_gles2_texture)); if (texture == NULL) { - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); return NULL; } wlr_texture_init(&texture->wlr_texture, &texture_impl); @@ -183,7 +183,7 @@ struct wlr_texture *wlr_gles2_texture_from_wl_drm(struct wlr_egl *egl, struct wlr_gles2_texture *texture = calloc(1, sizeof(struct wlr_gles2_texture)); if (texture == NULL) { - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); return NULL; } wlr_texture_init(&texture->wlr_texture, &texture_impl); @@ -212,7 +212,7 @@ struct wlr_texture *wlr_gles2_texture_from_wl_drm(struct wlr_egl *egl, texture->has_alpha = true; break; default: - wlr_log(L_ERROR, "Invalid or unsupported EGL buffer format"); + wlr_log(WLR_ERROR, "Invalid or unsupported EGL buffer format"); free(texture); return NULL; } @@ -240,7 +240,7 @@ struct wlr_texture *wlr_gles2_texture_from_dmabuf(struct wlr_egl *egl, } if (!egl->exts.image_dmabuf_import_ext) { - wlr_log(L_ERROR, "Cannot create DMA-BUF texture: EGL extension " + wlr_log(WLR_ERROR, "Cannot create DMA-BUF texture: EGL extension " "unavailable"); return NULL; } @@ -260,7 +260,7 @@ struct wlr_texture *wlr_gles2_texture_from_dmabuf(struct wlr_egl *egl, struct wlr_gles2_texture *texture = calloc(1, sizeof(struct wlr_gles2_texture)); if (texture == NULL) { - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); return NULL; } wlr_texture_init(&texture->wlr_texture, &texture_impl); diff --git a/render/gles2/util.c b/render/gles2/util.c index c291f533..3ac777ee 100644 --- a/render/gles2/util.c +++ b/render/gles2/util.c @@ -28,10 +28,10 @@ bool _gles2_flush_errors(const char *file, int line) { failure = true; if (err == GL_OUT_OF_MEMORY) { // The OpenGL context is now undefined - _wlr_log(L_ERROR, "[%s:%d] Fatal GL error: out of memory", file, line); + _wlr_log(WLR_ERROR, "[%s:%d] Fatal GL error: out of memory", file, line); exit(1); } else { - _wlr_log(L_ERROR, "[%s:%d] GL error %d %s", file, line, err, gles2_strerror(err)); + _wlr_log(WLR_ERROR, "[%s:%d] GL error %d %s", file, line, err, gles2_strerror(err)); } } return failure; diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index d66edc13..6c2b9fbb 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -157,14 +157,14 @@ bool wlr_renderer_format_supported(struct wlr_renderer *r, void wlr_renderer_init_wl_display(struct wlr_renderer *r, struct wl_display *wl_display) { if (wl_display_init_shm(wl_display)) { - wlr_log(L_ERROR, "Failed to initialize shm"); + wlr_log(WLR_ERROR, "Failed to initialize shm"); return; } size_t len; const enum wl_shm_format *formats = wlr_renderer_get_formats(r, &len); if (formats == NULL) { - wlr_log(L_ERROR, "Failed to initialize shm: cannot get formats"); + wlr_log(WLR_ERROR, "Failed to initialize shm: cannot get formats"); return; } @@ -185,7 +185,7 @@ struct wlr_renderer *wlr_renderer_autocreate(struct wlr_egl *egl, EGLenum platform, void *remote_display, EGLint *config_attribs, EGLint visual_id) { if (!wlr_egl_init(egl, platform, remote_display, config_attribs, visual_id)) { - wlr_log(L_ERROR, "Could not initialize EGL"); + wlr_log(WLR_ERROR, "Could not initialize EGL"); return NULL; } diff --git a/rootston/config.c b/rootston/config.c index 7ef5e629..0c0ad055 100644 --- a/rootston/config.c +++ b/rootston/config.c @@ -35,7 +35,7 @@ static void usage(const char *name, int ret) { static struct wlr_box *parse_geometry(const char *str) { // format: {width}x{height}+{x}+{y} if (strlen(str) > 255) { - wlr_log(L_ERROR, "cannot parse geometry string, too long"); + wlr_log(WLR_ERROR, "cannot parse geometry string, too long"); return NULL; } @@ -88,7 +88,7 @@ static struct wlr_box *parse_geometry(const char *str) { return box; invalid_input: - wlr_log(L_ERROR, "could not parse geometry string: %s", str); + wlr_log(WLR_ERROR, "could not parse geometry string: %s", str); free(buf); free(box); return NULL; @@ -177,7 +177,7 @@ void add_binding_config(struct wl_list *bindings, const char* combination, xkb_keysym_t sym = xkb_keysym_from_name(symname, XKB_KEYSYM_NO_FLAGS); if (sym == XKB_KEY_NoSymbol) { - wlr_log(L_ERROR, "got unknown key binding symbol: %s", + wlr_log(WLR_ERROR, "got unknown key binding symbol: %s", symname); free(bc); bc = NULL; @@ -228,7 +228,7 @@ static void config_handle_cursor(struct roots_config *config, free(cc->default_image); cc->default_image = strdup(value); } else { - wlr_log(L_ERROR, "got unknown cursor config: %s", name); + wlr_log(WLR_ERROR, "got unknown cursor config: %s", name); } } @@ -252,7 +252,7 @@ static void config_handle_keyboard(struct roots_config *config, if (strcmp(name, "meta-key") == 0) { kc->meta_key = parse_modifier(value); if (kc->meta_key == 0) { - wlr_log(L_ERROR, "got unknown meta key: %s", name); + wlr_log(WLR_ERROR, "got unknown meta key: %s", name); } } else if (strcmp(name, "rules") == 0) { kc->rules = strdup(value); @@ -269,7 +269,7 @@ static void config_handle_keyboard(struct roots_config *config, } else if (strcmp(name, "repeat-delay") == 0) { kc->repeat_delay = strtol(value, NULL, 10); } else { - wlr_log(L_ERROR, "got unknown keyboard config: %s", name); + wlr_log(WLR_ERROR, "got unknown keyboard config: %s", name); } } @@ -291,10 +291,10 @@ static int config_ini_handler(void *user, const char *section, const char *name, } else if (strcasecmp(value, "false") == 0) { config->xwayland = false; } else { - wlr_log(L_ERROR, "got unknown xwayland value: %s", value); + wlr_log(WLR_ERROR, "got unknown xwayland value: %s", value); } } else { - wlr_log(L_ERROR, "got unknown core config: %s", name); + wlr_log(WLR_ERROR, "got unknown core config: %s", name); } } else if (strncmp(output_prefix, section, strlen(output_prefix)) == 0) { const char *output_name = section + strlen(output_prefix); @@ -324,7 +324,7 @@ static int config_ini_handler(void *user, const char *section, const char *name, } else if (strcasecmp(value, "false") == 0) { oc->enable = false; } else { - wlr_log(L_ERROR, "got invalid output enable value: %s", value); + wlr_log(WLR_ERROR, "got invalid output enable value: %s", value); } } else if (strcmp(name, "x") == 0) { oc->x = strtol(value, NULL, 10); @@ -351,7 +351,7 @@ static int config_ini_handler(void *user, const char *section, const char *name, } else if (strcmp(value, "flipped-270") == 0) { oc->transform = WL_OUTPUT_TRANSFORM_FLIPPED_270; } else { - wlr_log(L_ERROR, "got unknown transform value: %s", value); + wlr_log(WLR_ERROR, "got unknown transform value: %s", value); } } else if (strcmp(name, "mode") == 0) { char *end; @@ -365,7 +365,7 @@ static int config_ini_handler(void *user, const char *section, const char *name, oc->mode.refresh_rate = strtof(end, &end); assert(strcmp("Hz", end) == 0); } - wlr_log(L_DEBUG, "Configured output %s with mode %dx%d@%f", + wlr_log(WLR_DEBUG, "Configured output %s with mode %dx%d@%f", oc->name, oc->mode.width, oc->mode.height, oc->mode.refresh_rate); } else if (strcmp(name, "modeline") == 0) { @@ -375,7 +375,7 @@ static int config_ini_handler(void *user, const char *section, const char *name, wl_list_insert(&oc->modes, &mode->link); } else { free(mode); - wlr_log(L_ERROR, "Invalid modeline: %s", value); + wlr_log(WLR_ERROR, "Invalid modeline: %s", value); } } } else if (strncmp(cursor_prefix, section, strlen(cursor_prefix)) == 0) { @@ -418,12 +418,12 @@ static int config_ini_handler(void *user, const char *section, const char *name, } else if (strcasecmp(value, "false") == 0) { dc->tap_enabled = false; } else { - wlr_log(L_ERROR, + wlr_log(WLR_ERROR, "got unknown tap_enabled value: %s", value); } } else { - wlr_log(L_ERROR, "got unknown device config: %s", name); + wlr_log(WLR_ERROR, "got unknown device config: %s", name); } } else if (strcmp(section, "keyboard") == 0) { config_handle_keyboard(config, "", name, value); @@ -434,7 +434,7 @@ static int config_ini_handler(void *user, const char *section, const char *name, } else if (strcmp(section, "bindings") == 0) { add_binding_config(&config->bindings, name, value); } else { - wlr_log(L_ERROR, "got unknown config section: %s", section); + wlr_log(WLR_ERROR, "got unknown config section: %s", section); } return 1; @@ -478,12 +478,12 @@ struct roots_config *roots_config_create_from_args(int argc, char *argv[]) { if (getcwd(cwd, sizeof(cwd)) != NULL) { char buf[MAXPATHLEN]; if (snprintf(buf, MAXPATHLEN, "%s/%s", cwd, "rootston.ini") >= MAXPATHLEN) { - wlr_log(L_ERROR, "config path too long"); + wlr_log(WLR_ERROR, "config path too long"); exit(1); } config->config_path = strdup(buf); } else { - wlr_log(L_ERROR, "could not get cwd"); + wlr_log(WLR_ERROR, "could not get cwd"); exit(1); } } @@ -491,7 +491,7 @@ struct roots_config *roots_config_create_from_args(int argc, char *argv[]) { int result = ini_parse(config->config_path, config_ini_handler, config); if (result == -1) { - wlr_log(L_DEBUG, "No config file found. Using sensible defaults."); + wlr_log(WLR_DEBUG, "No config file found. Using sensible defaults."); add_binding_config(&config->bindings, "Logo+Shift+E", "exit"); add_binding_config(&config->bindings, "Ctrl+q", "close"); add_binding_config(&config->bindings, "Alt+Tab", "next_window"); @@ -501,10 +501,10 @@ struct roots_config *roots_config_create_from_args(int argc, char *argv[]) { kc->name = strdup(""); wl_list_insert(&config->keyboards, &kc->link); } else if (result == -2) { - wlr_log(L_ERROR, "Could not allocate memory to parse config file"); + wlr_log(WLR_ERROR, "Could not allocate memory to parse config file"); exit(1); } else if (result != 0) { - wlr_log(L_ERROR, "Could not parse config file"); + wlr_log(WLR_ERROR, "Could not parse config file"); exit(1); } diff --git a/rootston/cursor.c b/rootston/cursor.c index 904af67f..94f5520e 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -429,7 +429,7 @@ void roots_cursor_handle_request_set_cursor(struct roots_cursor *cursor, } if (event->seat_client->client != focused_client || cursor->mode != ROOTS_CURSOR_PASSTHROUGH) { - wlr_log(L_DEBUG, "Denying request to set cursor from unfocused client"); + wlr_log(WLR_DEBUG, "Denying request to set cursor from unfocused client"); return; } diff --git a/rootston/desktop.c b/rootston/desktop.c index 4b5a5c9a..563c5938 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -757,7 +757,7 @@ static void input_inhibit_deactivate(struct wl_listener *listener, void *data) { struct roots_desktop *desktop_create(struct roots_server *server, struct roots_config *config) { - wlr_log(L_DEBUG, "Initializing roots desktop"); + wlr_log(WLR_DEBUG, "Initializing roots desktop"); struct roots_desktop *desktop = calloc(1, sizeof(struct roots_desktop)); if (desktop == NULL) { @@ -816,7 +816,7 @@ struct roots_desktop *desktop_create(struct roots_server *server, desktop->xcursor_manager = wlr_xcursor_manager_create(cursor_theme, ROOTS_XCURSOR_SIZE); if (desktop->xcursor_manager == NULL) { - wlr_log(L_ERROR, "Cannot create XCursor manager for theme %s", + wlr_log(WLR_ERROR, "Cannot create XCursor manager for theme %s", cursor_theme); free(desktop); return NULL; @@ -830,7 +830,7 @@ struct roots_desktop *desktop_create(struct roots_server *server, desktop->xwayland_surface.notify = handle_xwayland_surface; if (wlr_xcursor_manager_load(desktop->xcursor_manager, 1)) { - wlr_log(L_ERROR, "Cannot load XWayland XCursor theme"); + wlr_log(WLR_ERROR, "Cannot load XWayland XCursor theme"); } struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor( desktop->xcursor_manager, cursor_default, 1); diff --git a/rootston/input.c b/rootston/input.c index 3e1b06fb..84b5acae 100644 --- a/rootston/input.c +++ b/rootston/input.c @@ -56,11 +56,11 @@ static void handle_new_input(struct wl_listener *listener, void *data) { struct roots_seat *seat = input_get_seat(input, seat_name); if (!seat) { - wlr_log(L_ERROR, "could not create roots seat"); + wlr_log(WLR_ERROR, "could not create roots seat"); return; } - wlr_log(L_DEBUG, "New input device: %s (%d:%d) %s seat:%s", device->name, + wlr_log(WLR_DEBUG, "New input device: %s (%d:%d) %s seat:%s", device->name, device->vendor, device->product, device_type(device->type), seat_name); roots_seat_add_device(seat, device); @@ -69,7 +69,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) { struct libinput_device *libinput_dev = wlr_libinput_get_device_handle(device); - wlr_log(L_DEBUG, "input has config, tap_enabled: %d\n", dc->tap_enabled); + wlr_log(WLR_DEBUG, "input has config, tap_enabled: %d\n", dc->tap_enabled); if (dc->tap_enabled) { libinput_device_config_tap_set_enabled(libinput_dev, LIBINPUT_CONFIG_TAP_ENABLED); @@ -79,7 +79,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) { struct roots_input *input_create(struct roots_server *server, struct roots_config *config) { - wlr_log(L_DEBUG, "Initializing roots input"); + wlr_log(WLR_DEBUG, "Initializing roots input"); assert(server->desktop); struct roots_input *input = calloc(1, sizeof(struct roots_input)); diff --git a/rootston/keyboard.c b/rootston/keyboard.c index b5dac51c..6697ca83 100644 --- a/rootston/keyboard.c +++ b/rootston/keyboard.c @@ -115,7 +115,7 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard, const char *shell_cmd = command + strlen(exec_prefix); pid_t pid = fork(); if (pid < 0) { - wlr_log(L_ERROR, "cannot execute binding command: fork() failed"); + wlr_log(WLR_ERROR, "cannot execute binding command: fork() failed"); return; } else if (pid == 0) { execl("/bin/sh", "/bin/sh", "-c", shell_cmd, (void *)NULL); @@ -126,7 +126,7 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard, view_maximize(focus, !focus->maximized); } } else if (strcmp(command, "nop") == 0) { - wlr_log(L_DEBUG, "nop command"); + wlr_log(WLR_DEBUG, "nop command"); } else if (strcmp(command, "toggle_outputs") == 0) { outputs_enabled = !outputs_enabled; struct roots_output *output; @@ -134,7 +134,7 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard, wlr_output_enable(output->wlr_output, outputs_enabled); } } else { - wlr_log(L_ERROR, "unknown binding command: %s", command); + wlr_log(WLR_ERROR, "unknown binding command: %s", command); } } @@ -369,7 +369,7 @@ struct roots_keyboard *roots_keyboard_create(struct wlr_input_device *device, rules.options = config->options; struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (context == NULL) { - wlr_log(L_ERROR, "Cannot create XKB context"); + wlr_log(WLR_ERROR, "Cannot create XKB context"); return NULL; } @@ -377,7 +377,7 @@ struct roots_keyboard *roots_keyboard_create(struct wlr_input_device *device, XKB_KEYMAP_COMPILE_NO_FLAGS); if (keymap == NULL) { xkb_context_unref(context); - wlr_log(L_ERROR, "Cannot create XKB keymap"); + wlr_log(WLR_ERROR, "Cannot create XKB keymap"); return NULL; } diff --git a/rootston/layer_shell.c b/rootston/layer_shell.c index 2adf11a5..ba69c3db 100644 --- a/rootston/layer_shell.c +++ b/rootston/layer_shell.c @@ -371,7 +371,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { struct wlr_layer_surface *layer_surface = data; struct roots_desktop *desktop = wl_container_of(listener, desktop, layer_shell_surface); - wlr_log(L_DEBUG, "new layer surface: namespace %s layer %d anchor %d " + wlr_log(WLR_DEBUG, "new layer surface: namespace %s layer %d anchor %d " "size %dx%d margin %d,%d,%d,%d", layer_surface->namespace, layer_surface->layer, layer_surface->layer, layer_surface->client_pending.desired_width, @@ -390,7 +390,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { seat->cursor->cursor->x, seat->cursor->cursor->y); if (!output) { - wlr_log(L_ERROR, "Couldn't find output at (%.0f,%.0f)", + wlr_log(WLR_ERROR, "Couldn't find output at (%.0f,%.0f)", seat->cursor->cursor->x, seat->cursor->cursor->y); output = wlr_output_layout_get_center_output(desktop->layout); diff --git a/rootston/main.c b/rootston/main.c index 8a0205f2..cc3ffd3e 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -15,7 +15,7 @@ struct roots_server server = { 0 }; int main(int argc, char **argv) { - wlr_log_init(L_DEBUG, NULL); + wlr_log_init(WLR_DEBUG, NULL); server.config = roots_config_create_from_args(argc, argv); server.wl_display = wl_display_create(); server.wl_event_loop = wl_display_get_event_loop(server.wl_display); @@ -23,7 +23,7 @@ int main(int argc, char **argv) { server.backend = wlr_backend_autocreate(server.wl_display, NULL); if (server.backend == NULL) { - wlr_log(L_ERROR, "could not start backend"); + wlr_log(WLR_ERROR, "could not start backend"); return 1; } @@ -37,16 +37,16 @@ int main(int argc, char **argv) { const char *socket = wl_display_add_socket_auto(server.wl_display); if (!socket) { - wlr_log_errno(L_ERROR, "Unable to open wayland socket"); + wlr_log_errno(WLR_ERROR, "Unable to open wayland socket"); wlr_backend_destroy(server.backend); return 1; } - wlr_log(L_INFO, "Running compositor on wayland display '%s'", socket); + wlr_log(WLR_INFO, "Running compositor on wayland display '%s'", socket); setenv("_WAYLAND_DISPLAY", socket, true); if (!wlr_backend_start(server.backend)) { - wlr_log(L_ERROR, "Failed to start backend"); + wlr_log(WLR_ERROR, "Failed to start backend"); wlr_backend_destroy(server.backend); wl_display_destroy(server.wl_display); return 1; @@ -65,7 +65,7 @@ int main(int argc, char **argv) { const char *cmd = server.config->startup_cmd; pid_t pid = fork(); if (pid < 0) { - wlr_log(L_ERROR, "cannot execute binding command: fork() failed"); + wlr_log(WLR_ERROR, "cannot execute binding command: fork() failed"); } else if (pid == 0) { execl("/bin/sh", "/bin/sh", "-c", cmd, (void *)NULL); } diff --git a/rootston/output.c b/rootston/output.c index e3b03984..71ccf8bc 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -758,9 +758,9 @@ static void set_mode(struct wlr_output *output, } } if (!best) { - wlr_log(L_ERROR, "Configured mode for %s not available", output->name); + wlr_log(WLR_ERROR, "Configured mode for %s not available", output->name); } else { - wlr_log(L_DEBUG, "Assigning configured mode to %s", output->name); + wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name); wlr_output_set_mode(output, best); } } @@ -817,8 +817,8 @@ void handle_new_output(struct wl_listener *listener, void *data) { struct roots_input *input = desktop->server->input; struct roots_config *config = desktop->config; - wlr_log(L_DEBUG, "Output '%s' added", wlr_output->name); - wlr_log(L_DEBUG, "'%s %s %s' %"PRId32"mm x %"PRId32"mm", wlr_output->make, + wlr_log(WLR_DEBUG, "Output '%s' added", wlr_output->name); + wlr_log(WLR_DEBUG, "'%s %s %s' %"PRId32"mm x %"PRId32"mm", wlr_output->make, wlr_output->model, wlr_output->serial, wlr_output->phys_width, wlr_output->phys_height); @@ -866,7 +866,7 @@ void handle_new_output(struct wl_listener *listener, void *data) { } } else { if (!wl_list_empty(&output_config->modes)) { - wlr_log(L_ERROR, "Can only add modes for DRM backend"); + wlr_log(WLR_ERROR, "Can only add modes for DRM backend"); } } if (output_config->mode.width) { diff --git a/rootston/seat.c b/rootston/seat.c index d8910660..544cfb90 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -443,7 +443,7 @@ static void seat_add_keyboard(struct roots_seat *seat, struct roots_keyboard *keyboard = roots_keyboard_create(device, seat->input); if (keyboard == NULL) { - wlr_log(L_ERROR, "could not allocate keyboard for seat"); + wlr_log(WLR_ERROR, "could not allocate keyboard for seat"); return; } @@ -480,7 +480,7 @@ static void seat_add_pointer(struct roots_seat *seat, struct wlr_input_device *device) { struct roots_pointer *pointer = calloc(sizeof(struct roots_pointer), 1); if (!pointer) { - wlr_log(L_ERROR, "could not allocate pointer for seat"); + wlr_log(WLR_ERROR, "could not allocate pointer for seat"); return; } @@ -513,7 +513,7 @@ static void seat_add_touch(struct roots_seat *seat, struct wlr_input_device *device) { struct roots_touch *touch = calloc(sizeof(struct roots_touch), 1); if (!touch) { - wlr_log(L_ERROR, "could not allocate touch for seat"); + wlr_log(WLR_ERROR, "could not allocate touch for seat"); return; } @@ -553,7 +553,7 @@ static void seat_add_tablet_tool(struct roots_seat *seat, struct roots_tablet_tool *tablet_tool = calloc(sizeof(struct roots_tablet_tool), 1); if (!tablet_tool) { - wlr_log(L_ERROR, "could not allocate tablet_tool for seat"); + wlr_log(WLR_ERROR, "could not allocate tablet_tool for seat"); return; } @@ -608,7 +608,7 @@ void roots_seat_configure_xcursor(struct roots_seat *seat) { seat->cursor->xcursor_manager = wlr_xcursor_manager_create(cursor_theme, ROOTS_XCURSOR_SIZE); if (seat->cursor->xcursor_manager == NULL) { - wlr_log(L_ERROR, "Cannot create XCursor manager for theme %s", + wlr_log(WLR_ERROR, "Cannot create XCursor manager for theme %s", cursor_theme); return; } @@ -618,7 +618,7 @@ void roots_seat_configure_xcursor(struct roots_seat *seat) { wl_list_for_each(output, &seat->input->server->desktop->outputs, link) { float scale = output->wlr_output->scale; if (wlr_xcursor_manager_load(seat->cursor->xcursor_manager, scale)) { - wlr_log(L_ERROR, "Cannot load xcursor theme for output '%s' " + wlr_log(WLR_ERROR, "Cannot load xcursor theme for output '%s' " "with scale %f", output->wlr_output->name, scale); } } @@ -729,7 +729,7 @@ struct roots_seat_view *roots_seat_view_from_view( if (!found) { seat_view = seat_add_view(seat, view); if (seat_view == NULL) { - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); return NULL; } } diff --git a/rootston/virtual_keyboard.c b/rootston/virtual_keyboard.c index db47efca..e862caf4 100644 --- a/rootston/virtual_keyboard.c +++ b/rootston/virtual_keyboard.c @@ -13,7 +13,7 @@ void handle_virtual_keyboard(struct wl_listener *listener, void *data) { struct roots_seat *seat = input_seat_from_wlr_seat(desktop->server->input, keyboard->seat); if (!seat) { - wlr_log(L_ERROR, "could not find roots seat"); + wlr_log(WLR_ERROR, "could not find roots seat"); return; } diff --git a/rootston/wl_shell.c b/rootston/wl_shell.c index 02160773..07ac9f58 100644 --- a/rootston/wl_shell.c +++ b/rootston/wl_shell.c @@ -196,11 +196,11 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) { struct wlr_wl_shell_surface *surface = data; if (surface->state == WLR_WL_SHELL_SURFACE_STATE_POPUP) { - wlr_log(L_DEBUG, "new wl shell popup"); + wlr_log(WLR_DEBUG, "new wl shell popup"); return; } - wlr_log(L_DEBUG, "new wl shell surface: title=%s, class=%s", + wlr_log(WLR_DEBUG, "new wl shell surface: title=%s, class=%s", surface->title, surface->class); wlr_wl_shell_surface_ping(surface); diff --git a/rootston/xdg_shell.c b/rootston/xdg_shell.c index 805fb874..d04d37e1 100644 --- a/rootston/xdg_shell.c +++ b/rootston/xdg_shell.c @@ -398,14 +398,14 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { assert(surface->role != WLR_XDG_SURFACE_ROLE_NONE); if (surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { - wlr_log(L_DEBUG, "new xdg popup"); + wlr_log(WLR_DEBUG, "new xdg popup"); return; } struct roots_desktop *desktop = wl_container_of(listener, desktop, xdg_shell_surface); - wlr_log(L_DEBUG, "new xdg toplevel: title=%s, app_id=%s", + wlr_log(WLR_DEBUG, "new xdg toplevel: title=%s, app_id=%s", surface->toplevel->title, surface->toplevel->app_id); wlr_xdg_surface_ping(surface); diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c index 02ad867d..219be2b0 100644 --- a/rootston/xdg_shell_v6.c +++ b/rootston/xdg_shell_v6.c @@ -399,14 +399,14 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { assert(surface->role != WLR_XDG_SURFACE_V6_ROLE_NONE); if (surface->role == WLR_XDG_SURFACE_V6_ROLE_POPUP) { - wlr_log(L_DEBUG, "new xdg popup"); + wlr_log(WLR_DEBUG, "new xdg popup"); return; } struct roots_desktop *desktop = wl_container_of(listener, desktop, xdg_shell_v6_surface); - wlr_log(L_DEBUG, "new xdg toplevel: title=%s, app_id=%s", + wlr_log(WLR_DEBUG, "new xdg toplevel: title=%s, app_id=%s", surface->toplevel->title, surface->toplevel->app_id); wlr_xdg_surface_v6_ping(surface); diff --git a/rootston/xwayland.c b/rootston/xwayland.c index d0b80821..66ccce69 100644 --- a/rootston/xwayland.c +++ b/rootston/xwayland.c @@ -270,7 +270,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { wl_container_of(listener, desktop, xwayland_surface); struct wlr_xwayland_surface *surface = data; - wlr_log(L_DEBUG, "new xwayland surface: title=%s, class=%s, instance=%s", + wlr_log(WLR_DEBUG, "new xwayland surface: title=%s, class=%s, instance=%s", surface->title, surface->class, surface->instance); wlr_xwayland_surface_ping(surface); diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c index 1f84fc8d..a51f23ef 100644 --- a/types/data_device/wlr_data_device.c +++ b/types/data_device/wlr_data_device.c @@ -258,7 +258,7 @@ struct wlr_data_device_manager *wlr_data_device_manager_create( struct wlr_data_device_manager *manager = calloc(1, sizeof(struct wlr_data_device_manager)); if (manager == NULL) { - wlr_log(L_ERROR, "could not create data device manager"); + wlr_log(WLR_ERROR, "could not create data device manager"); return NULL; } @@ -270,7 +270,7 @@ struct wlr_data_device_manager *wlr_data_device_manager_create( wl_global_create(display, &wl_data_device_manager_interface, DATA_DEVICE_MANAGER_VERSION, manager, data_device_manager_bind); if (!manager->global) { - wlr_log(L_ERROR, "could not create data device manager wl_global"); + wlr_log(WLR_ERROR, "could not create data device manager wl_global"); free(manager); return NULL; } diff --git a/types/seat/wlr_seat.c b/types/seat/wlr_seat.c index 05c4b822..2e7da0a4 100644 --- a/types/seat/wlr_seat.c +++ b/types/seat/wlr_seat.c @@ -19,7 +19,7 @@ static void seat_handle_get_pointer(struct wl_client *client, struct wlr_seat_client *seat_client = wlr_seat_client_from_resource(seat_resource); if (!(seat_client->seat->capabilities & WL_SEAT_CAPABILITY_POINTER)) { - wlr_log(L_ERROR, "Client sent get_pointer on seat without the " + wlr_log(WLR_ERROR, "Client sent get_pointer on seat without the " "pointer capability"); return; } @@ -33,7 +33,7 @@ static void seat_handle_get_keyboard(struct wl_client *client, struct wlr_seat_client *seat_client = wlr_seat_client_from_resource(seat_resource); if (!(seat_client->seat->capabilities & WL_SEAT_CAPABILITY_KEYBOARD)) { - wlr_log(L_ERROR, "Client sent get_keyboard on seat without the " + wlr_log(WLR_ERROR, "Client sent get_keyboard on seat without the " "keyboard capability"); return; } @@ -47,7 +47,7 @@ static void seat_handle_get_touch(struct wl_client *client, struct wlr_seat_client *seat_client = wlr_seat_client_from_resource(seat_resource); if (!(seat_client->seat->capabilities & WL_SEAT_CAPABILITY_TOUCH)) { - wlr_log(L_ERROR, "Client sent get_touch on seat without the " + wlr_log(WLR_ERROR, "Client sent get_touch on seat without the " "touch capability"); return; } diff --git a/types/seat/wlr_seat_keyboard.c b/types/seat/wlr_seat_keyboard.c index 77fda68f..8c1b56e1 100644 --- a/types/seat/wlr_seat_keyboard.c +++ b/types/seat/wlr_seat_keyboard.c @@ -253,7 +253,7 @@ void wlr_seat_keyboard_enter(struct wlr_seat *seat, for (size_t i = 0; i < num_keycodes; ++i) { uint32_t *p = wl_array_add(&keys, sizeof(uint32_t)); if (!p) { - wlr_log(L_ERROR, "Cannot allocate memory, skipping keycode: %d\n", + wlr_log(WLR_ERROR, "Cannot allocate memory, skipping keycode: %d\n", keycodes[i]); continue; } diff --git a/types/seat/wlr_seat_touch.c b/types/seat/wlr_seat_touch.c index 489882ba..d4fa6f0b 100644 --- a/types/seat/wlr_seat_touch.c +++ b/types/seat/wlr_seat_touch.c @@ -166,7 +166,7 @@ uint32_t wlr_seat_touch_notify_down(struct wlr_seat *seat, struct wlr_touch_point *point = touch_point_create(seat, touch_id, surface, sx, sy); if (!point) { - wlr_log(L_ERROR, "could not create touch point"); + wlr_log(WLR_ERROR, "could not create touch point"); return 0; } @@ -246,7 +246,7 @@ void wlr_seat_touch_point_focus(struct wlr_seat *seat, assert(surface); struct wlr_touch_point *point = wlr_seat_touch_get_point(seat, touch_id); if (!point) { - wlr_log(L_ERROR, "got touch point focus for unknown touch point"); + wlr_log(WLR_ERROR, "got touch point focus for unknown touch point"); return; } struct wlr_surface *focus = point->focus_surface; @@ -262,7 +262,7 @@ void wlr_seat_touch_point_clear_focus(struct wlr_seat *seat, uint32_t time, int32_t touch_id) { struct wlr_touch_point *point = wlr_seat_touch_get_point(seat, touch_id); if (!point) { - wlr_log(L_ERROR, "got touch point focus for unknown touch point"); + wlr_log(WLR_ERROR, "got touch point focus for unknown touch point"); return; } @@ -274,7 +274,7 @@ uint32_t wlr_seat_touch_send_down(struct wlr_seat *seat, double sy) { struct wlr_touch_point *point = wlr_seat_touch_get_point(seat, touch_id); if (!point) { - wlr_log(L_ERROR, "got touch down for unknown touch point"); + wlr_log(WLR_ERROR, "got touch down for unknown touch point"); return 0; } @@ -295,7 +295,7 @@ uint32_t wlr_seat_touch_send_down(struct wlr_seat *seat, void wlr_seat_touch_send_up(struct wlr_seat *seat, uint32_t time, int32_t touch_id) { struct wlr_touch_point *point = wlr_seat_touch_get_point(seat, touch_id); if (!point) { - wlr_log(L_ERROR, "got touch up for unknown touch point"); + wlr_log(WLR_ERROR, "got touch up for unknown touch point"); return; } @@ -314,7 +314,7 @@ void wlr_seat_touch_send_motion(struct wlr_seat *seat, uint32_t time, int32_t to double sx, double sy) { struct wlr_touch_point *point = wlr_seat_touch_get_point(seat, touch_id); if (!point) { - wlr_log(L_ERROR, "got touch motion for unknown touch point"); + wlr_log(WLR_ERROR, "got touch motion for unknown touch point"); return; } diff --git a/types/wlr_buffer.c b/types/wlr_buffer.c index 673d7088..5e4aedac 100644 --- a/types/wlr_buffer.c +++ b/types/wlr_buffer.c @@ -86,12 +86,12 @@ struct wlr_buffer *wlr_buffer_create(struct wlr_renderer *renderer, // re-using the same DMA-BUF for the next frames, so we don't release // the buffer yet. } else { - wlr_log(L_ERROR, "Cannot upload texture: unknown buffer type"); + wlr_log(WLR_ERROR, "Cannot upload texture: unknown buffer type"); return NULL; } if (texture == NULL) { - wlr_log(L_ERROR, "Failed to upload texture"); + wlr_log(WLR_ERROR, "Failed to upload texture"); return NULL; } diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c index 436de892..5aec4002 100644 --- a/types/wlr_compositor.c +++ b/types/wlr_compositor.c @@ -111,7 +111,7 @@ static void subcompositor_init(struct wlr_subcompositor *subcompositor, &wl_subcompositor_interface, SUBCOMPOSITOR_VERSION, subcompositor, subcompositor_bind); if (subcompositor->global == NULL) { - wlr_log_errno(L_ERROR, "Could not allocate subcompositor global"); + wlr_log_errno(WLR_ERROR, "Could not allocate subcompositor global"); return; } wl_list_init(&subcompositor->resources); @@ -218,7 +218,7 @@ struct wlr_compositor *wlr_compositor_create(struct wl_display *display, struct wlr_compositor *compositor = calloc(1, sizeof(struct wlr_compositor)); if (!compositor) { - wlr_log_errno(L_ERROR, "Could not allocate wlr compositor"); + wlr_log_errno(WLR_ERROR, "Could not allocate wlr compositor"); return NULL; } @@ -226,7 +226,7 @@ struct wlr_compositor *wlr_compositor_create(struct wl_display *display, COMPOSITOR_VERSION, compositor, compositor_bind); if (!compositor->global) { free(compositor); - wlr_log_errno(L_ERROR, "Could not allocate compositor global"); + wlr_log_errno(WLR_ERROR, "Could not allocate compositor global"); return NULL; } compositor->renderer = renderer; diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c index 32d990cf..4a30215f 100644 --- a/types/wlr_cursor.c +++ b/types/wlr_cursor.c @@ -59,13 +59,13 @@ struct wlr_cursor_state { struct wlr_cursor *wlr_cursor_create(void) { struct wlr_cursor *cur = calloc(1, sizeof(struct wlr_cursor)); if (!cur) { - wlr_log(L_ERROR, "Failed to allocate wlr_cursor"); + wlr_log(WLR_ERROR, "Failed to allocate wlr_cursor"); return NULL; } cur->state = calloc(1, sizeof(struct wlr_cursor_state)); if (!cur->state) { - wlr_log(L_ERROR, "Failed to allocate wlr_cursor_state"); + wlr_log(WLR_ERROR, "Failed to allocate wlr_cursor_state"); free(cur); return NULL; } @@ -514,7 +514,7 @@ static struct wlr_cursor_device *cursor_device_create( struct wlr_cursor_device *c_device = calloc(1, sizeof(struct wlr_cursor_device)); if (!c_device) { - wlr_log(L_ERROR, "Failed to allocate wlr_cursor_device"); + wlr_log(WLR_ERROR, "Failed to allocate wlr_cursor_device"); return NULL; } @@ -578,7 +578,7 @@ void wlr_cursor_attach_input_device(struct wlr_cursor *cur, if (dev->type != WLR_INPUT_DEVICE_POINTER && dev->type != WLR_INPUT_DEVICE_TOUCH && dev->type != WLR_INPUT_DEVICE_TABLET_TOOL) { - wlr_log(L_ERROR, "only device types of pointer, touch or tablet tool" + wlr_log(WLR_ERROR, "only device types of pointer, touch or tablet tool" "are supported"); return; } @@ -623,14 +623,14 @@ static void layout_add(struct wlr_cursor_state *state, struct wlr_cursor_output_cursor *output_cursor = calloc(1, sizeof(struct wlr_cursor_output_cursor)); if (output_cursor == NULL) { - wlr_log(L_ERROR, "Failed to allocate wlr_cursor_output_cursor"); + wlr_log(WLR_ERROR, "Failed to allocate wlr_cursor_output_cursor"); return; } output_cursor->cursor = state->cursor; output_cursor->output_cursor = wlr_output_cursor_create(l_output->output); if (output_cursor->output_cursor == NULL) { - wlr_log(L_ERROR, "Failed to create wlr_output_cursor"); + wlr_log(WLR_ERROR, "Failed to create wlr_output_cursor"); free(output_cursor); return; } @@ -698,7 +698,7 @@ void wlr_cursor_map_input_to_output(struct wlr_cursor *cur, struct wlr_input_device *dev, struct wlr_output *output) { struct wlr_cursor_device *c_device = get_cursor_device(cur, dev); if (!c_device) { - wlr_log(L_ERROR, "Cannot map device \"%s\" to output" + wlr_log(WLR_ERROR, "Cannot map device \"%s\" to output" "(not found in this cursor)", dev->name); return; } @@ -709,7 +709,7 @@ void wlr_cursor_map_input_to_output(struct wlr_cursor *cur, void wlr_cursor_map_to_region(struct wlr_cursor *cur, struct wlr_box *box) { if (box && wlr_box_empty(box)) { - wlr_log(L_ERROR, "cannot map cursor to an empty region"); + wlr_log(WLR_ERROR, "cannot map cursor to an empty region"); return; } @@ -719,14 +719,14 @@ void wlr_cursor_map_to_region(struct wlr_cursor *cur, void wlr_cursor_map_input_to_region(struct wlr_cursor *cur, struct wlr_input_device *dev, struct wlr_box *box) { if (box && wlr_box_empty(box)) { - wlr_log(L_ERROR, "cannot map device \"%s\" input to an empty region", + wlr_log(WLR_ERROR, "cannot map device \"%s\" input to an empty region", dev->name); return; } struct wlr_cursor_device *c_device = get_cursor_device(cur, dev); if (!c_device) { - wlr_log(L_ERROR, "Cannot map device \"%s\" to geometry (not found in" + wlr_log(WLR_ERROR, "Cannot map device \"%s\" to geometry (not found in" "this cursor)", dev->name); return; } diff --git a/types/wlr_gamma_control.c b/types/wlr_gamma_control.c index 07c2410f..5b871335 100644 --- a/types/wlr_gamma_control.c +++ b/types/wlr_gamma_control.c @@ -113,7 +113,7 @@ static void gamma_control_manager_get_gamma_control(struct wl_client *client, wl_client_post_no_memory(client); return; } - wlr_log(L_DEBUG, "new gamma_control %p (res %p)", gamma_control, + wlr_log(WLR_DEBUG, "new gamma_control %p (res %p)", gamma_control, gamma_control->resource); wl_resource_set_implementation(gamma_control->resource, &gamma_control_impl, gamma_control, gamma_control_destroy_resource); diff --git a/types/wlr_idle.c b/types/wlr_idle.c index 7f348eb3..b4e00451 100644 --- a/types/wlr_idle.c +++ b/types/wlr_idle.c @@ -154,7 +154,7 @@ void wlr_idle_set_enabled(struct wlr_idle *idle, struct wlr_seat *seat, if (idle->enabled == enabled) { return; } - wlr_log(L_DEBUG, "%s idle timers for %s", + wlr_log(WLR_DEBUG, "%s idle timers for %s", enabled ? "Enabling" : "Disabling", seat ? seat->name : "all seats"); idle->enabled = enabled; @@ -226,7 +226,7 @@ struct wlr_idle *wlr_idle_create(struct wl_display *display) { free(idle); return NULL; } - wlr_log(L_DEBUG, "idle manager created"); + wlr_log(WLR_DEBUG, "idle manager created"); return idle; } diff --git a/types/wlr_idle_inhibit_v1.c b/types/wlr_idle_inhibit_v1.c index fd190534..4cee3029 100644 --- a/types/wlr_idle_inhibit_v1.c +++ b/types/wlr_idle_inhibit_v1.c @@ -136,7 +136,7 @@ static void idle_inhibit_bind(struct wl_client *wl_client, void *data, wl_resource_set_implementation(wl_resource, &idle_inhibit_impl, idle_inhibit, idle_inhibit_manager_v1_handle_resource_destroy); - wlr_log(L_DEBUG, "idle_inhibit bound"); + wlr_log(WLR_DEBUG, "idle_inhibit bound"); } void wlr_idle_inhibit_v1_destroy(struct wlr_idle_inhibit_manager_v1 *idle_inhibit) { @@ -186,7 +186,7 @@ struct wlr_idle_inhibit_manager_v1 *wlr_idle_inhibit_v1_create(struct wl_display return NULL; } - wlr_log(L_DEBUG, "idle_inhibit manager created"); + wlr_log(WLR_DEBUG, "idle_inhibit manager created"); return idle_inhibit; } diff --git a/types/wlr_input_device.c b/types/wlr_input_device.c index 3056c0f4..3a8fc582 100644 --- a/types/wlr_input_device.c +++ b/types/wlr_input_device.c @@ -50,7 +50,7 @@ void wlr_input_device_destroy(struct wlr_input_device *dev) { wlr_tablet_pad_destroy(dev->tablet_pad); break; default: - wlr_log(L_DEBUG, "Warning: leaking memory %p %p %d", + wlr_log(WLR_DEBUG, "Warning: leaking memory %p %p %d", dev->_device, dev, dev->type); break; } diff --git a/types/wlr_keyboard.c b/types/wlr_keyboard.c index 3afbe517..e941e8d1 100644 --- a/types/wlr_keyboard.c +++ b/types/wlr_keyboard.c @@ -184,7 +184,7 @@ void wlr_keyboard_set_keymap(struct wlr_keyboard *kb, xkb_state_unref(kb->xkb_state); kb->xkb_state = xkb_state_new(kb->keymap); if (kb->xkb_state == NULL) { - wlr_log(L_ERROR, "Failed to create XKB state"); + wlr_log(WLR_ERROR, "Failed to create XKB state"); goto err; } @@ -220,13 +220,13 @@ void wlr_keyboard_set_keymap(struct wlr_keyboard *kb, } kb->keymap_fd = os_create_anonymous_file(kb->keymap_size); if (kb->keymap_fd < 0) { - wlr_log(L_ERROR, "creating a keymap file for %zu bytes failed", kb->keymap_size); + wlr_log(WLR_ERROR, "creating a keymap file for %zu bytes failed", kb->keymap_size); goto err; } void *ptr = mmap(NULL, kb->keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, kb->keymap_fd, 0); if (ptr == (void*)-1) { - wlr_log(L_ERROR, "failed to mmap() %zu bytes", kb->keymap_size); + wlr_log(WLR_ERROR, "failed to mmap() %zu bytes", kb->keymap_size); goto err; } strcpy(ptr, keymap_str); diff --git a/types/wlr_layer_shell.c b/types/wlr_layer_shell.c index 2a8a1cc6..c3933956 100644 --- a/types/wlr_layer_shell.c +++ b/types/wlr_layer_shell.c @@ -378,7 +378,7 @@ static void layer_shell_handle_get_layer_surface(struct wl_client *wl_client, wlr_surface_set_role_committed(surface->surface, handle_surface_committed, surface); - wlr_log(L_DEBUG, "new layer_surface %p (res %p)", + wlr_log(WLR_DEBUG, "new layer_surface %p (res %p)", surface, surface->resource); wl_resource_set_implementation(surface->resource, &layer_surface_implementation, surface, layer_surface_resource_destroy); diff --git a/types/wlr_linux_dmabuf.c b/types/wlr_linux_dmabuf.c index 8050d794..2d5259d8 100644 --- a/types/wlr_linux_dmabuf.c +++ b/types/wlr_linux_dmabuf.c @@ -481,7 +481,7 @@ struct wlr_linux_dmabuf *wlr_linux_dmabuf_create(struct wl_display *display, struct wlr_linux_dmabuf *linux_dmabuf = calloc(1, sizeof(struct wlr_linux_dmabuf)); if (linux_dmabuf == NULL) { - wlr_log(L_ERROR, "could not create simple dmabuf manager"); + wlr_log(WLR_ERROR, "could not create simple dmabuf manager"); return NULL; } linux_dmabuf->renderer = renderer; @@ -493,7 +493,7 @@ struct wlr_linux_dmabuf *wlr_linux_dmabuf_create(struct wl_display *display, wl_global_create(display, &zwp_linux_dmabuf_v1_interface, LINUX_DMABUF_VERSION, linux_dmabuf, linux_dmabuf_bind); if (!linux_dmabuf->global) { - wlr_log(L_ERROR, "could not create linux dmabuf v1 wl global"); + wlr_log(WLR_ERROR, "could not create linux dmabuf v1 wl global"); free(linux_dmabuf); return NULL; } diff --git a/types/wlr_output.c b/types/wlr_output.c index d87a374a..440c3151 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -108,7 +108,7 @@ void wlr_output_create_global(struct wlr_output *output) { output->global = wl_global_create(output->display, &wl_output_interface, OUTPUT_VERSION, output, output_bind); if (output->global == NULL) { - wlr_log(L_ERROR, "Failed to allocate wl_output global"); + wlr_log(WLR_ERROR, "Failed to allocate wl_output global"); } } @@ -459,7 +459,7 @@ surface_damage_finish: bool wlr_output_swap_buffers(struct wlr_output *output, struct timespec *when, pixman_region32_t *damage) { if (output->frame_pending) { - wlr_log(L_ERROR, "Tried to swap buffers when a frame is pending"); + wlr_log(WLR_ERROR, "Tried to swap buffers when a frame is pending"); return false; } if (output->idle_frame != NULL) { @@ -766,7 +766,7 @@ bool wlr_output_cursor_set_image(struct wlr_output_cursor *cursor, return true; } - wlr_log(L_DEBUG, "Falling back to software cursor"); + wlr_log(WLR_DEBUG, "Falling back to software cursor"); output_cursor_damage_whole(cursor); return true; } diff --git a/types/wlr_output_layout.c b/types/wlr_output_layout.c index bb1d399a..5ad0c99e 100644 --- a/types/wlr_output_layout.c +++ b/types/wlr_output_layout.c @@ -197,7 +197,7 @@ void wlr_output_layout_add(struct wlr_output_layout *layout, if (!l_output) { l_output = output_layout_output_create(layout, output); if (!l_output) { - wlr_log(L_ERROR, "Failed to create wlr_output_layout_output"); + wlr_log(WLR_ERROR, "Failed to create wlr_output_layout_output"); return; } } @@ -280,7 +280,7 @@ void wlr_output_layout_move(struct wlr_output_layout *layout, l_output->state->auto_configured = false; output_layout_reconfigure(layout); } else { - wlr_log(L_ERROR, "output not found in this layout: %s", output->name); + wlr_log(WLR_ERROR, "output not found in this layout: %s", output->name); } } @@ -402,7 +402,7 @@ void wlr_output_layout_add_auto(struct wlr_output_layout *layout, if (!l_output) { l_output = output_layout_output_create(layout, output); if (!l_output) { - wlr_log(L_ERROR, "Failed to create wlr_output_layout_output"); + wlr_log(WLR_ERROR, "Failed to create wlr_output_layout_output"); return; } } diff --git a/types/wlr_screenshooter.c b/types/wlr_screenshooter.c index 30d2a5cb..37b70538 100644 --- a/types/wlr_screenshooter.c +++ b/types/wlr_screenshooter.c @@ -55,7 +55,7 @@ static void output_handle_frame(struct wl_listener *listener, void *_data) { wl_shm_buffer_end_access(shm_buffer); if (!ok) { - wlr_log(L_ERROR, "Cannot read pixels"); + wlr_log(WLR_ERROR, "Cannot read pixels"); goto cleanup; } @@ -85,26 +85,26 @@ static void screenshooter_shoot(struct wl_client *client, struct wlr_renderer *renderer = wlr_backend_get_renderer(output->backend); if (renderer == NULL) { - wlr_log(L_ERROR, "Backend doesn't have a renderer"); + wlr_log(WLR_ERROR, "Backend doesn't have a renderer"); return; } struct wl_shm_buffer *shm_buffer = wl_shm_buffer_get(buffer_resource); if (shm_buffer == NULL) { - wlr_log(L_ERROR, "Invalid buffer: not a shared memory buffer"); + wlr_log(WLR_ERROR, "Invalid buffer: not a shared memory buffer"); return; } int32_t width = wl_shm_buffer_get_width(shm_buffer); int32_t height = wl_shm_buffer_get_height(shm_buffer); if (width < output->width || height < output->height) { - wlr_log(L_ERROR, "Invalid buffer: too small"); + wlr_log(WLR_ERROR, "Invalid buffer: too small"); return; } uint32_t format = wl_shm_buffer_get_format(shm_buffer); if (!wlr_renderer_format_supported(renderer, format)) { - wlr_log(L_ERROR, "Invalid buffer: unsupported format"); + wlr_log(WLR_ERROR, "Invalid buffer: unsupported format"); return; } @@ -129,7 +129,7 @@ static void screenshooter_shoot(struct wl_client *client, handle_screenshot_resource_destroy); wl_list_insert(&screenshooter->screenshots, &screenshot->link); - wlr_log(L_DEBUG, "new screenshot %p (res %p)", screenshot, + wlr_log(WLR_DEBUG, "new screenshot %p (res %p)", screenshot, screenshot->resource); struct screenshot_state *state = calloc(1, sizeof(struct screenshot_state)); diff --git a/types/wlr_server_decoration.c b/types/wlr_server_decoration.c index 1bd9f5c5..fceb1638 100644 --- a/types/wlr_server_decoration.c +++ b/types/wlr_server_decoration.c @@ -103,7 +103,7 @@ static void server_decoration_manager_handle_create(struct wl_client *client, &server_decoration_impl, decoration, server_decoration_destroy_resource); - wlr_log(L_DEBUG, "new server_decoration %p (res %p)", decoration, + wlr_log(WLR_DEBUG, "new server_decoration %p (res %p)", decoration, decoration->resource); wl_signal_init(&decoration->events.destroy); diff --git a/types/wlr_surface.c b/types/wlr_surface.c index 01e45e4f..77f7e90b 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -333,7 +333,7 @@ static void surface_apply_damage(struct wlr_surface *surface) { struct wlr_buffer *buffer = wlr_buffer_create(surface->renderer, resource); if (buffer == NULL) { - wlr_log(L_ERROR, "Failed to upload buffer"); + wlr_log(WLR_ERROR, "Failed to upload buffer"); return; } @@ -593,7 +593,7 @@ struct wlr_surface *wlr_surface_create(struct wl_client *client, wl_resource_set_implementation(surface->resource, &surface_interface, surface, surface_handle_resource_destroy); - wlr_log(L_DEBUG, "New wlr_surface %p (res %p)", surface, surface->resource); + wlr_log(WLR_DEBUG, "New wlr_surface %p (res %p)", surface, surface->resource); surface->renderer = renderer; diff --git a/types/wlr_virtual_keyboard_v1.c b/types/wlr_virtual_keyboard_v1.c index 49abde7f..cf7be0ee 100644 --- a/types/wlr_virtual_keyboard_v1.c +++ b/types/wlr_virtual_keyboard_v1.c @@ -139,7 +139,7 @@ static void virtual_keyboard_manager_create_virtual_keyboard( struct wlr_keyboard* keyboard = calloc(1, sizeof(struct wlr_keyboard)); if (!keyboard) { - wlr_log(L_ERROR, "Cannot allocate wlr_keyboard"); + wlr_log(WLR_ERROR, "Cannot allocate wlr_keyboard"); free(virtual_keyboard); wl_client_post_no_memory(client); return; diff --git a/types/wlr_wl_shell.c b/types/wlr_wl_shell.c index a295a837..020c6080 100644 --- a/types/wlr_wl_shell.c +++ b/types/wlr_wl_shell.c @@ -118,7 +118,7 @@ static struct wlr_wl_shell_surface *shell_surface_from_resource( static void shell_surface_protocol_pong(struct wl_client *client, struct wl_resource *resource, uint32_t serial) { - wlr_log(L_DEBUG, "got shell surface pong"); + wlr_log(WLR_DEBUG, "got shell surface pong"); struct wlr_wl_shell_surface *surface = shell_surface_from_resource(resource); if (surface->ping_serial != serial) { return; @@ -135,7 +135,7 @@ static void shell_surface_protocol_move(struct wl_client *client, struct wlr_seat_client *seat = wlr_seat_client_from_resource(seat_resource); if (!wlr_seat_validate_grab_serial(seat->seat, serial)) { - wlr_log(L_DEBUG, "invalid serial for grab"); + wlr_log(WLR_DEBUG, "invalid serial for grab"); return; } @@ -197,7 +197,7 @@ static void shell_surface_protocol_resize(struct wl_client *client, struct wlr_seat_client *seat = wlr_seat_client_from_resource(seat_resource); if (!wlr_seat_validate_grab_serial(seat->seat, serial)) { - wlr_log(L_DEBUG, "invalid serial for grab"); + wlr_log(WLR_DEBUG, "invalid serial for grab"); return; } @@ -226,7 +226,7 @@ static void shell_surface_set_state(struct wlr_wl_shell_surface *surface, static void shell_surface_protocol_set_toplevel(struct wl_client *client, struct wl_resource *resource) { - wlr_log(L_DEBUG, "got shell surface toplevel"); + wlr_log(WLR_DEBUG, "got shell surface toplevel"); struct wlr_wl_shell_surface *surface = shell_surface_from_resource(resource); shell_surface_set_state(surface, WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL, NULL, NULL); @@ -262,7 +262,7 @@ static struct wlr_wl_shell_surface *shell_find_shell_surface( static void shell_surface_protocol_set_transient(struct wl_client *client, struct wl_resource *resource, struct wl_resource *parent_resource, int32_t x, int32_t y, enum wl_shell_surface_transient flags) { - wlr_log(L_DEBUG, "got shell surface transient"); + wlr_log(WLR_DEBUG, "got shell surface transient"); struct wlr_wl_shell_surface *surface = shell_surface_from_resource(resource); struct wlr_surface *parent = wlr_surface_from_resource(parent_resource); // TODO: check if parent_resource == NULL? @@ -392,7 +392,7 @@ static void shell_surface_protocol_set_maximized(struct wl_client *client, static void shell_surface_protocol_set_title(struct wl_client *client, struct wl_resource *resource, const char *title) { - wlr_log(L_DEBUG, "new shell surface title: %s", title); + wlr_log(WLR_DEBUG, "new shell surface title: %s", title); struct wlr_wl_shell_surface *surface = shell_surface_from_resource(resource); char *tmp = strdup(title); @@ -408,7 +408,7 @@ static void shell_surface_protocol_set_title(struct wl_client *client, static void shell_surface_protocol_set_class(struct wl_client *client, struct wl_resource *resource, const char *class) { - wlr_log(L_DEBUG, "new shell surface class: %s", class); + wlr_log(WLR_DEBUG, "new shell surface class: %s", class); struct wlr_wl_shell_surface *surface = shell_surface_from_resource(resource); char *tmp = strdup(class); @@ -542,7 +542,7 @@ static void shell_protocol_get_shell_surface(struct wl_client *client, &shell_surface_impl, wl_surface, shell_surface_resource_destroy); - wlr_log(L_DEBUG, "new wl_shell %p (res %p)", wl_surface, + wlr_log(WLR_DEBUG, "new wl_shell %p (res %p)", wl_surface, wl_surface->resource); wl_signal_init(&wl_surface->events.destroy); diff --git a/types/xdg_shell/wlr_xdg_surface.c b/types/xdg_shell/wlr_xdg_surface.c index 9eda8aa1..14afb91e 100644 --- a/types/xdg_shell/wlr_xdg_surface.c +++ b/types/xdg_shell/wlr_xdg_surface.c @@ -252,7 +252,7 @@ static void xdg_surface_handle_set_window_geometry(struct wl_client *client, } if (width <= 0 || height <= 0) { - wlr_log(L_ERROR, "Client tried to set invalid geometry"); + wlr_log(WLR_ERROR, "Client tried to set invalid geometry"); //XXX: Switch to the proper error value once available wl_resource_post_error(resource, -1, "Tried to set invalid xdg-surface geometry"); return; @@ -270,7 +270,7 @@ static void xdg_surface_handle_destroy(struct wl_client *client, struct wlr_xdg_surface *surface = wlr_xdg_surface_from_resource(resource); if (surface->role != WLR_XDG_SURFACE_ROLE_NONE) { - wlr_log(L_ERROR, "Tried to destroy an xdg_surface before its role " + wlr_log(WLR_ERROR, "Tried to destroy an xdg_surface before its role " "object"); return; } @@ -398,7 +398,7 @@ struct wlr_xdg_surface *create_xdg_surface( wlr_surface_set_role_committed(xdg_surface->surface, handle_surface_committed, xdg_surface); - wlr_log(L_DEBUG, "new xdg_surface %p (res %p)", xdg_surface, + wlr_log(WLR_DEBUG, "new xdg_surface %p (res %p)", xdg_surface, xdg_surface->resource); wl_resource_set_implementation(xdg_surface->resource, &xdg_surface_implementation, xdg_surface, diff --git a/types/xdg_shell/wlr_xdg_toplevel.c b/types/xdg_shell/wlr_xdg_toplevel.c index 5d0bfa1f..9430a7d2 100644 --- a/types/xdg_shell/wlr_xdg_toplevel.c +++ b/types/xdg_shell/wlr_xdg_toplevel.c @@ -83,7 +83,7 @@ void send_xdg_toplevel_configure(struct wlr_xdg_surface *surface, configure->toplevel_state = malloc(sizeof(*configure->toplevel_state)); if (configure->toplevel_state == NULL) { - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); wl_resource_post_no_memory(surface->toplevel->resource); return; } @@ -94,7 +94,7 @@ void send_xdg_toplevel_configure(struct wlr_xdg_surface *surface, if (surface->toplevel->server_pending.maximized) { uint32_t *s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { - wlr_log(L_ERROR, "Could not allocate state for maximized xdg_toplevel"); + wlr_log(WLR_ERROR, "Could not allocate state for maximized xdg_toplevel"); goto error_out; } *s = XDG_TOPLEVEL_STATE_MAXIMIZED; @@ -102,7 +102,7 @@ void send_xdg_toplevel_configure(struct wlr_xdg_surface *surface, if (surface->toplevel->server_pending.fullscreen) { uint32_t *s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { - wlr_log(L_ERROR, "Could not allocate state for fullscreen xdg_toplevel"); + wlr_log(WLR_ERROR, "Could not allocate state for fullscreen xdg_toplevel"); goto error_out; } *s = XDG_TOPLEVEL_STATE_FULLSCREEN; @@ -110,7 +110,7 @@ void send_xdg_toplevel_configure(struct wlr_xdg_surface *surface, if (surface->toplevel->server_pending.resizing) { uint32_t *s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { - wlr_log(L_ERROR, "Could not allocate state for resizing xdg_toplevel"); + wlr_log(WLR_ERROR, "Could not allocate state for resizing xdg_toplevel"); goto error_out; } *s = XDG_TOPLEVEL_STATE_RESIZING; @@ -118,7 +118,7 @@ void send_xdg_toplevel_configure(struct wlr_xdg_surface *surface, if (surface->toplevel->server_pending.activated) { uint32_t *s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { - wlr_log(L_ERROR, "Could not allocate state for activated xdg_toplevel"); + wlr_log(WLR_ERROR, "Could not allocate state for activated xdg_toplevel"); goto error_out; } *s = XDG_TOPLEVEL_STATE_ACTIVATED; @@ -144,7 +144,7 @@ void send_xdg_toplevel_configure(struct wlr_xdg_surface *surface, uint32_t *s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { - wlr_log(L_ERROR, + wlr_log(WLR_ERROR, "Could not allocate state for tiled xdg_toplevel"); goto error_out; } @@ -155,7 +155,7 @@ void send_xdg_toplevel_configure(struct wlr_xdg_surface *surface, // toplevel maximized uint32_t *s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { - wlr_log(L_ERROR, + wlr_log(WLR_ERROR, "Could not allocate state for maximized xdg_toplevel"); goto error_out; } @@ -267,7 +267,7 @@ static void xdg_toplevel_handle_show_window_menu(struct wl_client *client, } if (!wlr_seat_validate_grab_serial(seat->seat, serial)) { - wlr_log(L_DEBUG, "invalid serial for grab"); + wlr_log(WLR_DEBUG, "invalid serial for grab"); return; } @@ -298,7 +298,7 @@ static void xdg_toplevel_handle_move(struct wl_client *client, } if (!wlr_seat_validate_grab_serial(seat->seat, serial)) { - wlr_log(L_DEBUG, "invalid serial for grab"); + wlr_log(WLR_DEBUG, "invalid serial for grab"); return; } @@ -327,7 +327,7 @@ static void xdg_toplevel_handle_resize(struct wl_client *client, } if (!wlr_seat_validate_grab_serial(seat->seat, serial)) { - wlr_log(L_DEBUG, "invalid serial for grab"); + wlr_log(WLR_DEBUG, "invalid serial for grab"); return; } diff --git a/types/xdg_shell_v6/wlr_xdg_surface_v6.c b/types/xdg_shell_v6/wlr_xdg_surface_v6.c index 046dd4ed..65db8256 100644 --- a/types/xdg_shell_v6/wlr_xdg_surface_v6.c +++ b/types/xdg_shell_v6/wlr_xdg_surface_v6.c @@ -205,7 +205,7 @@ static void xdg_surface_handle_set_window_geometry(struct wl_client *client, } if (width <= 0 || height <= 0) { - wlr_log(L_ERROR, "Client tried to set invalid geometry"); + wlr_log(WLR_ERROR, "Client tried to set invalid geometry"); wl_resource_post_error(resource, -1, "Tried to set invalid xdg-surface geometry"); } @@ -222,7 +222,7 @@ static void xdg_surface_handle_destroy(struct wl_client *client, struct wlr_xdg_surface_v6 *surface = xdg_surface_from_resource(resource); if (surface->role != WLR_XDG_SURFACE_V6_ROLE_NONE) { - wlr_log(L_ERROR, "Tried to destroy an xdg_surface before its role " + wlr_log(WLR_ERROR, "Tried to destroy an xdg_surface before its role " "object"); return; } @@ -456,7 +456,7 @@ struct wlr_xdg_surface_v6 *create_xdg_surface_v6( wlr_surface_set_role_committed(xdg_surface->surface, handle_surface_committed, xdg_surface); - wlr_log(L_DEBUG, "new xdg_surface %p (res %p)", xdg_surface, + wlr_log(WLR_DEBUG, "new xdg_surface %p (res %p)", xdg_surface, xdg_surface->resource); wl_list_insert(&client->surfaces, &xdg_surface->link); diff --git a/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c b/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c index 29cbe2dd..1f005305 100644 --- a/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c +++ b/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c @@ -89,7 +89,7 @@ static void xdg_toplevel_handle_show_window_menu(struct wl_client *client, } if (!wlr_seat_validate_grab_serial(seat->seat, serial)) { - wlr_log(L_DEBUG, "invalid serial for grab"); + wlr_log(WLR_DEBUG, "invalid serial for grab"); return; } @@ -121,7 +121,7 @@ static void xdg_toplevel_handle_move(struct wl_client *client, } if (!wlr_seat_validate_grab_serial(seat->seat, serial)) { - wlr_log(L_DEBUG, "invalid serial for grab"); + wlr_log(WLR_DEBUG, "invalid serial for grab"); return; } @@ -150,7 +150,7 @@ static void xdg_toplevel_handle_resize(struct wl_client *client, } if (!wlr_seat_validate_grab_serial(seat->seat, serial)) { - wlr_log(L_DEBUG, "invalid serial for grab"); + wlr_log(WLR_DEBUG, "invalid serial for grab"); return; } @@ -328,7 +328,7 @@ void send_xdg_toplevel_v6_configure(struct wlr_xdg_surface_v6 *surface, configure->toplevel_state = malloc(sizeof(*configure->toplevel_state)); if (configure->toplevel_state == NULL) { - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); wl_resource_post_no_memory(surface->toplevel->resource); return; } @@ -340,7 +340,7 @@ void send_xdg_toplevel_v6_configure(struct wlr_xdg_surface_v6 *surface, if (surface->toplevel->server_pending.maximized) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { - wlr_log(L_ERROR, + wlr_log(WLR_ERROR, "Could not allocate state for maximized xdg_toplevel"); goto error_out; } @@ -349,7 +349,7 @@ void send_xdg_toplevel_v6_configure(struct wlr_xdg_surface_v6 *surface, if (surface->toplevel->server_pending.fullscreen) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { - wlr_log(L_ERROR, + wlr_log(WLR_ERROR, "Could not allocate state for fullscreen xdg_toplevel"); goto error_out; } @@ -358,7 +358,7 @@ void send_xdg_toplevel_v6_configure(struct wlr_xdg_surface_v6 *surface, if (surface->toplevel->server_pending.resizing) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { - wlr_log(L_ERROR, + wlr_log(WLR_ERROR, "Could not allocate state for resizing xdg_toplevel"); goto error_out; } @@ -367,7 +367,7 @@ void send_xdg_toplevel_v6_configure(struct wlr_xdg_surface_v6 *surface, if (surface->toplevel->server_pending.activated) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { - wlr_log(L_ERROR, + wlr_log(WLR_ERROR, "Could not allocate state for activated xdg_toplevel"); goto error_out; } diff --git a/util/log.c b/util/log.c index 328532f7..754ccfa9 100644 --- a/util/log.c +++ b/util/log.c @@ -9,16 +9,16 @@ #include static bool colored = true; -static log_importance_t log_importance = L_ERROR; +static enum wlr_log_importance log_importance = WLR_ERROR; static const char *verbosity_colors[] = { - [L_SILENT] = "", - [L_ERROR ] = "\x1B[1;31m", - [L_INFO ] = "\x1B[1;34m", - [L_DEBUG ] = "\x1B[1;30m", + [WLR_SILENT] = "", + [WLR_ERROR ] = "\x1B[1;31m", + [WLR_INFO ] = "\x1B[1;34m", + [WLR_DEBUG ] = "\x1B[1;30m", }; -static void log_stderr(log_importance_t verbosity, const char *fmt, +static void log_stderr(enum wlr_log_importance verbosity, const char *fmt, va_list args) { if (verbosity > log_importance) { return; @@ -33,7 +33,7 @@ static void log_stderr(log_importance_t verbosity, const char *fmt, strftime(buffer, sizeof(buffer), "%F %T - ", tm_info); fprintf(stderr, "%s", buffer); - unsigned c = (verbosity < L_LAST) ? verbosity : L_LAST - 1; + unsigned c = (verbosity < WLR_LOG_IMPORTANCE_LAST) ? verbosity : WLR_LOG_IMPORTANCE_LAST - 1; if (colored && isatty(STDERR_FILENO)) { fprintf(stderr, "%s", verbosity_colors[c]); @@ -47,10 +47,10 @@ static void log_stderr(log_importance_t verbosity, const char *fmt, fprintf(stderr, "\n"); } -static log_callback_t log_callback = log_stderr; +static wlr_log_func_t log_callback = log_stderr; -void wlr_log_init(log_importance_t verbosity, log_callback_t callback) { - if (verbosity < L_LAST) { +void wlr_log_init(enum wlr_log_importance verbosity, wlr_log_func_t callback) { + if (verbosity < WLR_LOG_IMPORTANCE_LAST) { log_importance = verbosity; } if (callback) { @@ -58,11 +58,11 @@ void wlr_log_init(log_importance_t verbosity, log_callback_t callback) { } } -void _wlr_vlog(log_importance_t verbosity, const char *fmt, va_list args) { +void _wlr_vlog(enum wlr_log_importance verbosity, const char *fmt, va_list args) { log_callback(verbosity, fmt, args); } -void _wlr_log(log_importance_t verbosity, const char *fmt, ...) { +void _wlr_log(enum wlr_log_importance verbosity, const char *fmt, ...) { va_list args; va_start(args, fmt); log_callback(verbosity, fmt, args); @@ -74,7 +74,7 @@ void _wlr_log(log_importance_t verbosity, const char *fmt, ...) { // e.g. '/src/build/wlroots/backend/wayland/backend.c' and // '../backend/wayland/backend.c' will both be stripped to // 'backend/wayland/backend.c' -const char *wlr_strip_path(const char *filepath) { +const char *_wlr_strip_path(const char *filepath) { static int srclen = sizeof(WLR_SRC_DIR); if (strstr(filepath, WLR_SRC_DIR) == filepath) { filepath += srclen; diff --git a/wlroots.syms b/wlroots.syms index 804c352f..ba085d0f 100644 --- a/wlroots.syms +++ b/wlroots.syms @@ -3,6 +3,7 @@ WLROOTS_0_0_0 { wlr_*; _wlr_log; _wlr_vlog; + _wlr_strip_path; local: wlr_signal_emit_safe; *; diff --git a/xcursor/wlr_xcursor.c b/xcursor/wlr_xcursor.c index 38c01efe..2391a49a 100644 --- a/xcursor/wlr_xcursor.c +++ b/xcursor/wlr_xcursor.c @@ -238,12 +238,12 @@ struct wlr_xcursor_theme *wlr_xcursor_theme_load(const char *name, int size) { load_default_theme(theme); } - wlr_log(L_DEBUG, "Loaded cursor theme '%s', available cursors:", + wlr_log(WLR_DEBUG, "Loaded cursor theme '%s', available cursors:", theme->name); for (size_t i = 0; i < theme->cursor_count; ++i) { struct wlr_xcursor *c = theme->cursors[i]; struct wlr_xcursor_image *i = c->images[0]; - wlr_log(L_DEBUG, "%s (%u images) %dx%d+%d,%d", + wlr_log(WLR_DEBUG, "%s (%u images) %dx%d+%d,%d", c->name, c->image_count, i->width, i->height, i->hotspot_x, i->hotspot_y); } diff --git a/xwayland/selection/dnd.c b/xwayland/selection/dnd.c index ed265c28..4c687172 100644 --- a/xwayland/selection/dnd.c +++ b/xwayland/selection/dnd.c @@ -167,7 +167,7 @@ int xwm_handle_selection_client_message(struct wlr_xwm *xwm, xcb_client_message_event_t *ev) { if (ev->type == xwm->atoms[DND_STATUS]) { if (xwm->drag == NULL) { - wlr_log(L_DEBUG, "ignoring XdndStatus client message because " + wlr_log(WLR_DEBUG, "ignoring XdndStatus client message because " "there's no drag"); return 1; } @@ -179,7 +179,7 @@ int xwm_handle_selection_client_message(struct wlr_xwm *xwm, if (xwm->drag_focus == NULL || target_window != xwm->drag_focus->window_id) { - wlr_log(L_DEBUG, "ignoring XdndStatus client message because " + wlr_log(WLR_DEBUG, "ignoring XdndStatus client message because " "it doesn't match the current drag focus window ID"); return 1; } @@ -193,7 +193,7 @@ int xwm_handle_selection_client_message(struct wlr_xwm *xwm, drag->source->accepted = accepted; wlr_data_source_dnd_action(drag->source, action); - wlr_log(L_DEBUG, "DND_STATUS window=%d accepted=%d action=%d", + wlr_log(WLR_DEBUG, "DND_STATUS window=%d accepted=%d action=%d", target_window, accepted, action); return 1; } else if (ev->type == xwm->atoms[DND_FINISHED]) { @@ -201,7 +201,7 @@ int xwm_handle_selection_client_message(struct wlr_xwm *xwm, // source is destroyed if (xwm->seat == NULL || xwm->seat->drag_source == NULL || xwm->drag != NULL) { - wlr_log(L_DEBUG, "ignoring XdndFinished client message because " + wlr_log(WLR_DEBUG, "ignoring XdndFinished client message because " "there's no finished drag"); return 1; } @@ -215,7 +215,7 @@ int xwm_handle_selection_client_message(struct wlr_xwm *xwm, if (xwm->drag_focus == NULL || target_window != xwm->drag_focus->window_id) { - wlr_log(L_DEBUG, "ignoring XdndFinished client message because " + wlr_log(WLR_DEBUG, "ignoring XdndFinished client message because " "it doesn't match the finished drag focus window ID"); return 1; } @@ -227,7 +227,7 @@ int xwm_handle_selection_client_message(struct wlr_xwm *xwm, wlr_data_source_dnd_finish(source); } - wlr_log(L_DEBUG, "DND_FINISH window=%d performed=%d action=%d", + wlr_log(WLR_DEBUG, "DND_FINISH window=%d performed=%d action=%d", target_window, performed, action); return 1; } else { @@ -289,7 +289,7 @@ static void seat_handle_drag_drop(struct wl_listener *listener, void *data) { return; // No xwayland surface focused } - wlr_log(L_DEBUG, "Wayland drag dropped over an Xwayland window"); + wlr_log(WLR_DEBUG, "Wayland drag dropped over an Xwayland window"); xwm_dnd_send_drop(xwm, event->time); } @@ -299,7 +299,7 @@ static void seat_handle_drag_destroy(struct wl_listener *listener, void *data) { // Don't reset drag focus yet because the target will read the drag source // right after if (xwm->drag_focus != NULL && !xwm->drag->source->accepted) { - wlr_log(L_DEBUG, "Wayland drag cancelled over an Xwayland window"); + wlr_log(WLR_DEBUG, "Wayland drag cancelled over an Xwayland window"); xwm_dnd_send_leave(xwm); } diff --git a/xwayland/selection/incoming.c b/xwayland/selection/incoming.c index 5deb2286..4e88bbe4 100644 --- a/xwayland/selection/incoming.c +++ b/xwayland/selection/incoming.c @@ -27,11 +27,11 @@ static int xwm_data_source_write(int fd, uint32_t mask, void *data) { xwm_selection_transfer_destroy_property_reply(transfer); xwm_selection_transfer_remove_source(transfer); xwm_selection_transfer_close_source_fd(transfer); - wlr_log(L_ERROR, "write error to target fd: %m"); + wlr_log(WLR_ERROR, "write error to target fd: %m"); return 1; } - wlr_log(L_DEBUG, "wrote %zd (chunk size %zd) of %d bytes", + wlr_log(WLR_DEBUG, "wrote %zd (chunk size %zd) of %d bytes", transfer->property_start + len, len, xcb_get_property_value_length(transfer->property_reply)); @@ -41,12 +41,12 @@ static int xwm_data_source_write(int fd, uint32_t mask, void *data) { xwm_selection_transfer_remove_source(transfer); if (transfer->incr) { - wlr_log(L_DEBUG, "deleting property"); + wlr_log(WLR_DEBUG, "deleting property"); xcb_delete_property(xwm->xcb_conn, transfer->selection->window, xwm->atoms[WL_SELECTION]); xcb_flush(xwm->xcb_conn); } else { - wlr_log(L_DEBUG, "transfer complete"); + wlr_log(WLR_DEBUG, "transfer complete"); xwm_selection_transfer_close_source_fd(transfer); } } @@ -74,7 +74,7 @@ static void xwm_write_property(struct wlr_xwm_selection_transfer *transfer, void xwm_get_incr_chunk(struct wlr_xwm_selection_transfer *transfer) { struct wlr_xwm *xwm = transfer->selection->xwm; - wlr_log(L_DEBUG, "xwm_get_incr_chunk"); + wlr_log(WLR_DEBUG, "xwm_get_incr_chunk"); xcb_get_property_cookie_t cookie = xcb_get_property(xwm->xcb_conn, 0, // delete @@ -88,7 +88,7 @@ void xwm_get_incr_chunk(struct wlr_xwm_selection_transfer *transfer) { xcb_get_property_reply_t *reply = xcb_get_property_reply(xwm->xcb_conn, cookie, NULL); if (reply == NULL) { - wlr_log(L_ERROR, "cannot get selection property"); + wlr_log(WLR_ERROR, "cannot get selection property"); return; } //dump_property(xwm, xwm->atoms[WL_SELECTION], reply); @@ -98,7 +98,7 @@ void xwm_get_incr_chunk(struct wlr_xwm_selection_transfer *transfer) { * for freeing it */ xwm_write_property(transfer, reply); } else { - wlr_log(L_DEBUG, "transfer complete"); + wlr_log(WLR_DEBUG, "transfer complete"); xwm_selection_transfer_close_source_fd(transfer); free(reply); } @@ -119,7 +119,7 @@ static void xwm_selection_get_data(struct wlr_xwm_selection *selection) { xcb_get_property_reply_t *reply = xcb_get_property_reply(xwm->xcb_conn, cookie, NULL); if (reply == NULL) { - wlr_log(L_ERROR, "Cannot get selection property"); + wlr_log(WLR_ERROR, "Cannot get selection property"); return; } @@ -156,7 +156,7 @@ static void source_send(struct wlr_xwm_selection *selection, ++i; } if (!found) { - wlr_log(L_DEBUG, "Cannot send X11 selection to Wayland: " + wlr_log(WLR_DEBUG, "Cannot send X11 selection to Wayland: " "unsupported MIME type"); return; } @@ -378,7 +378,7 @@ static void xwm_selection_get_targets(struct wlr_xwm_selection *selection) { void xwm_handle_selection_notify(struct wlr_xwm *xwm, xcb_selection_notify_event_t *event) { - wlr_log(L_DEBUG, "XCB_SELECTION_NOTIFY (selection=%u, property=%u, target=%u)", + wlr_log(WLR_DEBUG, "XCB_SELECTION_NOTIFY (selection=%u, property=%u, target=%u)", event->selection, event->property, event->target); @@ -389,11 +389,11 @@ void xwm_handle_selection_notify(struct wlr_xwm *xwm, } if (event->property == XCB_ATOM_NONE) { - wlr_log(L_ERROR, "convert selection failed"); + wlr_log(WLR_ERROR, "convert selection failed"); } else if (event->target == xwm->atoms[TARGETS]) { // No xwayland surface focused, deny access to clipboard if (xwm->focus_surface == NULL) { - wlr_log(L_DEBUG, "denying write access to clipboard: " + wlr_log(WLR_DEBUG, "denying write access to clipboard: " "no xwayland surface focused"); return; } @@ -407,7 +407,7 @@ void xwm_handle_selection_notify(struct wlr_xwm *xwm, int xwm_handle_xfixes_selection_notify(struct wlr_xwm *xwm, xcb_xfixes_selection_notify_event_t *event) { - wlr_log(L_DEBUG, "XCB_XFIXES_SELECTION_NOTIFY (selection=%u, owner=%u)", + wlr_log(WLR_DEBUG, "XCB_XFIXES_SELECTION_NOTIFY (selection=%u, owner=%u)", event->selection, event->owner); struct wlr_xwm_selection *selection = @@ -429,7 +429,7 @@ int xwm_handle_xfixes_selection_notify(struct wlr_xwm *xwm, } else if (selection == &xwm->dnd_selection) { // TODO: DND } else { - wlr_log(L_DEBUG, "X11 selection has been cleared, but cannot " + wlr_log(WLR_DEBUG, "X11 selection has been cleared, but cannot " "clear Wayland selection"); } } diff --git a/xwayland/selection/outgoing.c b/xwayland/selection/outgoing.c index 6d7565e3..156f0ad5 100644 --- a/xwayland/selection/outgoing.c +++ b/xwayland/selection/outgoing.c @@ -23,7 +23,7 @@ static void xwm_selection_send_notify(struct wlr_xwm *xwm, .property = success ? req->property : XCB_ATOM_NONE, }; - wlr_log(L_DEBUG, "SendEvent destination=%d SelectionNotify(31) time=%d " + wlr_log(WLR_DEBUG, "SendEvent destination=%d SelectionNotify(31) time=%d " "requestor=%d selection=%d target=%d property=%d", req->requestor, req->time, req->requestor, req->selection, req->target, selection_notify.property); @@ -82,7 +82,7 @@ static int xwm_data_source_read(int fd, uint32_t mask, void *data) { if (transfer->source_data.size < INCR_CHUNK_SIZE) { p = wl_array_add(&transfer->source_data, INCR_CHUNK_SIZE); if (p == NULL) { - wlr_log(L_ERROR, "Could not allocate selection source_data"); + wlr_log(WLR_ERROR, "Could not allocate selection source_data"); goto error_out; } } else { @@ -92,17 +92,17 @@ static int xwm_data_source_read(int fd, uint32_t mask, void *data) { size_t available = transfer->source_data.alloc - current; ssize_t len = read(fd, p, available); if (len == -1) { - wlr_log(L_ERROR, "read error from data source: %m"); + wlr_log(WLR_ERROR, "read error from data source: %m"); goto error_out; } - wlr_log(L_DEBUG, "read %zd bytes (available %zu, mask 0x%x)", len, + wlr_log(WLR_DEBUG, "read %zd bytes (available %zu, mask 0x%x)", len, available, mask); transfer->source_data.size = current + len; if (transfer->source_data.size >= INCR_CHUNK_SIZE) { if (!transfer->incr) { - wlr_log(L_DEBUG, "got %zu bytes, starting incr", + wlr_log(WLR_DEBUG, "got %zu bytes, starting incr", transfer->source_data.size); size_t incr_chunk_size = INCR_CHUNK_SIZE; @@ -119,37 +119,37 @@ static int xwm_data_source_read(int fd, uint32_t mask, void *data) { xwm_selection_transfer_remove_source(transfer); xwm_selection_send_notify(xwm, &transfer->request, true); } else if (transfer->property_set) { - wlr_log(L_DEBUG, "got %zu bytes, waiting for property delete", + wlr_log(WLR_DEBUG, "got %zu bytes, waiting for property delete", transfer->source_data.size); transfer->flush_property_on_delete = true; xwm_selection_transfer_remove_source(transfer); } else { - wlr_log(L_DEBUG, "got %zu bytes, property deleted, setting new " + wlr_log(WLR_DEBUG, "got %zu bytes, property deleted, setting new " "property", transfer->source_data.size); xwm_selection_flush_source_data(transfer); } } else if (len == 0 && !transfer->incr) { - wlr_log(L_DEBUG, "non-incr transfer complete"); + wlr_log(WLR_DEBUG, "non-incr transfer complete"); xwm_selection_flush_source_data(transfer); xwm_selection_send_notify(xwm, &transfer->request, true); xwm_selection_transfer_destroy_outgoing(transfer); } else if (len == 0 && transfer->incr) { - wlr_log(L_DEBUG, "incr transfer complete"); + wlr_log(WLR_DEBUG, "incr transfer complete"); transfer->flush_property_on_delete = true; if (transfer->property_set) { - wlr_log(L_DEBUG, "got %zu bytes, waiting for property delete", + wlr_log(WLR_DEBUG, "got %zu bytes, waiting for property delete", transfer->source_data.size); } else { - wlr_log(L_DEBUG, "got %zu bytes, property deleted, setting new " + wlr_log(WLR_DEBUG, "got %zu bytes, property deleted, setting new " "property", transfer->source_data.size); xwm_selection_flush_source_data(transfer); } xwm_selection_transfer_remove_source(transfer); xwm_selection_transfer_close_source_fd(transfer); } else { - wlr_log(L_DEBUG, "nothing happened, buffered the bytes"); + wlr_log(WLR_DEBUG, "nothing happened, buffered the bytes"); } return 1; @@ -161,11 +161,11 @@ error_out: } void xwm_send_incr_chunk(struct wlr_xwm_selection_transfer *transfer) { - wlr_log(L_DEBUG, "property deleted"); + wlr_log(WLR_DEBUG, "property deleted"); transfer->property_set = false; if (transfer->flush_property_on_delete) { - wlr_log(L_DEBUG, "setting new property, %zu bytes", + wlr_log(WLR_DEBUG, "setting new property, %zu bytes", transfer->source_data.size); transfer->flush_property_on_delete = false; int length = xwm_selection_flush_source_data(transfer); @@ -211,7 +211,7 @@ static void xwm_selection_source_send(struct wlr_xwm_selection *selection, } } - wlr_log(L_DEBUG, "not sending selection: no selection source available"); + wlr_log(WLR_DEBUG, "not sending selection: no selection source available"); } static void xwm_selection_transfer_start_outgoing( @@ -256,7 +256,7 @@ static void xwm_selection_send_data(struct wlr_xwm_selection *selection, struct wl_array *mime_types = xwm_selection_source_get_mime_types(selection); if (mime_types == NULL) { - wlr_log(L_ERROR, "not sending selection: no MIME type list available"); + wlr_log(WLR_ERROR, "not sending selection: no MIME type list available"); xwm_selection_send_notify(selection->xwm, req, false); return; } @@ -271,7 +271,7 @@ static void xwm_selection_send_data(struct wlr_xwm_selection *selection, } } if (!found) { - wlr_log(L_ERROR, "not sending selection: " + wlr_log(WLR_ERROR, "not sending selection: " "requested an unsupported MIME type %s", mime_type); xwm_selection_send_notify(selection->xwm, req, false); return; @@ -280,7 +280,7 @@ static void xwm_selection_send_data(struct wlr_xwm_selection *selection, struct wlr_xwm_selection_transfer *transfer = calloc(1, sizeof(struct wlr_xwm_selection_transfer)); if (transfer == NULL) { - wlr_log(L_ERROR, "Allocation failed"); + wlr_log(WLR_ERROR, "Allocation failed"); return; } transfer->selection = selection; @@ -289,7 +289,7 @@ static void xwm_selection_send_data(struct wlr_xwm_selection *selection, int p[2]; if (pipe(p) == -1) { - wlr_log(L_ERROR, "pipe() failed: %m"); + wlr_log(WLR_ERROR, "pipe() failed: %m"); xwm_selection_send_notify(selection->xwm, req, false); return; } @@ -300,7 +300,7 @@ static void xwm_selection_send_data(struct wlr_xwm_selection *selection, transfer->source_fd = p[0]; - wlr_log(L_DEBUG, "Sending Wayland selection %u to Xwayland window with " + wlr_log(WLR_DEBUG, "Sending Wayland selection %u to Xwayland window with " "MIME type %s, target %u", req->target, mime_type, req->target); xwm_selection_source_send(selection, mime_type, p[1]); @@ -319,7 +319,7 @@ static void xwm_selection_send_targets(struct wlr_xwm_selection *selection, struct wl_array *mime_types = xwm_selection_source_get_mime_types(selection); if (mime_types == NULL) { - wlr_log(L_ERROR, "not sending selection targets: " + wlr_log(WLR_ERROR, "not sending selection targets: " "no selection source available"); xwm_selection_send_notify(selection->xwm, req, false); return; @@ -364,7 +364,7 @@ static void xwm_selection_send_timestamp(struct wlr_xwm_selection *selection, void xwm_handle_selection_request(struct wlr_xwm *xwm, xcb_selection_request_event_t *req) { - wlr_log(L_DEBUG, "XCB_SELECTION_REQUEST (time=%u owner=%u, requestor=%u " + wlr_log(WLR_DEBUG, "XCB_SELECTION_REQUEST (time=%u owner=%u, requestor=%u " "selection=%u, target=%u, property=%u)", req->time, req->owner, req->requestor, req->selection, req->target, req->property); @@ -380,19 +380,19 @@ void xwm_handle_selection_request(struct wlr_xwm *xwm, struct wlr_xwm_selection *selection = xwm_get_selection(xwm, req->selection); if (selection == NULL) { - wlr_log(L_DEBUG, "received selection request for unknown selection"); + wlr_log(WLR_DEBUG, "received selection request for unknown selection"); return; } if (selection->window != req->owner) { - wlr_log(L_DEBUG, "received selection request with invalid owner"); + wlr_log(WLR_DEBUG, "received selection request with invalid owner"); return; } // No xwayland surface focused, deny access to clipboard if (xwm->focus_surface == NULL && xwm->drag_focus == NULL) { char *selection_name = xwm_get_atom_name(xwm, selection->atom); - wlr_log(L_DEBUG, "denying read access to selection %u (%s): " + wlr_log(WLR_DEBUG, "denying read access to selection %u (%s): " "no xwayland surface focused", selection->atom, selection_name); free(selection_name); xwm_selection_send_notify(xwm, req, false); @@ -409,7 +409,7 @@ void xwm_handle_selection_request(struct wlr_xwm *xwm, // Send data char *mime_type = xwm_mime_type_from_atom(xwm, req->target); if (mime_type == NULL) { - wlr_log(L_ERROR, "ignoring selection request: unknown atom %u", + wlr_log(WLR_ERROR, "ignoring selection request: unknown atom %u", req->target); xwm_selection_send_notify(xwm, req, false); return; diff --git a/xwayland/selection/selection.c b/xwayland/selection/selection.c index 6b57f7c3..e16ad111 100644 --- a/xwayland/selection/selection.c +++ b/xwayland/selection/selection.c @@ -114,7 +114,7 @@ static int xwm_handle_selection_property_notify(struct wlr_xwm *xwm, int xwm_handle_selection_event(struct wlr_xwm *xwm, xcb_generic_event_t *event) { if (xwm->seat == NULL) { - wlr_log(L_DEBUG, "not handling selection events: " + wlr_log(WLR_DEBUG, "not handling selection events: " "no seat assigned to xwayland"); return 0; } diff --git a/xwayland/sockets.c b/xwayland/sockets.c index 1e943b1d..2b0b5ced 100644 --- a/xwayland/sockets.c +++ b/xwayland/sockets.c @@ -31,7 +31,7 @@ static int open_socket(struct sockaddr_un *addr, size_t path_size) { fd = socket(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0); if (fd < 0) { - wlr_log_errno(L_DEBUG, "Failed to create socket %c%s", + wlr_log_errno(WLR_DEBUG, "Failed to create socket %c%s", addr->sun_path[0] ? addr->sun_path[0] : '@', addr->sun_path + 1); return -1; @@ -42,14 +42,14 @@ static int open_socket(struct sockaddr_un *addr, size_t path_size) { } if (bind(fd, (struct sockaddr*)addr, size) < 0) { rc = errno; - wlr_log_errno(L_DEBUG, "Failed to bind socket %c%s", + wlr_log_errno(WLR_DEBUG, "Failed to bind socket %c%s", addr->sun_path[0] ? addr->sun_path[0] : '@', addr->sun_path + 1); goto cleanup; } if (listen(fd, 1) < 0) { rc = errno; - wlr_log_errno(L_DEBUG, "Failed to listen to socket %c%s", + wlr_log_errno(WLR_DEBUG, "Failed to listen to socket %c%s", addr->sun_path[0] ? addr->sun_path[0] : '@', addr->sun_path + 1); goto cleanup; @@ -160,7 +160,7 @@ int open_display_sockets(int socks[2]) { } if (display > 32) { - wlr_log(L_ERROR, "No display available in the first 33"); + wlr_log(WLR_ERROR, "No display available in the first 33"); return -1; } diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index 36d75845..1068b942 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -47,7 +47,7 @@ static void safe_close(int fd) { static int unset_cloexec(int fd) { if (fcntl(fd, F_SETFD, 0) != 0) { - wlr_log_errno(L_ERROR, "fcntl() failed on fd %d", fd); + wlr_log_errno(WLR_ERROR, "fcntl() failed on fd %d", fd); return -1; } return 0; @@ -98,19 +98,19 @@ static void exec_xwayland(struct wlr_xwayland *wlr_xwayland) { fill_arg(&cur_arg, "%d", wlr_xwayland->x_fd[0]) < 0 || fill_arg(&cur_arg, "%d", wlr_xwayland->x_fd[1]) < 0 || fill_arg(&cur_arg, "%d", wlr_xwayland->wm_fd[1]) < 0) { - wlr_log_errno(L_ERROR, "alloc/print failure"); + wlr_log_errno(WLR_ERROR, "alloc/print failure"); _exit(EXIT_FAILURE); } const char *xdg_runtime = getenv("XDG_RUNTIME_DIR"); const char *path_var = getenv("PATH"); if (!xdg_runtime) { - wlr_log(L_ERROR, "XDG_RUNTIME_DIR is not set"); + wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set"); _exit(EXIT_FAILURE); } if (clearenv()) { - wlr_log_errno(L_ERROR, "clearenv failed"); + wlr_log_errno(WLR_ERROR, "clearenv failed"); _exit(EXIT_FAILURE); } setenv("XDG_RUNTIME_DIR", xdg_runtime, true); @@ -119,7 +119,7 @@ static void exec_xwayland(struct wlr_xwayland *wlr_xwayland) { snprintf(wayland_socket_str, sizeof(wayland_socket_str), "%d", wlr_xwayland->wl_fd[1]); setenv("WAYLAND_SOCKET", wayland_socket_str, true); - wlr_log(L_INFO, "WAYLAND_SOCKET=%d Xwayland :%d -rootless -terminate -listen %d -listen %d -wm %d", + wlr_log(WLR_INFO, "WAYLAND_SOCKET=%d Xwayland :%d -rootless -terminate -listen %d -listen %d -wm %d", wlr_xwayland->wl_fd[1], wlr_xwayland->display, wlr_xwayland->x_fd[0], wlr_xwayland->x_fd[1], wlr_xwayland->wm_fd[1]); @@ -207,10 +207,10 @@ static void handle_client_destroy(struct wl_listener *listener, void *data) { if (time(NULL) - wlr_xwayland->server_start > 5) { if (wlr_xwayland->lazy) { - wlr_log(L_INFO, "Restarting Xwayland (lazy)"); + wlr_log(WLR_INFO, "Restarting Xwayland (lazy)"); xwayland_start_server_lazy(wlr_xwayland); } else { - wlr_log(L_INFO, "Restarting Xwayland"); + wlr_log(WLR_INFO, "Restarting Xwayland"); xwayland_start_server(wlr_xwayland); } } @@ -237,14 +237,14 @@ static int xserver_handle_ready(int signal_number, void *data) { if (errno == EINTR) { continue; } - wlr_log_errno(L_ERROR, "waitpid for Xwayland fork failed"); + wlr_log_errno(WLR_ERROR, "waitpid for Xwayland fork failed"); return 1; } if (stat_val) { - wlr_log(L_ERROR, "Xwayland startup failed, not setting up xwm"); + wlr_log(WLR_ERROR, "Xwayland startup failed, not setting up xwm"); return 1; } - wlr_log(L_DEBUG, "Xserver is ready"); + wlr_log(WLR_DEBUG, "Xserver is ready"); wlr_xwayland->xwm = xwm_create(wlr_xwayland); if (!wlr_xwayland->xwm) { @@ -311,14 +311,14 @@ static bool xwayland_start_server(struct wlr_xwayland *wlr_xwayland) { if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, wlr_xwayland->wl_fd) != 0 || socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, wlr_xwayland->wm_fd) != 0) { - wlr_log_errno(L_ERROR, "failed to create socketpair"); + wlr_log_errno(WLR_ERROR, "failed to create socketpair"); xwayland_finish_server(wlr_xwayland); return false; } wlr_xwayland->server_start = time(NULL); if (!(wlr_xwayland->client = wl_client_create(wlr_xwayland->wl_display, wlr_xwayland->wl_fd[0]))) { - wlr_log_errno(L_ERROR, "wl_client_create failed"); + wlr_log_errno(WLR_ERROR, "wl_client_create failed"); xwayland_finish_server(wlr_xwayland); return false; } @@ -346,16 +346,16 @@ static bool xwayland_start_server(struct wlr_xwayland *wlr_xwayland) { sigprocmask(SIG_BLOCK, &sigset, NULL); if ((pid = fork()) == 0) { exec_xwayland(wlr_xwayland); - wlr_log_errno(L_ERROR, "failed to exec Xwayland"); + wlr_log_errno(WLR_ERROR, "failed to exec Xwayland"); _exit(EXIT_FAILURE); } if (pid < 0) { - wlr_log_errno(L_ERROR, "second fork failed"); + wlr_log_errno(WLR_ERROR, "second fork failed"); _exit(EXIT_FAILURE); } sigwait(&sigset, &sig); kill(ppid, SIGUSR1); - wlr_log(L_DEBUG, "sent SIGUSR1 to process %d", ppid); + wlr_log(WLR_DEBUG, "sent SIGUSR1 to process %d", ppid); if (sig == SIGCHLD) { waitpid(pid, NULL, 0); _exit(EXIT_FAILURE); @@ -363,7 +363,7 @@ static bool xwayland_start_server(struct wlr_xwayland *wlr_xwayland) { _exit(EXIT_SUCCESS); } if (wlr_xwayland->pid < 0) { - wlr_log_errno(L_ERROR, "fork failed"); + wlr_log_errno(WLR_ERROR, "fork failed"); xwayland_finish_server(wlr_xwayland); return false; } diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 62d6a861..2a73a449 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -118,7 +118,7 @@ static struct wlr_xwayland_surface *xwayland_surface_create( struct wlr_xwayland_surface *surface = calloc(1, sizeof(struct wlr_xwayland_surface)); if (!surface) { - wlr_log(L_ERROR, "Could not allocate wlr xwayland surface"); + wlr_log(WLR_ERROR, "Could not allocate wlr xwayland surface"); return NULL; } @@ -170,7 +170,7 @@ static struct wlr_xwayland_surface *xwayland_surface_create( xwayland_surface_handle_ping_timeout, surface); if (surface->ping_timer == NULL) { free(surface); - wlr_log(L_ERROR, "Could not add timer to event loop"); + wlr_log(WLR_ERROR, "Could not add timer to event loop"); return NULL; } @@ -355,7 +355,7 @@ static void read_surface_class(struct wlr_xwm *xwm, surface->class = NULL; } - wlr_log(L_DEBUG, "XCB_ATOM_WM_CLASS: %s %s", surface->instance, + wlr_log(WLR_DEBUG, "XCB_ATOM_WM_CLASS: %s %s", surface->instance, surface->class); wlr_signal_emit_safe(&surface->events.set_class, surface); } @@ -384,7 +384,7 @@ static void read_surface_title(struct wlr_xwm *xwm, } xsurface->has_utf8_title = is_utf8; - wlr_log(L_DEBUG, "XCB_ATOM_WM_NAME: %s", xsurface->title); + wlr_log(WLR_DEBUG, "XCB_ATOM_WM_NAME: %s", xsurface->title); wlr_signal_emit_safe(&xsurface->events.set_title, xsurface); } @@ -409,7 +409,7 @@ static void read_surface_parent(struct wlr_xwm *xwm, wl_list_init(&xsurface->parent_link); } - wlr_log(L_DEBUG, "XCB_ATOM_WM_TRANSIENT_FOR: %p", xsurface->parent); + wlr_log(WLR_DEBUG, "XCB_ATOM_WM_TRANSIENT_FOR: %p", xsurface->parent); wlr_signal_emit_safe(&xsurface->events.set_parent, xsurface); } @@ -422,7 +422,7 @@ static void read_surface_pid(struct wlr_xwm *xwm, pid_t *pid = xcb_get_property_value(reply); xsurface->pid = *pid; - wlr_log(L_DEBUG, "NET_WM_PID %d", xsurface->pid); + wlr_log(WLR_DEBUG, "NET_WM_PID %d", xsurface->pid); wlr_signal_emit_safe(&xsurface->events.set_pid, xsurface); } @@ -445,7 +445,7 @@ static void read_surface_window_type(struct wlr_xwm *xwm, memcpy(xsurface->window_type, atoms, atoms_size); xsurface->window_type_len = atoms_len; - wlr_log(L_DEBUG, "NET_WM_WINDOW_TYPE (%zu)", atoms_len); + wlr_log(WLR_DEBUG, "NET_WM_WINDOW_TYPE (%zu)", atoms_len); wlr_signal_emit_safe(&xsurface->events.set_window_type, xsurface); } @@ -468,7 +468,7 @@ static void read_surface_protocols(struct wlr_xwm *xwm, memcpy(xsurface->protocols, atoms, atoms_size); xsurface->protocols_len = atoms_len; - wlr_log(L_DEBUG, "WM_PROTOCOLS (%zu)", atoms_len); + wlr_log(WLR_DEBUG, "WM_PROTOCOLS (%zu)", atoms_len); } #ifdef WLR_HAS_XCB_ICCCM @@ -492,7 +492,7 @@ static void read_surface_hints(struct wlr_xwm *xwm, memcpy(xsurface->hints, &hints, sizeof(struct wlr_xwayland_surface_hints)); xsurface->hints_urgency = xcb_icccm_wm_hints_get_urgency(&hints); - wlr_log(L_DEBUG, "WM_HINTS (%d)", reply->value_len); + wlr_log(WLR_DEBUG, "WM_HINTS (%d)", reply->value_len); } #else static void read_surface_hints(struct wlr_xwm *xwm, @@ -522,7 +522,7 @@ static void read_surface_normal_hints(struct wlr_xwm *xwm, memcpy(xsurface->size_hints, &size_hints, sizeof(struct wlr_xwayland_surface_size_hints)); - wlr_log(L_DEBUG, "WM_NORMAL_HINTS (%d)", reply->value_len); + wlr_log(WLR_DEBUG, "WM_NORMAL_HINTS (%d)", reply->value_len); } #else static void read_surface_normal_hints(struct wlr_xwm *xwm, @@ -565,7 +565,7 @@ static void read_surface_motif_hints(struct wlr_xwm *xwm, } } - wlr_log(L_DEBUG, "MOTIF_WM_HINTS (%d)", reply->value_len); + wlr_log(WLR_DEBUG, "MOTIF_WM_HINTS (%d)", reply->value_len); } static void read_surface_net_wm_state(struct wlr_xwm *xwm, @@ -632,7 +632,7 @@ static void read_surface_property(struct wlr_xwm *xwm, read_surface_motif_hints(xwm, xsurface, reply); } else { char *prop_name = xwm_get_atom_name(xwm, property); - wlr_log(L_DEBUG, "unhandled X11 property %u (%s) for window %u", + wlr_log(WLR_DEBUG, "unhandled X11 property %u (%s) for window %u", property, prop_name, xsurface->window_id); free(prop_name); } @@ -709,7 +709,7 @@ static void xsurface_unmap(struct wlr_xwayland_surface *surface) { static void xwm_handle_create_notify(struct wlr_xwm *xwm, xcb_create_notify_event_t *ev) { - wlr_log(L_DEBUG, "XCB_CREATE_NOTIFY (%u)", ev->window); + wlr_log(WLR_DEBUG, "XCB_CREATE_NOTIFY (%u)", ev->window); if (ev->window == xwm->window || ev->window == xwm->selection_window || @@ -723,7 +723,7 @@ static void xwm_handle_create_notify(struct wlr_xwm *xwm, static void xwm_handle_destroy_notify(struct wlr_xwm *xwm, xcb_destroy_notify_event_t *ev) { - wlr_log(L_DEBUG, "XCB_DESTROY_NOTIFY (%u)", ev->window); + wlr_log(WLR_DEBUG, "XCB_DESTROY_NOTIFY (%u)", ev->window); struct wlr_xwayland_surface *xsurface = lookup_surface(xwm, ev->window); if (xsurface == NULL) { return; @@ -733,7 +733,7 @@ static void xwm_handle_destroy_notify(struct wlr_xwm *xwm, static void xwm_handle_configure_request(struct wlr_xwm *xwm, xcb_configure_request_event_t *ev) { - wlr_log(L_DEBUG, "XCB_CONFIGURE_REQUEST (%u) [%ux%u+%d,%d]", ev->window, + wlr_log(WLR_DEBUG, "XCB_CONFIGURE_REQUEST (%u) [%ux%u+%d,%d]", ev->window, ev->width, ev->height, ev->x, ev->y); struct wlr_xwayland_surface *surface = lookup_surface(xwm, ev->window); if (surface == NULL) { @@ -791,7 +791,7 @@ static void xsurface_set_wm_state(struct wlr_xwayland_surface *xsurface, static void xwm_handle_map_request(struct wlr_xwm *xwm, xcb_map_request_event_t *ev) { - wlr_log(L_DEBUG, "XCB_MAP_REQUEST (%u)", ev->window); + wlr_log(WLR_DEBUG, "XCB_MAP_REQUEST (%u)", ev->window); struct wlr_xwayland_surface *xsurface = lookup_surface(xwm, ev->window); if (!xsurface) { return; @@ -804,12 +804,12 @@ static void xwm_handle_map_request(struct wlr_xwm *xwm, static void xwm_handle_map_notify(struct wlr_xwm *xwm, xcb_map_notify_event_t *ev) { - wlr_log(L_DEBUG, "XCB_MAP_NOTIFY (%u)", ev->window); + wlr_log(WLR_DEBUG, "XCB_MAP_NOTIFY (%u)", ev->window); } static void xwm_handle_unmap_notify(struct wlr_xwm *xwm, xcb_unmap_notify_event_t *ev) { - wlr_log(L_DEBUG, "XCB_UNMAP_NOTIFY (%u)", ev->window); + wlr_log(WLR_DEBUG, "XCB_UNMAP_NOTIFY (%u)", ev->window); struct wlr_xwayland_surface *xsurface = lookup_surface(xwm, ev->window); if (xsurface == NULL) { return; @@ -821,7 +821,7 @@ static void xwm_handle_unmap_notify(struct wlr_xwm *xwm, static void xwm_handle_property_notify(struct wlr_xwm *xwm, xcb_property_notify_event_t *ev) { - wlr_log(L_DEBUG, "XCB_PROPERTY_NOTIFY (%u)", ev->window); + wlr_log(WLR_DEBUG, "XCB_PROPERTY_NOTIFY (%u)", ev->window); struct wlr_xwayland_surface *xsurface = lookup_surface(xwm, ev->window); if (xsurface == NULL) { return; @@ -834,7 +834,7 @@ static void xwm_handle_surface_id_message(struct wlr_xwm *xwm, xcb_client_message_event_t *ev) { struct wlr_xwayland_surface *xsurface = lookup_surface(xwm, ev->window); if (xsurface == NULL) { - wlr_log(L_DEBUG, + wlr_log(WLR_DEBUG, "client message WL_SURFACE_ID but no new window %u ?", ev->window); return; @@ -1040,7 +1040,7 @@ static void xwm_handle_wm_protocols_message(struct wlr_xwm *xwm, surface->pinging = false; } else { char *type_name = xwm_get_atom_name(xwm, type); - wlr_log(L_DEBUG, "unhandled WM_PROTOCOLS client message %u (%s)", + wlr_log(WLR_DEBUG, "unhandled WM_PROTOCOLS client message %u (%s)", type, type_name); free(type_name); } @@ -1048,7 +1048,7 @@ static void xwm_handle_wm_protocols_message(struct wlr_xwm *xwm, static void xwm_handle_client_message(struct wlr_xwm *xwm, xcb_client_message_event_t *ev) { - wlr_log(L_DEBUG, "XCB_CLIENT_MESSAGE (%u)", ev->window); + wlr_log(WLR_DEBUG, "XCB_CLIENT_MESSAGE (%u)", ev->window); if (ev->type == xwm->atoms[WL_SURFACE_ID]) { xwm_handle_surface_id_message(xwm, ev); @@ -1060,7 +1060,7 @@ static void xwm_handle_client_message(struct wlr_xwm *xwm, xwm_handle_wm_protocols_message(xwm, ev); } else if (!xwm_handle_selection_client_message(xwm, ev)) { char *type_name = xwm_get_atom_name(xwm, ev->type); - wlr_log(L_DEBUG, "unhandled x11 client message %u (%s)", ev->type, + wlr_log(WLR_DEBUG, "unhandled x11 client message %u (%s)", ev->type, type_name); free(type_name); } @@ -1087,7 +1087,7 @@ static void xwm_handle_xcb_error(struct wlr_xwm *xwm, xcb_value_error_t *ev) { xcb_errors_get_name_for_major_code(xwm->errors_context, ev->major_opcode); if (!major_name) { - wlr_log(L_DEBUG, "xcb error happened, but could not get major name"); + wlr_log(WLR_DEBUG, "xcb error happened, but could not get major name"); goto log_raw; } @@ -1100,11 +1100,11 @@ static void xwm_handle_xcb_error(struct wlr_xwm *xwm, xcb_value_error_t *ev) { xcb_errors_get_name_for_error(xwm->errors_context, ev->error_code, &extension); if (!error_name) { - wlr_log(L_DEBUG, "xcb error happened, but could not get error name"); + wlr_log(WLR_DEBUG, "xcb error happened, but could not get error name"); goto log_raw; } - wlr_log(L_ERROR, "xcb error: op %s (%s), code %s (%s), sequence %"PRIu16", value %"PRIu32, + wlr_log(WLR_ERROR, "xcb error: op %s (%s), code %s (%s), sequence %"PRIu16", value %"PRIu32, major_name, minor_name ? minor_name : "no minor", error_name, extension ? extension : "no extension", ev->sequence, ev->bad_value); @@ -1112,7 +1112,7 @@ static void xwm_handle_xcb_error(struct wlr_xwm *xwm, xcb_value_error_t *ev) { return; log_raw: #endif - wlr_log(L_ERROR, + wlr_log(WLR_ERROR, "xcb error: op %"PRIu8":%"PRIu16", code %"PRIu8", sequence %"PRIu16", value %"PRIu32, ev->major_opcode, ev->minor_opcode, ev->error_code, ev->sequence, ev->bad_value); @@ -1126,14 +1126,14 @@ static void xwm_handle_unhandled_event(struct wlr_xwm *xwm, xcb_generic_event_t xcb_errors_get_name_for_xcb_event(xwm->errors_context, ev, &extension); if (!event_name) { - wlr_log(L_DEBUG, "no name for unhandled event: %u", + wlr_log(WLR_DEBUG, "no name for unhandled event: %u", ev->response_type); return; } - wlr_log(L_DEBUG, "unhandled X11 event: %s (%u)", event_name, ev->response_type); + wlr_log(WLR_DEBUG, "unhandled X11 event: %s (%u)", event_name, ev->response_type); #else - wlr_log(L_DEBUG, "unhandled X11 event: %u", ev->response_type); + wlr_log(WLR_DEBUG, "unhandled X11 event: %u", ev->response_type); #endif } @@ -1215,7 +1215,7 @@ static void handle_compositor_new_surface(struct wl_listener *listener, return; } - wlr_log(L_DEBUG, "New xwayland surface: %p", surface); + wlr_log(WLR_DEBUG, "New xwayland surface: %p", surface); uint32_t surface_id = wl_resource_get_id(surface->resource); struct wlr_xwayland_surface *xsurface; @@ -1345,7 +1345,7 @@ static void xwm_get_resources(struct wlr_xwm *xwm) { free(reply); if (error) { - wlr_log(L_ERROR, "could not resolve atom %s, x11 error code %d", + wlr_log(WLR_ERROR, "could not resolve atom %s, x11 error code %d", atom_map[i], error->error_code); free(error); return; @@ -1355,7 +1355,7 @@ static void xwm_get_resources(struct wlr_xwm *xwm) { xwm->xfixes = xcb_get_extension_data(xwm->xcb_conn, &xcb_xfixes_id); if (!xwm->xfixes || !xwm->xfixes->present) { - wlr_log(L_DEBUG, "xfixes not available"); + wlr_log(WLR_DEBUG, "xfixes not available"); } xcb_xfixes_query_version_cookie_t xfixes_cookie; @@ -1366,7 +1366,7 @@ static void xwm_get_resources(struct wlr_xwm *xwm) { xfixes_reply = xcb_xfixes_query_version_reply(xwm->xcb_conn, xfixes_cookie, NULL); - wlr_log(L_DEBUG, "xfixes version: %d.%d", + wlr_log(WLR_DEBUG, "xfixes version: %d.%d", xfixes_reply->major_version, xfixes_reply->minor_version); free(xfixes_reply); @@ -1442,7 +1442,7 @@ static void xwm_get_visual_and_colormap(struct wlr_xwm *xwm) { } if (visualtype == NULL) { - wlr_log(L_DEBUG, "No 32 bit visualtype\n"); + wlr_log(WLR_DEBUG, "No 32 bit visualtype\n"); return; } @@ -1461,7 +1461,7 @@ static void xwm_get_render_format(struct wlr_xwm *xwm) { xcb_render_query_pict_formats_reply_t *reply = xcb_render_query_pict_formats_reply(xwm->xcb_conn, cookie, NULL); if (!reply) { - wlr_log(L_ERROR, "Did not get any reply from xcb_render_query_pict_formats"); + wlr_log(WLR_ERROR, "Did not get any reply from xcb_render_query_pict_formats"); return; } xcb_render_pictforminfo_iterator_t iter = @@ -1477,7 +1477,7 @@ static void xwm_get_render_format(struct wlr_xwm *xwm) { } if (format == NULL) { - wlr_log(L_DEBUG, "No 32 bit render format"); + wlr_log(WLR_DEBUG, "No 32 bit render format"); free(reply); return; } @@ -1489,7 +1489,7 @@ static void xwm_get_render_format(struct wlr_xwm *xwm) { void xwm_set_cursor(struct wlr_xwm *xwm, const uint8_t *pixels, uint32_t stride, uint32_t width, uint32_t height, int32_t hotspot_x, int32_t hotspot_y) { if (!xwm->render_format_id) { - wlr_log(L_ERROR, "Cannot set xwm cursor: no render format available"); + wlr_log(WLR_ERROR, "Cannot set xwm cursor: no render format available"); return; } if (xwm->cursor) { @@ -1540,7 +1540,7 @@ struct wlr_xwm *xwm_create(struct wlr_xwayland *wlr_xwayland) { int rc = xcb_connection_has_error(xwm->xcb_conn); if (rc) { - wlr_log(L_ERROR, "xcb connect failed: %d", rc); + wlr_log(WLR_ERROR, "xcb connect failed: %d", rc); close(wlr_xwayland->wm_fd[0]); free(xwm); return NULL; @@ -1548,7 +1548,7 @@ struct wlr_xwm *xwm_create(struct wlr_xwayland *wlr_xwayland) { #ifdef WLR_HAS_XCB_ERRORS if (xcb_errors_context_new(xwm->xcb_conn, &xwm->errors_context)) { - wlr_log(L_ERROR, "Could not allocate error context"); + wlr_log(WLR_ERROR, "Could not allocate error context"); xwm_destroy(xwm); return NULL; }