The launcher's submap disables almost every global keybinding while it's open, including the power button and media keys

Aperta
#116 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 11 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, lua
Ambito
desktop, tooling

Direzione di ricerca

Start with the omacast.lua template in bin/omacast and the submap handling in ui/LauncherWindow.qml; check how Omarchy’s global binds are defined and which Hyprland Lua API options are available. Reproduce the missed binds with the launcher open, then verify that power, hardware, capture and lid switch binds work and that a leftover submap resets after the shell restarts.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

While the launcher is open, Hyprland ignores every global keybinding except the ones marked submap_universal. On a stock Omarchy setup that's only omacast's own toggle, so 252 of 254 binds stop working. These are the ones that matter most:

  • Power button. Omarchy ships HandlePowerKey=ignore (/etc/systemd/logind.conf.d/10-ignore-power-button.conf, from omarchy-settings), so its XF86PowerOff bind is the only thing that handles the button. Confirmed by hand: with the launcher open, pressing the power button does nothing.
  • Lid switch binds. Hyprland checks switch events against the current submap like keys (KeybindManager.cpp:536-545 and :652 in v0.56.2), so Omarchy's switch:on/off:Lid Switch binds (omarchy-system-lid-close, omarchy-hyprland-monitor-clamshell) don't run while the launcher is open. Undocked this is mostly harmless: logind still suspends, and in my test the screen locked before suspend, probably through the omarchy-system-sleep-lock fallback. What's likely lost is the clamshell handling when an external monitor is connected; I haven't tested that.
  • Hardware keys. Volume, mute, mic mute, play/pause/next/previous, screen and keyboard brightness, and touchpad toggle. These binds are locked so they work even on the lock screen, yet they stop working while the launcher is open. Confirmed by hand: volume and brightness keys do nothing with the launcher open.
  • Capture. Print (screenshot), Alt+Print (screen recording), Super+Print (color picker), Super+Ctrl+Print (OCR). You can't screenshot the launcher with the Print key.
  • Everything else. System menu, lock, close window, notification dismiss, dictation, and so on.
Steps to reproduce
  1. Open the launcher (Alt+Space).
  2. Press a volume, brightness or Print key.

Expected: the key works as it does with any other window focused.
Actual: nothing happens. hyprctl submap reports omacast while the launcher is open and default after it closes. hyprctl binds -j shows submap_universal: "false" for every default bind except the launcher toggle.

Seen on Hyprland 0.56.2 with Omarchy 4 (omarchy-settings 4.5.0-3) and omacast at 283fee5.

Root Cause

ui/LauncherWindow.qml:243 puts Hyprland in the omacast submap whenever the launcher is shown, so Super+J/K reach the launcher instead of Hyprland's Super binds. The omacast.lua that omacast setup writes (bin/omacast:262-268) defines that submap with one no-op bind and marks only the launcher toggle as submap_universal.

In a submap Hyprland only runs that submap's binds and universal binds, so the submap catches every default bind, not just the Super binds it's meant to catch.

The submap can get stuck

The only things that reset the submap are onShownChanged and Component.onDestruction (ui/LauncherWindow.qml:240). If the shell crashes or is killed while the launcher is open, onDestruction never runs. Nothing resets the submap when the shell starts again, so every global bind stays dead, power button included, until the user opens and closes the launcher again. Nothing on screen tells them to do that. #102 is the same failure caused by unplugging a monitor. I found this one by reading the code and haven't reproduced it.

Possible fixes

  1. Keep system keys working (small). In the omacast.lua template, give the submap the same commands for the switch: lid events, XF86PowerOff, the XF86Audio* / XF86MonBrightness* / XF86KbdBrightness* / XF86Touchpad* keys and Print, or rebind them as submap_universal. For example:

    o.rebind("PRINT", "Screenshot", "omarchy-capture-screenshot", { submap_universal = true })
    

    I'm running this for Print and it works. The downside is that the template has to copy Omarchy's commands and stay in sync with them.

  2. Catch only the keys the launcher needs (larger). Use a submap that only catches the Super combinations the launcher handles, or handle Super+J/K without a submap, so hardware keys, switches and unrelated binds never get caught. I haven't checked what Hyprland's Lua API offers for this.

  3. Reset a leftover submap. When the launcher component loads, dispatch hl.dsp.submap("reset") if it's not shown. This fixes the crash case above and helps #102.

Happy to open a PR for whichever approach you prefer.

Lingua principale
JavaScript
Stelle
560
Fork
93
Merge medio
7g 19h
PR unite (30g)
19

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di typecraft-dev/oma-cast

Tutte le issue di typecraft-dev/oma-cast

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.