From 7cbef152063e1fbb24e6204339ff4587a74be04b Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 9 Jul 2018 22:49:54 +0100 Subject: util: add wlr_ prefix to log symbols --- xwayland/selection/dnd.c | 16 ++++++------- xwayland/selection/incoming.c | 28 +++++++++++------------ xwayland/selection/outgoing.c | 52 +++++++++++++++++++++--------------------- xwayland/selection/selection.c | 2 +- 4 files changed, 49 insertions(+), 49 deletions(-) (limited to 'xwayland/selection') 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; } -- cgit v1.2.3