aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/selection/dnd.c16
-rw-r--r--xwayland/selection/incoming.c28
-rw-r--r--xwayland/selection/outgoing.c52
-rw-r--r--xwayland/selection/selection.c2
-rw-r--r--xwayland/sockets.c8
-rw-r--r--xwayland/xwayland.c32
-rw-r--r--xwayland/xwm.c80
7 files changed, 109 insertions, 109 deletions
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;
}