Repository navigation
Fix Linux notification clicks not focusing BB, and publish macOS 13 update requirement - #4483
Merged
SawyerHood merged 2 commits intoOct 1, 2026
Conversation
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Replaces #3692, which the stale-PR automation closed without a review. This branch is rebased onto
b23150d88and re-verified from scratch.On Linux Wayland, clicking a BB desktop notification opens the right thread but leaves BB minimized or behind other windows. There are two causes, and both are still present on current
main:libnotify.so.4inusr/lib. It shadows the system library and has no activation-token API (notify_notification_get_activation_token). Electron 44 can only forward the compositor's xdg-activation token when that API exists, so GNOME and KWin refuse the focus request. The running 0.43.5 nightly maps/tmp/.mount_bb_*/usr/lib/libnotify.so.4.0.0, not the system 0.8.8.plugins/push-notifications/client.tsonly calls rendererwindow.focus(). That can't un-minimize or raise a Wayland toplevel.Separately,
generate-version-feed.mtsstill publishesminimumSystemVersion: nulleven thoughelectron-builder.config.jsonrequires macOS 13.0.0. The updater therefore can't keep macOS 12 users off releases that won't launch for them.What changed
patches/app-builder-lib@26.15.7.patch: AppImage staging renames the bundledlibnotify.so.4to unversionedlibnotify.so. Electron tries the system's versioned library first and falls back to the bundled copy.smoke-linux-appimage-lifecycle.mjsasserts this layout.desktop-window-focus.ts,main.ts,preload.ts,desktop-window-command-ipc.ts,desktop-contract/info.ts: new payload-freefocusWindow()preload method and IPC. Only a registered application webContents may call it, and it restores, shows and focuses that sender's own window.push-notifications/client.ts: on Linux desktop, a notification click also callsbbDesktop.focusWindow()when available.window.focus()and routing are unchanged. Older shells without the method keep the previous behavior. Web and macOS are unchanged.generate-version-feed.mts: macOS JSON and YAML feeds publishminimumSystemVersion: 22.0.0(Darwin for macOS 13) and keep the other YAML metadata.apps/desktop/package.json:testinstalls Electron's lazy runtime first, so parallel desktop tests don't race to download it.No server/daemon wire change and no
HOST_DAEMON_PROTOCOL_VERSIONbump.How you verified
Before/after on real desktops. AppImages were built from upstream
mainb23150d88and from this branch. Each was run in a fresh Ubuntu 26.04 QEMU/KVM guest on native Wayland: GNOME Shell 50.1 and KDE Plasma/KWin 6.6.6, both with system libnotify 0.8.8. Each case launched BB fresh against an isolated server built from the same commit, then either minimized BB or covered it with another app's window. A real Codex turn on "Notification target" produced the notification, and the QEMU pointer clicked it. Focus was checked in Electron, in the renderer (document.hasFocus()), and in the compositor (the focused window's PID from a GNOME Shell extension or KWin script).main, BB minimizedmain, BB behind another windowLD_PRELOADThe two controls show that both halves of the fix are needed. Process maps confirm which libnotify each run loaded:
mainloads the AppImage'slibnotify.so.4.0.0, and this PR loads/usr/lib/x86_64-linux-gnu/libnotify.so.4.0.0.GNOME, BB minimized (left: main, right: this PR)
KDE, BB minimized (left: main, right: this PR)
GNOME and KDE, BB behind another window
Stills: notification shown and result after click
MP4s, the per-case summary and the method are in this gist.
Tests (Node 22.19.0 per
.nvmrc):pnpm exec turbo run test typecheck --filter=@bb/desktop --filter=bb-plugin-push-notifications --filter=@bb/desktop-contractpasses 12/12 tasks: desktop 454 passed with 1 existing skip, push notifications 24, desktop contract 22. Under Node 26,client.test.tsfails onmaintoo (localStorageis undefined), so that failure is not from this change.turbo run desktop:build:linux --filter=@bb/desktoppasses, and the extracted AppImage containsusr/lib/libnotify.so -> libnotify.so.4.0.0with nolibnotify.so.4. The feed change is covered bydesktop-version-feed.test.ts.Not tested: signed macOS GUI notifications and updater install on macOS 12, standalone Xorg, and other Linux distributions. On Wayland, focus still needs compositor xdg-activation support and a system libnotify of 0.7.10 or later. Without one, BB falls back to the bundled library: notifications still open the thread, but BB can't take focus.
🤖 Generated with Claude Code