[Bug]: SnapShots can't be set up on GNOME 45–47: no GlobalShortcuts portal#12589

openedSep 19, 2026byNNozzit

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Ubuntu 24.04 based distro (Zorin OS 18), GNOME Shell 46.0, Wayland session.
  2. Open Settings → SnapShots and turn SnapShots on. The "Set up snapshots for GNOME" dialog opens.
  3. Step 1 (Access): install the extension, sign out and back in. gnome-extensions info snap-shot@t3.codes reports Enabled: Yes, State: ACTIVE, and the step gets its checkmark.
  4. Step 2 (Shortcut): pick any key combination.

Expected behavior

The shortcut gets registered and SnapShots can be used. GNOME 46 is listed in the extension's shell-version, so I expected the whole feature to work there.

Actual behavior

Step 2 shows:

1No such interface "org.freedesktop.portal.GlobalShortcuts"

The setup can't be finished, and closing the dialog switches SnapShots back off. Since the shortcut is the only way to trigger a capture, the feature can't be used at all.

The cause is that GNOME 46 has no GlobalShortcuts backend. xdg-desktop-portal 1.18.4 knows the interface, but xdg-desktop-portal-gnome 46.2 doesn't implement org.freedesktop.impl.portal.GlobalShortcuts, so the frontend never exports it:

1$ grep Interfaces /usr/share/xdg-desktop-portal/portals/gnome.portal
2Interfaces=org.freedesktop.impl.portal.Access;…Account;…AppChooser;…Background;…Clipboard;…DynamicLauncher;…FileChooser;…InputCapture;…Lockdown;…Print;…RemoteDesktop;…ScreenCast;…Screenshot;…Settings;…Wallpaper;
3
4$ busctl --user introspect org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop | grep -c GlobalShortcuts
50

GNOME only got that backend in a later release, so this affects every GNOME 45–47 install, including all of Ubuntu 24.04 LTS and its derivatives. Those versions are all in the extension's shell-version list.

Impact

SnapShots is unusable on GNOME 45–47. The capture side works fine there (the extension loads and owns its bus name), it's only the trigger that's missing.

Version or commit

0.0.42 (AppImage)

Environment

Zorin OS 18 (Ubuntu 24.04 base), GNOME Shell 46.0, Wayland, xdg-desktop-portal 1.18.4, xdg-desktop-portal-gnome 46.2, xdg-desktop-portal-gtk 1.15.1.

Workaround

None inside the app. Calling the extension from a GNOME custom shortcut isn't possible either, because captureService.js only accepts the T3 Code bus name — which is the right call.

A possible fix: the extension already runs inside GNOME Shell, so it could own the key itself with Main.wm.addKeybinding() and tell the app over the existing D-Bus connection when it's pressed. That would work on every supported shell version without going through the portal, and the portal path could stay as it is for GNOME versions that have it.

Triage

Confirmed against v0.0.42 (719a76ca1d) and current main @ dfbb11bdd. PortalCaptureShortcut.ts, the GNOME extension, and the setup wizard are unchanged between those two. This is a real GNOME 45–47 SnapShots setup break, not a failed extension install and not a denied permission prompt.

The capture half of the report is fine. The extension still lists those shells as supported:

4:4:apps/desktop/gnome-extension/metadata.json
1 "shell-version": ["45", "46", "47", "48", "49", "50"],

Setup step 1 (install / enable snap-shot@t3.codes) can succeed on GNOME 46. Step 2 cannot.

What the code does today

1. GNOME always registers the capture chord through org.freedesktop.portal.GlobalShortcuts.

Niri is the only Linux session that skips the portal. GNOME, KDE, and Hyprland all construct PortalCaptureShortcut (apps/desktop/src/snapShot/DesktopSnapShot.ts). That client’s first required portal call is a property read on the GlobalShortcuts interface:

379:387:apps/desktop/src/snapShot/PortalCaptureShortcut.ts
1 const version = await this.call({
2 destination: this.owner,
3 path: PATH,
4 interface: "org.freedesktop.DBus.Properties",
5 member: "Get",
6 signature: "ss",
7 body: [SHORTCUTS, "version"],
8 });
9 this.version = decodeVersion(version.body[0]).value;

