Skip to content

[Feature] Fullscreen VM/remote-desktop keybind guard using Hyprland submaps #3287

Description

@xizha127

What would you like to be added?

I would like an optional fullscreen keybind guard for VM / remote-desktop / emulator windows.

The idea is:

  • Detect when the currently focused window is fullscreen.
  • Check whether it matches known VM / remote-desktop clients, for example:
    • WinBoat / FreeRDP / xfreerdp
    • VMware
    • VirtualBox
    • QEMU / virt-manager / SPICE viewers
    • GNOME Boxes
    • Waydroid
    • Remmina
    • AnyDesk
    • RustDesk
    • TeamViewer
    • Splashtop
    • HelpWire
  • If matched, switch Hyprland into a restricted submap.
  • In that submap, disable normal Hyprland hotkeys except one escape keybind, for example Super+F.
  • Pressing the escape keybind should exit fullscreen and return to the normal/global submap.

A minimal Hyprland-side config could look like this:

submap = fullscreen-guard

bind = Super, F, fullscreen, 0
bind = Super, F, submap, global

submap = global

How will it help?

This helps when using Windows / Linux guests, remote desktop sessions, or Android containers fullscreen inside Hyprland.

Current problem:

When a VM or remote-desktop window is fullscreen, host-level Hyprland keybinds still trigger. For example, while using WinBoat / FreeRDP fullscreen, pressing Super combinations can accidentally:

  • switch host workspaces,
  • launch host apps,
  • trigger host window actions,
  • interfere with the guest/session,
  • break immersion when the user expects input to go to the fullscreen guest.

Use case:

I am using WinBoat on Hyprland. The actual fullscreen window appears as:

{
  "class": "xfreerdp",
  "title": "FreeRDP: 127.0.0.1:xxxxx",
  "fullscreen": 2,
  "fullscreenClient": 2,
  "xwayland": true
}

Extra info

it uses generic Hyprland behavior:

  • hyprctl activewindow -j
  • active window class/title matching
  • fullscreen state detection
  • hyprctl dispatch submap
  • optional Hyprland socket2 event monitoring

The feature could probably be added as an optional script/snippet rather than enabled by default.

Potential config options:

env = HYPR_FULLSCREEN_GUARD_MATCH,xfreerdp|winboat|VirtualBox|VMware|virt-manager|waydroid|remmina|anydesk|rustdesk
env = HYPR_FULLSCREEN_GUARD_SUBMAP,fullscreen-guard

My config in:

keybinds.conf

# >>> hypr-fullscreen-guard >>>
##! Hyprland fullscreen guard
# Used by hypr_fullscreen_guard.py.
#
# When the focused fullscreen window matches the guard script's app list,
# the script switches Hyprland into this restricted submap.
#
# In this submap, normal Hyprland hotkeys are disabled.
# Only the escape keybind below remains active.

submap = fullscreen-guard

# Escape fullscreen guard.
# Change this keybind if desired.
bind = Super, F, fullscreen, 0
bind = Super, F, submap, global

submap = global
# <<< hypr-fullscreen-guard <<<

execs.conf

# >>> hypr-fullscreen-guard-autostart >>>
exec-once = ~/.config/hypr/custom/scripts/hypr_fullscreen_guard.py --monitor
# <<< hypr-fullscreen-guard-autostart <<<

/scripts/hypr_fullscreen_guard.py
hypr_fullscreen_guard.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    FEATUREFeature advice/request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions