hyprland_focus_grab_v1¤
wayland.hyprland_focus_grab_v1 ¤
Input focus limiter
This interface restricts input focus to a specified whitelist of surfaces as long as the focus grab object exists and has at least one comitted surface.
Mouse and touch events inside a whitelisted surface will be passed to the surface normally, while events outside of a whitelisted surface will clear the grab object. Keyboard events will be passed to the client and a compositor-picked surface in the whitelist will receive a wl_keyboard::enter event if a whitelisted surface is not already entered.
Upon meeting implementation-defined criteria usually meaning a mouse or touch input outside of any whitelisted surfaces, the compositor will clear the whitelist, rendering the grab inert and sending the cleared event. The same will happen if another focus grab or similar action is started at the compositor's discretion.
Methods:
-
add_surface
–Add a surface to the focus whitelist
-
remove_surface
–Remove a surface from the focus whitelist
-
commit
–Commit the focus whitelist
-
destroy
–Destroy the focus grab
-
on_cleared
–The focus grab was cleared.
events
cleared ¤
cleared() -> None
The focus grab was cleared
Sent when an active grab is cancelled by the compositor, regardless of cause.
add_surface ¤
add_surface(surface: wl_surface) -> None
Add a surface to the focus whitelist
Add a surface to the whitelist. Destroying the surface is treated the same as an explicit call to remove_surface and duplicate additions are ignored.
Does not take effect until commit is called.
remove_surface ¤
remove_surface(surface: wl_surface) -> None
Remove a surface from the focus whitelist
Remove a surface from the whitelist. Destroying the surface is treated the same as an explicit call to this function.
If the grab was active and the removed surface was entered by the keyboard, another surface will be entered on commit.
Does not take effect until commit is called.
commit ¤
commit() -> None
Commit the focus whitelist
Commit pending changes to the surface whitelist.
If the list previously had no entries and now has at least one, the grab will start. If it previously had entries and now has none, the grab will become inert.
destroy ¤
destroy() -> None
Destroy the focus grab
Destroy the grab object and remove the grab if active.
on_cleared ¤
on_cleared() -> None
The focus grab was cleared.
Override to handle wayland.hyprland_focus_grab_v1.events.cleared
.