SHORTCUTS is org.freedesktop.portal.GlobalShortcuts. Host-portal Register already swallows UnknownInterface; this Get does not. When the frontend portal never exported the interface, failed() writes the D-Bus message straight into shortcutMessage. That is the filed error:

1No such interface "org.freedesktop.portal.GlobalShortcuts"

2. GNOME’s portal backend did not implement this until 48.

xdg-desktop-portal has known the frontend API since 1.16. It only exports it when a backend implements org.freedesktop.impl.portal.GlobalShortcuts. That backend landed in GNOME 48 (xdg-desktop-portal-gnome !208). GNOME 45–47, including Ubuntu 24.04 LTS (GNOME 46 + xdg-desktop-portal-gnome 46.2), do not ship it. The reporter’s gnome.portal Interfaces= list and busctl introspect (0 GlobalShortcuts) match that.

3. Setup cannot finish, so first-time opt-in turns SnapShots back off.

GNOME shortcut readiness is shortcutRegistered || shortcutPending (captureSetupShortcutReady). After this failure both are false, so Done stays disabled. Closing an unfinished first opt-in calls captureSetupShouldDisableOnClose and writes snapShotEnabled: false. That matches “closing the dialog switches SnapShots back off.”

There is no other in-app trigger. Manual / picker capture is a different Linux backend, not the GNOME extension path.

4. A GNOME custom shortcut cannot call the extension either.

CaptureService only accepts the app’s own bus names:

2:5:apps/desktop/gnome-extension/captureService.js
1export const CLIENT_NAMES = [
2 "com.t3tools.T3Code.SnapShot",
3 "com.t3tools.T3Code.Development.SnapShot",
4];

The app takes that name while capturing (LinuxSnapShot.captureExtension) so the extension will answer. It does not export a GNOME equivalent of Niri’s com.t3tools.SnapShot.Capture for a user keybinding to invoke. Niri already has a dedicated non-portal trigger because that compositor has no GlobalShortcuts backend (docs/internals/linux-snap-shot.md). GNOME 45–47 is the same class of gap and was not given a shell-side path.

WorkWhy it does not close this
#8103Shipped SnapShots, including this portal-only GNOME shortcut.
#11495Restores a portal session after the portal restarts. Assumes the interface exists.
#11630Idempotent extension enable. Access step only.

I did not find an existing issue for “GNOME SnapShots setup dies because GlobalShortcuts is missing.”

Workaround

None inside the app. GNOME 48+ with xdg-desktop-portal-gnome 48+ can use the current portal path. That is not available on Ubuntu 24.04 LTS (GNOME 46). Binding a GNOME custom shortcut to the extension’s Capture method will be rejected as “Only T3 Code may request a snapshot.”

Decision

Accept.

A change is not done for this issue until, on GNOME 45–47 Wayland (repro: Ubuntu 24.04 / GNOME 46, extension enabled, no org.freedesktop.portal.GlobalShortcuts):

  1. Settings → SnapShots setup can finish after the extension is active. The shortcut step must not die on the missing-interface error, and closing the dialog must not be the only way out.
  2. The chosen chord triggers a capture while T3 Code is in the background. The extension remains the capture backend.
  3. GNOME 48+ can keep using the existing GlobalShortcuts portal path.

Owning the chord inside the already-running extension (Main.wm.addKeybinding) and notifying the app over the existing D-Bus connection is the in-tree analog of Niri’s compositor-owned binding. The portal path can stay for shells that actually export it.

Synced from GitHub

Follow-up: I have it working on GNOME 46 now, without touching T3 Code. Posting how, in case it helps someone else on Ubuntu 24.04 and because it confirms where the gap is.

The capture side is fine on GNOME 46. With a shortcut in place, the extension captures the focused window, the flash and the fly-in animation play, and the snapshot lands in the draft with app name and window title. The only thing missing really is the trigger.

