mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
xwayland: avoid calling xwm_get_atom_name() when debug logs are off
xwm_get_atom_name() performs a roundtrip to the X11 server. Avoid calling this blocking function if debug logs are turned off.
This commit is contained in:
parent
60ca6f17eb
commit
d40bcfe2c1
2 changed files with 11 additions and 8 deletions
|
|
@ -412,10 +412,12 @@ void xwm_handle_selection_request(struct wlr_xwm *xwm,
|
|||
|
||||
// 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(WLR_DEBUG, "denying read access to selection %u (%s): "
|
||||
"no xwayland surface focused", selection->atom, selection_name);
|
||||
free(selection_name);
|
||||
if (wlr_log_get_verbosity() >= WLR_DEBUG) {
|
||||
char *selection_name = xwm_get_atom_name(xwm, selection->atom);
|
||||
wlr_log(WLR_DEBUG, "denying read access to selection %u (%s): "
|
||||
"no xwayland surface focused", selection->atom, selection_name);
|
||||
free(selection_name);
|
||||
}
|
||||
goto fail_notify_requestor;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue