{ "name": "HyprlandFocusGrab", "module": "Quickshell.Hyprland", "type": "class", "super": { "type": "qt", "module": "qml.QtQml", "name": "QtObject" }, "description": "Input focus grabber", "details": "Object for managing input focus grabs via the [hyprland_focus_grab_v1]\nwayland protocol.\n\nWhen enabled, all of the windows listed in the `windows` property will\nreceive input normally, and will retain keyboard focus even if the mouse\nis moved off of them. When areas of the screen that are not part of a listed\nwindow are clicked or touched, the grab will become inactive and emit the\ncleared signal.\n\nThis is useful for implementing dismissal of popup type windows.\n```qml\nimport Quickshell\nimport Quickshell.Hyprland\nimport QtQuick.Controls\n\nShellRoot {\n FloatingWindow {\n id: window\n\n Button {\n anchors.centerIn: parent\n text: grab.active ? \"Remove exclusive focus\" : \"Take exclusive focus\"\n onClicked: grab.active = !grab.active\n }\n\n HyprlandFocusGrab {\n id: grab\n windows: [ window ]\n }\n }\n}\n```\n\n[hyprland_focus_grab_v1]: https://github.com/hyprwm/hyprland-protocols/blob/main/protocols/hyprland-global-shortcuts-v1.xml\n", "properties": { "active": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": "If the focus grab is active. Defaults to false.\n\nWhen set to true, an input grab will be created for the listed windows.\n\nThis property will change to false once the grab is dismissed.\nIt will not change to true until the grab begins, which requires\nat least one visible window.\n" }, "windows": { "type": { "type": "qt", "module": "qml", "name": "list", "of": { "type": "qt", "module": "qml.QtQml", "name": "QtObject" } }, "details": "The list of windows to whitelist for input.\n" } }, "functions": [], "signals": { "cleared": { "name": "cleared", "details": "Sent whenever the compositor clears the focus grab.\n\nThis may be in response to all windows being removed\nfrom the list or simultaneously hidden, in addition to\na normal clear.\n", "params": [] } }, "variants": {} }