What I did is fill in the missing portal backend. xdg-desktop-portal 1.18 already has the GlobalShortcuts frontend, it just doesn't export it because no backend implements org.freedesktop.impl.portal.GlobalShortcuts. So I wrote a small one (Python, PyGObject, about 250 lines):

  • it owns org.freedesktop.impl.portal.desktop.t3shortcuts and implements CreateSession, BindShortcuts, ListShortcuts plus the impl Session object
  • on BindShortcuts it turns preferred_trigger (CTRL+SHIFT+W) into a GNOME accelerator (<Control><Shift>w) and adds a regular custom keybinding under org.gnome.settings-daemon.plugins.media-keys, the same kind you add by hand in Settings → Keyboard
  • that keybinding runs a gdbus call back into the backend, which emits Activated (and Deactivated 50 ms later). The frontend forwards it to the app. Since the key only runs a command, focus stays on the window you're looking at, so the extension captures the right one
  • it returns a trigger_description, which T3 Code needs before it treats the shortcut as registered
  • keybindings are removed when the session closes, and leftovers are cleaned up on start

Getting the portal to load it without root took two things:

  • xdg-desktop-portal 1.18 only reads .portal files from /usr/share/xdg-desktop-portal/portals or from XDG_DESKTOP_PORTAL_DIR. I point that variable at a directory in my home (systemd drop-in for xdg-desktop-portal.service) that holds symlinks to the system .portal files plus mine. A small ExecStartPre script rebuilds it on every start so it follows package updates.
  • one thing that cost me a while: with XDG_DESKTOP_PORTAL_DIR set, the frontend also reads portals.conf only from that directory. ~/.config/xdg-desktop-portal/ and the system gnome-portals.conf are skipped, everything falls back to UseIn, and org.freedesktop.portal.Settings silently disappears. So the script also writes a portals.conf there: the system one plus org.freedesktop.impl.portal.GlobalShortcuts=t3shortcuts;.

After that the portal exports GlobalShortcuts (version 1) next to everything it had before, T3 Code's setup goes through step 2 without changes, and SnapShots works. T3 Code does need a restart after the portal restarts, which is #11494.

It's a stopgap. It spawns gdbus per key press and there is no permission prompt, the backend approves whatever is asked. I'd still much rather see the extension own the keybinding itself, as suggested above.

