Skip to main content

Research: how do drop-down/terminal peers implement the global summon hotkey, and what is the portable "works anywhere" pattern for DropTerm?

Question: How do dropdown/terminal applications similar to DropTerm implement their global toggle/summon hotkey (quake-style `), which platform APIs exist to third-party apps on Wayland/Linux today, and what is the most portable cross-desktop pattern DropTerm (currently COSMIC-only, no GlobalShortcuts portal, users hand-create a COSMIC custom shortcut running dropterm toggle) could adopt to make its toggle keybind work anywhere?

Date: 2026-11-22

Findings​

All source pins fetched 2026-11-22 unless noted.

1. TL;DR — the convergence verdict​

Every surveyed peer grabs the hotkey in-process where the OS allows it (X11 XGrabKey, Windows RegisterHotKey, macOS Carbon RegisterEventHotKey + CGEventTap, Electron globalShortcut), and on restricted Wayland every surveyed peer falls back to a user-created desktop/compositor shortcut that runs the app's own toggle verb — while the XDG GlobalShortcuts portal is the only sanctioned in-process path on Wayland, implemented today by Plasma, GNOME 48+, and Hyprland but not by COSMIC or wlroots compositors. Electron and CopyQ show the toolkit-level convergence onto the portal; Tilix shows the explicit external-shortcut choice; nothing surveyed writes another app's or the DE's config file directly at runtime — so DropTerm's portable shape is portal-when-available + external-shortcut fallback, not config-writing (see finding 13).

2. Guake — libkeybinder3 grab on X11; documented guake-toggle custom-shortcut fallback​

  • The global hotkey rides libkeybinder3 (the Tomboy X11 keybinder lineage): the FAQ describes manual triggering "for instance on system where libkeybinder3 does not work" — i.e. the grab is the default and X11-shaped (Guake FAQ, docs).
  • The documented fallback is a user-created system shortcut: "you can register the following snippet in your window manager" (a dbus-send to org.guake3.RemoteControl.show_hide), or "going to Settings > Keyboard and adding a new custom shortcut to execute guake-toggle". "guake -t will also toggle Guake but since it initialize a bit more than just necessary, it can be slower." (same FAQ).
  • The XGrabKey mechanics of that lineage are pinned verbatim in Tilda's vendored copy (finding 3); libkeybinder3's own internals were not read (Unverified).

3. Tilda — XGrabKey via vendored Tomboy keybinder, X11-only build​

  • Tilda forces the X11 backend outright: gdk_set_allowed_backends ("x11"); with the comment "Set supported backend to X11" (src/tilda.c, master).
  • The global key is bound through its vendored Tomboy keybinder: tomboy_keybinder_init () ("Initialize and set up the keybinding to toggle tilda's visibility") and tilda_keygrabber_bind (config_getstr ("key"), &tw) in main(); the grab is raw X11 — XGrabKey (GDK_WINDOW_XDISPLAY (rootwin), binding->keycode, binding->modifiers | mod_masks[i], GDK_WINDOW_XID (rootwin), False, GrabModeAsync, GrabModeAsync), repeated over num/caps/scroll-lock masks, with an XKeyPressedEvent filter matching the masked state and invoking the handler (src/tomboykeybinder.c, master) — https://github.com/lanoxx/tilda.

4. Yakuake — KGlobalAccel global shortcut (KDE-only, works on Plasma Wayland and X11)​

  • One action gets a global shortcut, registered through KDE Frameworks: action = actionCollection()->addAction(QStringLiteral("toggle-window-state")); followed by KGlobalAccel::self()->setGlobalShortcut(action, QList<QKeySequence>() << QKeySequence(Qt::Key_F12)); (app/mainwindow.cpp, master) — https://github.com/KDE/yakuake.
  • The toggle works on both windowing systems; on Wayland it asks plasmashell for the available screen rect and animates via KWindowEffects::slideWindow(windowHandle(), KWindowEffects::TopEdge); on X11 it additionally sets the _KDE_SLIDE property and KX11Extras::forceActiveWindow (same file).
  • KGlobalAccel's own header states the contract: "KGlobalAccel allows you to have global accelerators that are independent of the focused window" and "the application's window does not need focus for them to be activated"; shortcuts are "subject to be changed by the global shortcuts kcm" (src/kglobalaccel.h, master) — https://github.com/KDE/kglobalaccel.
  • The same registration is reachable over D-Bus without linking KDE Frameworks: org.kde.KGlobalAccel exposes doRegister(actionId), setShortcutKeys(actionId, keys, flags), globalShortcutsByKey(...), and the yourShortcutsChanged signal; the component interface org.kde.kglobalaccel.Component exposes invokeShortcut and pressed/repeated/released signals (src/org.kde.KGlobalAccel.xml, src/org.kde.kglobalaccel.Component.xml, master).

5. Tilix — explicitly does not register a hotkey; instructs a DE shortcut running tilix --quake​

  • The Quake Mode wiki: "When you register the hot key, simply bind it to the following command: tilix --quake", and the choice is explicit: "Unlike other terminal emulators that support this mode Tilix does not register a global hot key. Instead you must register a hot key yourself with the Desktop Environment you are using", attributed to "Wayland does not support global hot keys"; GNOME users get the GNOME Keyboard custom-shortcut instructions (Tilix wiki, Quake-Mode).
  • Running --quake toggles: "it will check if a quake style window is already running and if so simply toggle the window's visibility" (same page) — the identical single-instance toggle shape DropTerm already ships.
  • Wayland caveat: "To use with Wayland you need to change the command above to: env GDK_BACKEND=x11 tilix --quake" (same page) — Tilix's GTK window stays X11-backed under Wayland.

6. Warp — in-process hotkey on macOS/Windows; Linux "depends on your window manager", broken reports, portal as the community's named fix​

  • Official docs: the Global Hotkey "shows or hides Warp instantly from anywhere", including "a dedicated Quake-style drop-down window"; on Linux "Global Hotkey support on Linux depends on your window manager", with X11 EWMH caveats ("may not work for some X11 window managers that do not implement Extended Window Manager Hints" — dwm, XMonad, et al.) and "On Linux and Windows, Warp does not support the 'Autohides on the loss of keyboard focus' feature" (Warp docs, Global Hotkey).
  • Issue #4274 (open since Feb 2024, labeled "ready-to-implement" Apr 2026): the Linux global hotkey is unreliable — "the keypress goes to that application instead" on Wayland; a commenter states "now Wayland doesn't let apps just listen for hotkeys, and they have to be registered with Mutter"; the workarounds are exactly the ecosystem fallback: "a global shortcut through the system settings to call a command that toggles the terminal", a community KWin script that toggles Warp and restores focus, and GNOME's Quake Terminal extension launching Warp (warpdotdev/warp#4274). The same thread cites CopyQ's portal PR as the Wayland solution pattern (finding 10).

7. Windows Terminal — Win32 RegisterHotKey inside the window manager, per globalSummon action​

  • WindowEmperor::_setupGlobalHotkeys unregisters all, then walks the settings: for (const auto& [keyChord, cmd] : _app.Logic().GlobalHotkeys()) { if (auto summonArgs = ...try_as<Settings::Model::GlobalSummonArgs>()) { ... _registerHotKey(index, keyChord); _hotkeys.emplace_back(summonArgs); } }; _registerHotKey maps the KeyChord to Win32 flags and calls LOG_IF_WIN32_BOOL_FALSE(::RegisterHotKey(_window.get(), index, hotkeyFlags, vkey)); with MOD_NOREPEAT | MOD_WIN/ALT/CONTROL/SHIFT; _messageHandler routes case WM_HOTKEY: _hotkeyPressed(...); _hotkeyPressed builds SummonWindowSelectionArgs with args.SummonBehavior.ToggleVisibility(summonArgs.ToggleVisibility()) and falls back to dispatching wt -w <name> if no window matches (src/cascadia/WindowsTerminal/WindowEmperor.cpp, main) — https://github.com/microsoft/terminal.
  • The app-level handlers exist only as a failure path: TerminalPage::_HandleGlobalSummon/_HandleQuakeMode return args.Handled(false) with the comment "These shouldn't ever get here, except for when we fail to register for the global hotkey" (src/cascadia/TerminalApp/AppActionHandlers.cpp, main).
  • Official docs: quake mode is a window named _quake, created "by binding the quakeMode action or by manually running the command line wt -w _quake"; if unbound and minimized, "you need to go into Task Manager to exit that terminal window" (Windows Terminal tips and tricks, updated 2025-11-12). Windows reserves some keys from RegisterHotKey — F12 "won't work when bound" because the debugger owns it (microsoft/terminal#13775).

8. iTerm2 — Carbon RegisterEventHotKey plus CGEventTap, permission-gated​

  • The Carbon path: RegisterEventHotKey((UInt32)shortcut.keyCode, carbonModifiers, hotKeyID, GetEventDispatcherTarget(), 0, &eventHotKey); inside -registerShortcut:target:selector:userData:, with InstallEventHandler(GetEventDispatcherTarget(), EventHandler, ...) registered for { kEventClassKeyboard, kEventHotKeyPressed }; the handler dispatches to the registered target/selector (sources/Hotkey/iTermCarbonHotKeyController.m, master) — https://github.com/gnachman/iTerm2.
  • The event-tap path (for modifier double-taps and remapping): CGEventTapCreate(kCGHIDEventTap, kCGTailAppendEventTap, listenOnly ? kCGEventTapOptionListenOnly : kCGEventTapOptionDefault, _types, ...); a filtering tap may swallow events ("or NULL if the event is to be deleted"), and permission is explicit: a listen-only tap needs Input Monitoring, a filtering tap needs Accessibility, with [[iTermPermissionsHelper accessibility] request] on failure (sources/Hotkey/iTermEventTap.m, master).
  • Official docs pin the behavior: "A hotkey is a keypress that iTerm2 responds to even if another application is active"; "By pressing the hotkey, the window opens or closes"; double-tap of a modifier is assignable; hide-on-focus-loss is a setting (iTerm2 hotkey documentation).

9. Tabby (Electron) and Ghostty (Rust) — the toolkit years: globalShortcut dies on Wayland, the portal takes over; macOS-only global: prefix​

  • Tabby ships the feature: "Optional dockable window with a global spawn hotkey ('Quake console')" (Tabby README). The underlying API is Electron's globalShortcut — "Detect keyboard events when the application does not have keyboard focus", globalShortcut.register(accelerator, callback), which "will silently fail" if taken (Electron docs). On Wayland it fails: "Pressing a hotkey to toggle tabby doesn't work under linux / wayland when tabby is not focused, while it is working well under x11" (Eugeny/tabby#5207).
  • The toolkit's own pivot is the decisive data point: "Electron routes globalShortcut through the GlobalShortcuts portal on Wayland since 35.3 (on by default in 43)" (Eugeny/tabby#11781) — and Electron's docs now state it as platform behavior: on Wayland compositors "don't allow direct key grabs, so Electron uses the freedesktop GlobalShortcuts portal"; this needs a valid portal identity (a desktopName), "GNOME shows a consent dialog on first bind", while "KDE Plasma binds silently"; the portal reply "An app id is required" and the skipped BindShortcuts call are Tabby's live bug (#11781).
  • Ghostty (Rust/GPU, the closest genus to DropTerm) ships keybind = global:... — "a global keybind works globally across your system (i.e. even when Ghostty is not focused)", "This prefix implies all:" — but "this does not work in all environments", and the platform statement is unambiguous: "The global: prefix is only available on macOS", "On macOS, this feature requires accessibility permissions to be granted to Ghostty" (Ghostty keybind docs). No Linux global hotkey ships. Community reports of COSMIC breaking Ghostty's hotkey expectations appear in the COSMIC portal thread (finding 11).

10. The XDG GlobalShortcuts portal — the spec, and who implements it​

  • Spec: the portal lets applications "create global shortcuts sessions, and register shortcuts to them"; shortcuts "are activated regardless of the focused state of the application window". Flow: CreateSession → BindShortcuts(session_handle, shortcuts, parent_window) → ListShortcuts → signals Activated/Deactivated/ShortcutsChanged. BindShortcuts responds with "The list of shortcuts which were bound. This is a subset of the shortcuts which were passed in" — "possibly the empty set"; "An application can only attempt to bind shortcuts of a session once"; interface version 2 adds ConfigureShortcuts ("Request showing a configuration UI") (org.freedesktop.portal.GlobalShortcuts spec).
  • KDE — implemented in xdg-desktop-portal-kde (MR !80, Nov 2022): GlobalShortcutsSession::setActions registers through the KGlobalAccel API — KGlobalAccel::self()->setShortcut(action.get(), {shortcut.keySequence}, KGlobalAccel::Autoloading); (preferred triggers via setDefaultShortcut) — with component names derived from the session's app id; a QuickDialog hosting GlobalShortcutsDialog shows new shortcuts with conflict roles (globalConflict, standardConflict, internalConflict); activation is forwarded from kglobalaccel's component signal: if (componentUnique != componentName()) { return; } Q_EMIT shortcutActivated(actionUnique, timestamp); → Q_EMIT Activated(QDBusObjectPath(session->handle()), shortcutName, timestamp); (src/globalshortcuts.cpp, master; MR !80).
  • GNOME — implemented in 48.rc (GNOME 48, 2025): the NEWS line is "Add global shortcuts portal backend" under 48.rc (xdg-desktop-portal-gnome NEWS); later entries "Improvements to the Global Shortcuts portal" (49.beta) and "Various fixed to the Global Shortcuts portal" (51.rc). Mechanism (src/globalshortcuts.c, main): BindShortcuts calls GNOME Shell — org_gnome_shell_call_grab_accelerators with variant type "a(suu)" (Mutter's keygrabber, SHELL_ACTION_MODE_NORMAL) — and shows the consent UI by delegating to org.gnome.Settings.GlobalShortcutsProvider BindShortcuts; accelerator-activated flows back via xdp_impl_global_shortcuts_emit_activated. A GNOME maintainer (garnacho) confirms the user model: "There is no configuration required to enable the portal", shortcuts are configured per-app in GNOME Settings, and portal shortcuts are distinct from manual keybindings — "Global shortcuts and keyboard shortcuts are two different things" (GNOME Discourse thread).
  • Hyprland — implemented by its own portal backend: BindShortcuts registers each shortcut with the compositor over Hyprland's private Wayland protocol — makeShared<CCHyprlandGlobalShortcutV1>(m_sState.manager->sendRegisterShortcut(id.c_str(), session->appid.c_str(), description.c_str(), "")) — with compositor-side presses delivered as protocol events: shortcut->setPressed takes a [this]-captured lambda that runs globalShortcuts->onActivated(...) → m_pObject->emitSignal("Activated").onInterface(INTERFACE_NAME)... (src/portals/GlobalShortcuts.cpp, master).
  • wlroots compositors — not implemented: xdg-desktop-portal-wlr's README: "Currently it only implements the following portals only" — Screenshot and ScreenCast; GlobalShortcuts appears nowhere (xdg-desktop-portal-wlr README). sway/i3 users therefore bind compositor config keys (the same external-binding fallback DropTerm's portability plan already lists).
  • COSMIC — not implemented, open since day one: xdg-desktop-portal-cosmic's src/ has no global-shortcuts module (access, app, buffer, documents, file_chooser, localize, main, remote_desktop*, screencast*, screenshot, subscription, wayland, widget) — (src listing). Issue #4 (May 2023) tracks it; maintainer Drakulix, May 2023: "we plan to make this a central part of our key-bindings and key-customization story, so support is definitely on the roadmap rather sooner than later"; Jan 2024: still weighing "static vs. dynamic shortcuts" and preferring the unfinished upstream "action binder" protocol over Hyprland's; Mar 2026: "This really is something that depends on our engineering team coming together and establishing a design on how this is supposed to work first", preferring "to completely yank shortcut handling out of the compositor" into a separate daemon. Still open as of Nov 2026, with later comments reporting real-world portal breakage for CopyQ, KeePassXC, Discord, and Ghostty (pop-os/xdg-desktop-portal-cosmic#4).

11. The portal's adopters — toolkit and app precedent​

  • Electron adopted it at the toolkit level for all Wayland apps (finding 9) — the same layer DropTerm's GPUI stack would need a custom client for.
  • CopyQ (Qt clipboard manager, a summon-key app genus) merged it Sep 14, 2025 (commit 808a061): "Wayland: Register global shortcuts using Portal", with the author's caveats: "The shortcuts can be registered/bound only once per application" and "If global shortcut commands are added or shortcuts change, the application needs to be restarted for the changes to take effect" (hluk/CopyQ#3168) — these are the spec's own bind-once limitation (finding 10) observed in a shipped app.
  • KGlobalAccel/KDE apps (Yakuake) predate the portal and continue to work through it — KDE's portal backend literally registers portal requests as KGlobalAccel shortcuts (finding 10), so Yakuake-style direct KGlobalAccel registration and the portal converge on the same daemon on KDE.

12. GNOME's gsettings custom keybindings — writable programmatically, but no surveyed app writes them​

  • The mechanism is real and stable: gnome-settings-daemon's media-keys plugin reads custom_paths = g_settings_get_strv (priv->settings, "custom-keybindings") from org.gnome.settings-daemon.plugins.media-keys, opens each relocatable path with g_settings_new_with_path (CUSTOM_BINDING_SCHEMA, path) ("org.gnome.settings-daemon.plugins.media-keys.custom-keybinding"), and on press runs the command: if (key->key_type == CUSTOM_KEY) do_custom_action(...) → execute (manager, key->custom_command, timestamp) → g_app_info_create_from_commandline + g_app_info_launch (plugins/media-keys/gsd-media-keys-manager.c, master) — https://github.com/GNOME/gnome-settings-daemon.
  • Writing one programmatically is the standard recipe (read the custom-keybindings array, append a path, set name/command/binding) — documented for users and config-management tools (AskUbuntu recipe). But across every surveyed app, no project writes these keys itself at runtime: Guake's docs, Tilix's wiki, and Tabby's community all instruct the user to create the custom shortcut; the only app-owned GNOME integration found is Kando's GNOME Shell extension — "required for Kando on GNOME under Wayland", which "allows registering and simulating keyboard shortcuts" over a D-Bus interface (kando-menu/gnome-shell-integration README) — an extension, not config-writing.

13. What DropTerm has today — and the synthesis: the portable shape​

Grounded in the working tree (2026-11-22):

  • The toggle verb is the CLI's default: Self::Toggle => "toggle" with bare invocation parsing as Action::Toggle (dropterm/src/cli.rs:133, :250-253); it reaches the running instance over the single-instance D-Bus seam as a forwarded ActivateAction { action, args } (dropterm/src/core/dbus_state.rs:185-188), i.e. exactly the "external shortcut runs the app's toggle command" seam Tilix chose.
  • The docs state the constraint: "COSMIC does not yet implement the XDG GlobalShortcuts portal, so no app can register one; binding a COSMIC custom shortcut is the only path today" and "it must be bound as a COSMIC custom shortcut" (docs/faq.md:11, docs/known-issues.md:18) — both confirmed above: COSMIC's portal has no GlobalShortcuts module and issue #4 is open (finding 10). The Shift-modified shortcut bug that pushes users to F12 is docs/known-issues.md:15 (cosmic-epoch#2481).
  • The portability plan's per-DE summon-bind checklist (sway bindsym, Hyprland bind, KDE custom shortcut, Xfce keyboard settings) is already written down at docs/research/portability-plan.md:864-865, 1207-1209; this record supplies its per-DE evidence.

The portable pattern, graded by the surveyed precedent:

  1. External shortcut running the toggle verb — the universal baseline; keep it. Every Wayland-restricted peer lands here: Tilix ships it as the only path (finding 5), Guake documents it as the fallback (finding 2), Warp's and Tabby's users improvise it when the in-process grab fails (findings 6, 9), and DropTerm already has the verb and seam. Zero Wayland compositors can take this away from an app; it is the only pattern that is identical on COSMIC, sway, Hyprland, KDE, GNOME, and Xfce today.
  2. GlobalShortcuts portal client, when present — the sanctioned in-process upgrade; add it. It is the only Wayland API that lets the app register the chord itself (spec quote, finding 10); Electron (toolkit-scale) and CopyQ (app-scale) both converged onto it, KDE binds silently, GNOME 48+ works with a consent dialog, Hyprland implements it natively. For DropTerm this is a zbus client of org.freedesktop.portal.GlobalShortcuts (CreateSession → BindShortcuts → map Activated to the toggle), gated on the portal's presence and tolerant of the documented costs: the bound set is "possibly the empty set", bind-once per session, GNOME's first-bind consent dialog, and the portal identity requirement (a desktop file) Electron users hit ("An app id is required"). On COSMIC it is inert until issue #4 lands — the gate is the named revisit trigger.
  3. Per-DE direct APIs — covered by the portal on KDE; only worth it outside the portal. Yakuake's KGlobalAccel::setGlobalShortcut is the KDE-native shape, and the same registration is reachable over plain D-Bus (org.kde.KGlobalAccel doRegister/setShortcutKeys, finding 4) if DropTerm ever wants silent KDE binding without the portal round-trip; but KDE's portal backend already registers through KGlobalAccel, so the portal leg covers it. No GNOME-native write path exists in peer practice (finding 12) — GNOME users get either the portal (48+) or a manual custom keybinding.
  4. In-process grabs on X11 — the X11 leg of the portability plan copies the oldest precedent. XGrabKey over lock-modifier masks (Tilda's tomboykeybinder.c verbatim, finding 3) is what Guake/Tilda do; Windows/iTerm2 show the same in-process pattern on OSes that allow it (findings 7, 8) — relevant only when the X11 backend exists.
  5. Rejected: writing the DE's/compositor's config (e.g. cosmic-comp's config) at runtime. Zero peer precedent found: no surveyed app writes another app's or the DE's keybind config file; the closest analogs are user-run installer recipes and config-management (Puppet/gsettings scripts), Kando's shell extension (a runtime D-Bus registration API, not file-writing), and community KWin scripts shared in issues. COSMIC's own config story is transitional — ~/.config/cosmic/compositor/config.ron edits are documented as the manual workaround "until keybindings are fully handled" by cosmic-settings (cosmic-epoch#288) — so the format is owned by cosmic-settings, likely rewritten under the user's feet, and unverified against cosmic-comp source (Unverified). The portal (option 2) is the sanctioned version of exactly this integration; write it there.
  6. Rejected: a GNOME Shell extension (the Kando route) for now. It exists for apps needing focused-window/mouse D-Bus data Kando wants; DropTerm needs only a summon chord, which the portal and custom keybindings both provide. Revisit only if DropTerm ever needs shell-level data on GNOME.

Sources​

All fetched 2026-11-22 unless noted.

Unverified​

  • No merged global-shortcut protocol in wlr-protocols: the protocols directory could not be enumerated from this environment (GitLab API and raw paths returned 404, the tree page needs JavaScript). The pinned, sufficient fact is portal-level: xdg-desktop-portal-wlr implements only Screenshot and ScreenCast. If a wlr protocol grows later, the COSMIC thread shows the same shape is what maintainers wait for.
  • cosmic-comp's config file path and shape (~/.config/cosmic/compositor/config.ron, the "custom shortcuts" section): sourced from pop-os issue #288 and secondary write-ups, not pinned against cosmic-comp's source; the finding that rejects config-writing leans on the format being transitional, which issue #288 states, but the exact schema was not read.
  • Tabby's own globalShortcut.register call site was not located (the renderer hotkeys service has only DOM matching; the Electron-main registration file wasn't found within budget). The Electron-level routing is pinned from Electron's docs and Tabby issues #5207/#11781; only the exact tabby-electron file is missing.
  • Warp's Linux/macOS hotkey implementation mechanism — the frontend is closed; only the documented behavior and issue reports are pinned. The search-surfaced claim that GNOME's portal backend shipped in xdg-desktop-portal-gnome 45.0 (Sept 2023) contradicts the primary NEWS (48.rc); the NEWS was used and the 45.0 claim treated as wrong.
  • Ghostty on Linux via the portal: secondary reports claim partial Linux support on KDE; the docs say "The global: prefix is only available on macOS" — the docs were used; the Reddit claim was not confirmed against any Ghostty primary source.
  • libkeybinder3 internals (that it is X11 XGrabKey under the hood): inferred from its Tomboy lineage and Guake's docs wording; Tilda's vendored tomboykeybinder.c (same lineage) carries the pinned XGrabKey code instead. libkeybinder3's own source was not fetched.
  • Hyper was not surveyed separately; Tabby stands in as the Electron datapoint and Ghostty as the Rust one, per the question's "Hyper or any other Electron/Rust terminal".
  • Portal X11 behavior: whether the GlobalShortcuts portal is usable from an X11 session (vs Wayland-only per backend) was not pinned for any backend; the X11 leg of the recommendation rests on the XGrabKey precedent instead.