mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
Deny access to clipboard if no xwayland window is focused
This commit is contained in:
parent
343efd0c20
commit
b884025558
1 changed files with 17 additions and 1 deletions
|
@ -238,6 +238,7 @@ static void xwm_handle_selection_request(struct wlr_xwm *xwm,
|
|||
(xcb_selection_request_event_t *) event;
|
||||
|
||||
if (selection_request->selection != xwm->atoms[CLIPBOARD]) {
|
||||
xwm_send_selection_notify(xwm, XCB_ATOM_NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -255,11 +256,19 @@ static void xwm_handle_selection_request(struct wlr_xwm *xwm,
|
|||
}
|
||||
|
||||
if (xwm->seat->selection_source == NULL) {
|
||||
wlr_log(L_DEBUG, "not handling selection request:"
|
||||
wlr_log(L_DEBUG, "not handling selection request: "
|
||||
"no selection source assigned to xwayland seat");
|
||||
return;
|
||||
}
|
||||
|
||||
// No xwayland surface focused, deny access to clipboard
|
||||
if (xwm->focus_surface == NULL) {
|
||||
wlr_log(L_DEBUG, "denying read access to clipboard: "
|
||||
"no xwayland surface focused");
|
||||
xwm_send_selection_notify(xwm, XCB_ATOM_NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (selection_request->target == xwm->atoms[TARGETS]) {
|
||||
xwm_send_targets(xwm);
|
||||
} else if (selection_request->target == xwm->atoms[TIMESTAMP]) {
|
||||
|
@ -531,6 +540,13 @@ static void xwm_handle_selection_notify(struct wlr_xwm *xwm,
|
|||
return;
|
||||
}
|
||||
|
||||
// No xwayland surface focused, deny access to clipboard
|
||||
if (xwm->focus_surface == NULL) {
|
||||
wlr_log(L_DEBUG, "denying write access to clipboard: "
|
||||
"no xwayland surface focused");
|
||||
return;
|
||||
}
|
||||
|
||||
if (selection_notify->property == XCB_ATOM_NONE) {
|
||||
wlr_log(L_ERROR, "convert selection failed");
|
||||
} else if (selection_notify->target == xwm->atoms[TARGETS]) {
|
||||
|
|
Loading…
Reference in a new issue