~/.local/libexec/t3-globalshortcuts-portal
python
1#!/usr/bin/python3
2import hashlib
3import sys
4import time
5
6import gi
7
8gi.require_version("Gio", "2.0")
9from gi.repository import Gio, GLib
10
11BUS_NAME = "org.freedesktop.impl.portal.desktop.t3shortcuts"
12PORTAL_PATH = "/org/freedesktop/portal/desktop"
13IFACE = "org.freedesktop.impl.portal.GlobalShortcuts"
14CONTROL_IFACE = BUS_NAME + ".Control"
15SESSION_IFACE = "org.freedesktop.impl.portal.Session"
16
17MEDIA_KEYS = "org.gnome.settings-daemon.plugins.media-keys"
18KEYBINDING = MEDIA_KEYS + ".custom-keybinding"
19KEYBINDING_ROOT = "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/"
20# Everything we create starts with this, so cleanup never touches the
21# user's own keybindings.
22OWN_PREFIX = "portal-shortcut-"
23
24XML = f"""
25<node>
26 <interface name="{IFACE}">
27 <method name="CreateSession">
28 <arg type="o" name="handle" direction="in"/>
29 <arg type="o" name="session_handle" direction="in"/>
30 <arg type="s" name="app_id" direction="in"/>
31 <arg type="a{{sv}}" name="options" direction="in"/>
32 <arg type="u" name="response" direction="out"/>
33 <arg type="a{{sv}}" name="results" direction="out"/>
34 </method>
35 <method name="BindShortcuts">
36 <arg type="o" name="handle" direction="in"/>
37 <arg type="o" name="session_handle" direction="in"/>
38 <arg type="a(sa{{sv}})" name="shortcuts" direction="in"/>
39 <arg type="s" name="parent_window" direction="in"/>
40 <arg type="a{{sv}}" name="options" direction="in"/>
41 <arg type="u" name="response" direction="out"/>
42 <arg type="a{{sv}}" name="results" direction="out"/>
43 </method>
44 <method name="ListShortcuts">
45 <arg type="o" name="handle" direction="in"/>
46 <arg type="o" name="session_handle" direction="in"/>
47 <arg type="u" name="response" direction="out"/>
48 <arg type="a{{sv}}" name="results" direction="out"/>
49 </method>
50 <signal name="Activated">
51 <arg type="o" name="session_handle"/>
52 <arg type="s" name="shortcut_id"/>
53 <arg type="t" name="timestamp"/>
54 <arg type="a{{sv}}" name="options"/>
55 </signal>
56 <signal name="Deactivated">
57 <arg type="o" name="session_handle"/>
58 <arg type="s" name="shortcut_id"/>
59 <arg type="t" name="timestamp"/>
60 <arg type="a{{sv}}" name="options"/>
61 </signal>
62 <signal name="ShortcutsChanged">
63 <arg type="o" name="session_handle"/>
64 <arg type="a(sa{{sv}})" name="shortcuts"/>
65 </signal>
66 <property name="version" type="u" access="read"/>
67 </interface>
68 <interface name="{CONTROL_IFACE}">
69 <method name="Trigger">
70 <arg type="s" name="token" direction="in"/>
71 </method>
72 </interface>
73 <interface name="{SESSION_IFACE}">
74 <method name="Close"/>
75 <signal name="Closed"/>
76 <property name="version" type="u" access="read"/>
77 </interface>
78</node>
79"""
80
81MODIFIERS = {
82 "CTRL": ("<Control>", "Ctrl"),
83 "ALT": ("<Alt>", "Alt"),
84 "SHIFT": ("<Shift>", "Shift"),
85 "LOGO": ("<Super>", "Super"),
86}
87
88
89def parse_trigger(trigger):
90 """'CTRL+SHIFT+W' -> ('<Control><Shift>w', 'Ctrl+Shift+W'), or None."""
91 parts = [p for p in trigger.split("+") if p]
92 if not parts:
93 return None
94 *mods, key = parts
95 accel, label = "", []
96 for mod in mods:
97 if mod.upper() not in MODIFIERS:
98 return None
99 gnome, shown = MODIFIERS[mod.upper()]
100 accel += gnome
101 label.append(shown)
102 # The portal passes keysym names; GNOME wants single letters lowercase.
103 accel += key.lower() if len(key) == 1 else key
104 label.append(key.upper() if len(key) == 1 else key)
105 return accel, "+".join(label)
106
107
108class Keybindings:
109 """The GNOME keybindings that back our portal shortcuts."""
110
111 def __init__(self):
112 self.media_keys = Gio.Settings.new(MEDIA_KEYS)
113
114 def _paths(self):
115 return list(self.media_keys.get_strv("custom-keybindings"))
116
117 def add(self, token, name, accel):
118 path = f"{KEYBINDING_ROOT}{OWN_PREFIX}{token}/"
119 entry = Gio.Settings.new_with_path(KEYBINDING, path)
120 entry.set_string("name", name)
121 entry.set_string(
122 "command",
123 f"gdbus call --session --dest {BUS_NAME} --object-path {PORTAL_PATH} "
124 f"--method {CONTROL_IFACE}.Trigger {token}",
125 )
126 entry.set_string("binding", accel)
127 paths = self._paths()
128 if path not in paths:
129 self.media_keys.set_strv("custom-keybindings", paths + [path])
130 Gio.Settings.sync()
131
132 def remove(self, token):
133 self._drop(lambda p: p == f"{KEYBINDING_ROOT}{OWN_PREFIX}{token}/")
134
135 def remove_all(self):
136 self._drop(lambda p: p.startswith(KEYBINDING_ROOT + OWN_PREFIX))
137
138 def _drop(self, matches):
139 paths = self._paths()
140 gone = [p for p in paths if matches(p)]
141 if not gone:
142 return
143 self.media_keys.set_strv("custom-keybindings", [p for p in paths if p not in gone])
144 for path in gone:
145 entry = Gio.Settings.new_with_path(KEYBINDING, path)
146 for key in ("name", "command", "binding"):
147 entry.reset(key)
148 Gio.Settings.sync()
149
150
151class Backend:
152 def __init__(self):
153 self.node = Gio.DBusNodeInfo.new_for_xml(XML)
154 self.keys = Keybindings()
155 self.connection = None
156 # session_handle -> {"app_id", "registration", "shortcuts": {id: {...}}}
157 self.sessions = {}
158 # token from the GNOME keybinding -> (session_handle, shortcut_id)
159 self.tokens = {}
160
161 def on_bus_acquired(self, connection, _name):
162 self.connection = connection
163 for iface in (IFACE, CONTROL_IFACE):
164 connection.register_object(
165 PORTAL_PATH, self.node.lookup_interface(iface), self.on_call, self.on_get, None
166 )
167 # After a restart nobody knows the old tokens any more, so whatever is
168 # still ours in the GNOME settings is dead weight.
169 self.keys.remove_all()
170
171 def on_get(self, _conn, _sender, _path, _iface, prop):
172 return GLib.Variant("u", 1) if prop == "version" else None
173
174 def on_call(self, _conn, _sender, path, iface, method, params, invocation):
175 try:
176 if iface == SESSION_IFACE:
177 self.close_session(path)
178 invocation.return_value(None)
179 elif iface == CONTROL_IFACE:
180 self.trigger(params.unpack()[0])
181 invocation.return_value(None)
182 elif method == "CreateSession":
183 _handle, session, app_id, _options = params.unpack()
184 self.create_session(session, app_id)
185 invocation.return_value(GLib.Variant("(ua{sv})", (0, {})))
186 elif method == "BindShortcuts":
187 _handle, session, shortcuts, _parent, _options = params.unpack()
188 invocation.return_value(self.reply(self.bind(session, shortcuts)))
189 elif method == "ListShortcuts":
190 _handle, session = params.unpack()
191 invocation.return_value(self.reply(session))
192 except Exception as error: # an error here must not leave the portal hanging
193 print(f"{method}: {error}", file=sys.stderr, flush=True)
194 invocation.return_dbus_error("org.freedesktop.DBus.Error.Failed", str(error))
195
196 def create_session(self, session, app_id):
197 if session in self.sessions:
198 self.close_session(session)
199 # The portal closes a session by calling Close on this object.
200 registration = self.connection.register_object(
201 session, self.node.lookup_interface(SESSION_IFACE), self.on_call, self.on_get, None
202 )
203 self.sessions[session] = {"app_id": app_id, "registration": registration, "shortcuts": {}}
204
205 def bind(self, session, shortcuts):
206 if session not in self.sessions:
207 raise ValueError(f"unknown session {session}")
208 state = self.sessions[session]
209 self.release(session)
210 for shortcut_id, options in shortcuts:
211 description = options.get("description", shortcut_id)
212 parsed = parse_trigger(options.get("preferred_trigger", ""))
213 entry = {"description": description, "label": None, "token": None}
214 if parsed:
215 accel, label = parsed
216 token = hashlib.sha256(f"{session}\0{shortcut_id}".encode()).hexdigest()[:16]
217 self.keys.add(token, f"{state['app_id'] or 'Portal'}: {description}", accel)
218 self.tokens[token] = (session, shortcut_id)
219 entry.update(label=label, token=token)
220 state["shortcuts"][shortcut_id] = entry
221 return session
222
223 def reply(self, session):
224 shortcuts = []
225 for shortcut_id, entry in self.sessions.get(session, {}).get("shortcuts", {}).items():
226 info = {"description": GLib.Variant("s", entry["description"])}
227 if entry["label"]:
228 info["trigger_description"] = GLib.Variant("s", entry["label"])
229 shortcuts.append((shortcut_id, info))
230 return GLib.Variant("(ua{sv})", (0, {"shortcuts": GLib.Variant("a(sa{sv})", shortcuts)}))
231
232 def release(self, session):
233 for entry in self.sessions[session]["shortcuts"].values():
234 if entry["token"]:
235 self.keys.remove(entry["token"])
236 self.tokens.pop(entry["token"], None)
237 self.sessions[session]["shortcuts"] = {}
238
239 def close_session(self, session):
240 if session not in self.sessions:
241 return
242 self.release(session)
243 state = self.sessions.pop(session)
244 self.connection.emit_signal(None, session, SESSION_IFACE, "Closed", None)
245 self.connection.unregister_object(state["registration"])
246
247 def trigger(self, token):
248 if token not in self.tokens:
249 return
250 session, shortcut_id = self.tokens[token]
251 self.emit("Activated", session, shortcut_id)
252 # A GNOME keybinding has no key release; the portal expects one anyway.
253 GLib.timeout_add(50, lambda: self.emit("Deactivated", session, shortcut_id) and False)
254
255 def emit(self, signal, session, shortcut_id):
256 if session in self.sessions:
257 body = GLib.Variant("(osta{sv})", (session, shortcut_id, int(time.time() * 1000), {}))
258 self.connection.emit_signal(None, PORTAL_PATH, IFACE, signal, body)
259
260
261def main():
262 backend = Backend()
263 loop = GLib.MainLoop()
264 Gio.bus_own_name(
265 Gio.BusType.SESSION,
266 BUS_NAME,
267 Gio.BusNameOwnerFlags.NONE,
268 backend.on_bus_acquired,
269 None,
270 lambda *_: loop.quit(),
271 )
272 try:
273 loop.run()
274 finally:
275 backend.keys.remove_all()
276
277
278if __name__ == "__main__":
279 main()
The files around it (replace /home/YOU)

