mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
util: add wlr_ prefix to log symbols
This commit is contained in:
parent
ffc8780893
commit
7cbef15206
98 changed files with 631 additions and 629 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue