Go to index / Go to protocols

hyprland_focus_grab_v1 ↗

limit input focus to a set of surfaces

This protocol allows clients to limit input focus to a specific set of surfaces and receive a notification when the limiter is removed as detailed below.

hyprland_focus_grab_v1
hyprland_focus_grab_manager_v1

Version 1
Compositor Support
Version 1
hyprland 0.52.1

manager for focus grab objects

This interface allows a client to create surface grab objects.

hyprland_focus_grab_manager_v1
request create_grab(
    grab: new_id<hyprland_focus_grab_v1>,
)

    create a focus grab object

    Create a surface grab object.

    hyprland_focus_grab_manager_v1
    request destroy()
    Destructor

      destroy the focus grab manager

      Destroy the focus grab manager. This doesn't destroy existing focus grab objects.

      hyprland_focus_grab_v1
      hyprland_focus_grab_v1

      Version 1

      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.

      hyprland_focus_grab_v1
      request add_surface(
          surface: object<wl_surface>,
      )

        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.

        hyprland_focus_grab_v1
        request remove_surface(
            surface: object<wl_surface>,
        )

          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.

          hyprland_focus_grab_v1
          request commit()

            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.

            hyprland_focus_grab_v1
            request destroy()
            Destructor

              destroy the focus grab

              Destroy the grab object and remove the grab if active.

              hyprland_focus_grab_v1
              event cleared()

                the focus grab was cleared

                Sent when an active grab is cancelled by the compositor, regardless of cause.