~/.local/share/dbus-1/services/org.freedesktop.impl.portal.desktop.t3shortcuts.service

ini
1[D-BUS Service]
2Name=org.freedesktop.impl.portal.desktop.t3shortcuts
3Exec=/home/YOU/.local/libexec/t3-globalshortcuts-portal

~/.config/systemd/user/xdg-desktop-portal.service.d/t3shortcuts.conf

ini
1[Service]
2ExecStartPre=/home/YOU/.local/libexec/t3-portal-dir-sync
3Environment=XDG_DESKTOP_PORTAL_DIR=/home/YOU/.local/share/xdg-desktop-portal/portals

~/.local/libexec/t3-portal-dir-sync

sh
1#!/bin/sh
2set -eu
3SYSTEM=/usr/share/xdg-desktop-portal
4OWN="$HOME/.local/share/xdg-desktop-portal/portals"
5mkdir -p "$OWN"
6find "$OWN" -maxdepth 1 -type l -delete
7for f in "$SYSTEM"/portals/*.portal; do
8 [ -e "$f" ] && ln -s "$f" "$OWN/$(basename "$f")"
9done
10
11cat > "$OWN/t3shortcuts.portal" <<PORTAL
12[portal]
13DBusName=org.freedesktop.impl.portal.desktop.t3shortcuts
14Interfaces=org.freedesktop.impl.portal.GlobalShortcuts;
15UseIn=gnome
16PORTAL
17
18base=
19for desktop in $(printf '%s' "${XDG_CURRENT_DESKTOP:-}" | tr ':' ' ' | tr '[:upper:]' '[:lower:]'); do
20 [ -z "$base" ] && [ -f "$SYSTEM/$desktop-portals.conf" ] && base="$SYSTEM/$desktop-portals.conf"
21done
22[ -z "$base" ] && [ -f "$SYSTEM/portals.conf" ] && base="$SYSTEM/portals.conf"
23{
24 if [ -n "$base" ]; then cat "$base"; else printf '[preferred]\ndefault=gnome;gtk;\n'; fi
25 echo "org.freedesktop.impl.portal.GlobalShortcuts=t3shortcuts;"
26} > "$OWN/portals.conf"

Then systemctl --user daemon-reload && systemctl --user restart xdg-desktop-portal, and restart T3 Code.