window-rules: add ignoreFocusRequest property

This allows to reject focus requests from specific applications.
This commit is contained in:
Consolatis 2023-09-03 14:01:40 +02:00
parent 272222e3c9
commit bb235337d8
6 changed files with 21 additions and 0 deletions

View file

@ -590,6 +590,11 @@ xdg_activation_handle_request(struct wl_listener *listener, void *data)
* for the seat / serial being correct and then allow the request.
*/
if (window_rules_get_property(view, "ignoreFocusRequest") == LAB_PROP_TRUE) {
wlr_log(WLR_INFO, "Ignoring focus request due to window rule configuration");
return;
}
/*
* TODO: This is the exact same code as used in foreign.c.
* Refactor it into a public helper function somewhere.