Skip to content

Commit 3b4711d

Browse files
committed
fix(interfaces): allow the desktop interface pinging the IBus portal
IBus sends org.freedesktop.DBus.Peer.Ping before completing a portal connection: g_dbus_connection_call ( bus->priv->connection, IBUS_SERVICE_PORTAL, IBUS_PATH_IBUS, "org.freedesktop.DBus.Peer", "Ping", ... _bus_connect_start_portal_cb, g_object_ref (bus)); The desktop interface currently denies that call, preventing the input context from becoming ready and causing key events to queue and eventually be dropped. Allow Ping specifically for org.freedesktop.portal.IBus and verify the permission in the desktop interface AppArmor test. Assisted-by: Codex:gpt-5.6-sol context7 Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
1 parent d7c520b commit 3b4711d

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

interfaces/builtin/desktop.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,14 @@ dbus (send)
442442
member=CreateInputContext
443443
peer=(name=org.freedesktop.portal.IBus),
444444
445+
# Allow IBus to verify that the portal is responsive before connecting
446+
dbus (send)
447+
bus=session
448+
path=/org/freedesktop/IBus
449+
interface=org.freedesktop.DBus.Peer
450+
member=Ping
451+
peer=(name=org.freedesktop.portal.IBus),
452+
445453
dbus (send, receive)
446454
bus=session
447455
path=/org/freedesktop/IBus/InputContext_[0-9]*

interfaces/builtin/desktop_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ func (s *DesktopInterfaceSuite) TestAppArmorSpec(c *C) {
146146
c.Check(spec.SnippetForTag("snap.consumer.app"), testutil.Contains, "owner @{HOME}/.config/gtk-3.0/{*.css,**/*.css} r,")
147147
c.Check(spec.SnippetForTag("snap.consumer.app"), testutil.Contains, "owner @{HOME}/.config/gtk-4.0/{*.css,**/*.css} r,")
148148
c.Check(spec.SnippetForTag("snap.consumer.app"), testutil.Contains, "# Allow access to xdg-desktop-portal and xdg-document-portal")
149+
c.Check(spec.SnippetForTag("snap.consumer.app"), testutil.Contains, "interface=org.freedesktop.DBus.Peer\n member=Ping\n peer=(name=org.freedesktop.portal.IBus),")
149150

150151
// check desktop interface uses correct label for Mutter when provided
151152
// by the system

0 commit comments

Comments
 (0)