Repository navigation
feat(linux): clipboard, notifications, tray, autostart, shell, shortcuts, network & BLE (Part 2/6) - #38
Conversation
5850f58 to
94f2e46
Compare
Adapt the lifetime-lock ordering and bounded bitmap validation from upstream Linux PR38 to the existing Mac implementations. Hold a safe standard-library file lock through primary lifetime, preserve owned socket cleanup, and stop Mac startup on acquisition errors. Validate the existing PNG encoder's row, filtered-buffer and IDAT limits before indexing or allocating. Keep Windows behavior, dependencies, Qt decoding and ordinary valid PNG bytes. This is source integration and focused test qualification; no new signed app, installation, normal-app native acceptance or publication is implied. Based-on: thtbee#38 Upstream-commit: 94f2e46 Original upstream trailer: Signed-off-by: Jochen Kirstätter <7329802+jochenkirstaetter@users.noreply.github.com> Co-authored-by: Jochen Kirstätter <7329802+jochenkirstaetter@users.noreply.github.com>
thtbee
left a comment
There was a problem hiding this comment.
Thanks Jochen. I checked the four files outside linux/ (core_host.rs, send_to.rs, settings.rs, transfers.rs), and the Windows and macOS paths are unchanged there. Honoring x-kde-passwordManagerHint and x-gnome-privacy-hint in the clipboard is good to see, and so is open_url only taking http(s).
What needs changing:
-
Notification text ends up on the command line (
linux/toast.rs). Phone notifications (SMS, one-time codes, chats) are passed togdbus callandnotify-sendas arguments, so while they run, any other user on the PC can read them inpsor/proc/<pid>/cmdline. We never let message content out like that.gdbus callalso parses each argument as GVariant text, so a body that happens to look like a literal ('ok',@s 'x', numbers) is shown changed. Please send these over D-Bus directly (zbus is pure Rust and MIT/Apache), which fixes both. -
Tray through an embedded
python3script (linux/tray.rs). That's a hidden runtime dependency on python3 plus its GTK bindings, and the labels go on its command line too. Qt already gives us a StatusNotifierItem tray on Linux throughQSystemTrayIcon, which works on KDE and on GNOME with the AppIndicator extension. Could the Linux tray use that instead? -
Clipboard polling with processes (
linux/clipboard.rs). Every 450 ms it startswl-paste --list-typesand then a read, so a few processes a second for as long as the app runs. On GNOME Wayland, which has no data-control protocol,wl-pastehas to map a surface to read, which can steal focus or flicker. The first poll also sends whatever is already on the clipboard when the app starts.QClipboard::dataChangedavoids all of that while our window has focus, andwl-paste --watchis event-driven when it doesn't. Please also seed the last-seen fingerprint at startup so nothing is sent until the user copies something. -
Firewall fix (
linux/doctor.rs,fix_firewall):ufw allow 7718opens the port on every network, including public Wi-Fi. On Windows we only allow it for private networks. Please scope it to local subnets (ufw allow from 192.168.0.0/16 to any port 7718, and the same for 10/8 and 172.16/12), or use a firewalld zone.- The nftables branch adds rules to
inet filter, which may not exist, and they're gone after a reboot. - With no firewall found it returns
Ok(true), so the Doctor says it fixed something it didn't touch. It should beOk(false).
-
Notification forwarding listener (
pc_notifications.rs):- It parses
dbus-monitoroutput line by line, so a body with a newline (most chat previews) loses everything after the first line. - Turning the setting off doesn't stop it, and if
dbus-monitorexits it never starts again.
A zbus
BecomeMonitorsubscription would fix all three. - It parses
-
Runtime tools. This part calls
xclip/xsel/wl-paste,gdbus,notify-send,dbus-monitor,xdotool/kdotool/wmctrl/xpropandpython3. Fewer of them after 1 to 5. Whatever stays, please list in the.debdependencies and the docs, and have the Doctor say when one is missing, so it doesn't fail silently.
Smaller: the autostart Exec= line quotes the path but doesn't escape ", `, $ or \ inside it, as the desktop entry spec asks.
Happy to look again once these are in.
…uts, network & BLE (Part 2) Signed-off-by: Jochen Kirstätter <7329802+jochenkirstaetter@users.noreply.github.com>
Signed-off-by: Jochen Kirstätter <7329802+jochenkirstaetter@users.noreply.github.com>
94f2e46 to
ceb7cb1
Compare
|
Thanks a lot for the quick fixes, Jochen, and for all the work on the port. Since all six parts are ready on your branches, we'd like to help speed things up. We've put your whole series together locally on top of the upcoming release and are reviewing and testing it end to end, with your commits kept as yours. Anything we fix or add goes on top as separate commits, and we'll share those with you once they're in good shape, so you can see what changed and why. The plan is to have the Linux app in the next release. If you can keep testing on your Linux machines, that would help a lot, since we only have WSL here. No need to wait on us for anything. |
|
Quick note on the red CI run, in case it saves you some time: on Windows and macOS, |
…-monitor parser Signed-off-by: Jochen Kirstätter <7329802+jochenkirstaetter@users.noreply.github.com>
|
Hello @thtbee Thanks for picking it up. It's nice to see the collaboration is solid. I'll create the pending four PRs now. I understand your urge to speed up things, please let's not end up in a merge and conflict resolving chaos based on this. I pushed those stacked branches into my repository for backup purpose mainly, not really for pre-mature cross-checks prior to actually creating the PRs. The original draft PR #12 has everything and feedback there could have been used to drive those six stacked branches. Thanks for your understanding and consideration. Cheers |
…ode for watched PIDs Signed-off-by: Jochen Kirstätter <7329802+jochenkirstaetter@users.noreply.github.com>
|
Thanks Jochen, and you're right. I'm sorry for getting ahead of you there. Some context on why we did it: we're preparing the next release and hoped to ship the Linux app in it, so last night we put your whole series together locally and tested it end to end (WSL with WSLg, a CLI phone, the Android emulator, and the packages in clean environments). The idea was only to find problems early, before release day, not to replace your work or run a second copy of it. Looking at it from your side, I can see how a parallel branch with changes on top of your code looks exactly like the merge chaos you want to avoid, and that wasn't fair to you. So from here we'll follow your PRs: no parallel branches to merge, everything goes through your series, and you decide what goes in. So that what we learned doesn't trickle in one review at a time, here it is all at once. I checked each point against your current branches ( Where we already wrote a fix, it's on Part 2 (#38)
Part 3 (#41)
Window capture through Part 4 (
|
|
Hi @thtbee Awesome, thank you so much for the breakdown. We shall have this completed by the end of the day. A couple of hours. Cheers |
… D-Bus, and packaging Applies the Part 2 review improvements and fixes from upstream/linux-review-fixes (b346bfe, 47e3e06, 6291b51, a815275, 0be2ddf, 20c70f3, ccb9318): - USB ADB: retry another local TCP port only when adb reports a port bind failure (47e3e06) - Linux platform layer: native D-Bus/Netlink/Qt integrations for clipboard, tray, notifications (6291b51), single-instance activation token, BlueZ/NetworkManager, Wake-on-LAN, BLE beacon, and clean SIGTERM/SIGINT/SIGHUP shutdown (ccb9318) - Shell & Doctor: remove Windows settings links/explorer.exe shims (20c70f3) and provide plain Linux Doctor readiness checks and wording with German and Chinese translations (a815275) - Release workflow & packaging: pin AppImage tools with SHA-256 verification and smoke-test every Linux package (.deb, AppImage, tarball) with --version (0be2ddf) Many thanks to @thtbee for the thorough review and reference implementation on linux-review-fixes! Co-authored-by: Bee <302257494+thtbee@users.noreply.github.com> Signed-off-by: Jochen Kirstätter <7329802+jochenkirstaetter@users.noreply.github.com>
|
Massive thank you @thtbee for the deep review and for putting together We have merged
|
thtbee
left a comment
There was a problem hiding this comment.
Thank you, Jochen. I went through the final series again file by file against the findings: everything is addressed, and your OpenH264 ABI detection is a nice addition I hadn't thought of. On 0b37495 the full Windows check, fmt, clippy and every test on Linux, the FUSE end-to-end run (read, write, rename, the phone going away and coming back, quit, SIGTERM, and a crash followed by a restart), and all three packages (glibc floor 2.39, started with an empty environment) pass. Approving; I'll merge the parts in order.
Summary
Second slice of splitting the Linux desktop port (#12) into 6 focused, independently reviewable PRs as requested in #12 (review), building on Part 1 (#34).
Every change outside
desktop/app/src/linux/is strictly gated behind#[cfg(target_os = "linux")]/#[cfg(not(target_os = "linux"))]so Windows and macOS code paths remain untouched.What's in Part 2 (
linux-2-basics)desktop/app/src/linux/clipboard.rs):wl-paste/wl-copy), X11 (xclip/xsel), and QtQClipboardfallback for plain text, rich text (text/html,text/rtf), images (image/png), and file URI lists (text/uri-list).x-kde-passwordManagerHint,x-gnome-privacy-hint) and fingerprint deduplication (LAST_REPORTED) to prevent echo loops.desktop/app/src/linux/toast.rs,desktop/app/src/pc_notifications.rs):org.freedesktop.Notificationsintegration viagdbus(withnotify-sendfallback), supporting action buttons, inline replies, in-place progress bar updates (replaces_id+int:value), and notification dismissal signals (ActionInvoked,NotificationReplied,NotificationClosed).dbus-monitorsession bus observer with self-source filtering) inpc_notifications.rs.desktop/app/src/linux/tray.rs):logindPrepareForSleepresume detection, XDG Desktop Portalorg.freedesktop.appearancedark/light mode change monitoring, X11XGrabKeyglobal hotkey listener, and active window tracking/focus (xdotool/kdotool/wmctrl).autostart.rs,shell.rs,jumplist.rs,shortcut.rs,share_target.rs,single_instance.rs,widget.rs):~/.config/autostart/nectarlink.desktop),.desktoplauncher & Quick Actions (jumplist.rs), file-manager "Send to Phone" scripts/menus for Nautilus, KDE Dolphin, and Nemo/Thunar (shortcut.rs), FreeDesktop Trash &org.freedesktop.FileManager1file reveal (shell.rs),flock+ Unix domain socket single-instance IPC (single_instance.rs), and atomicwidget-state.jsonwriter (widget.rs).wifi.rs,wol.rs,ble_beacon.rs,doctor.rs,image.rs,elevated.rs):nmcliWi-Fi status & Instant Hotspot connection (wifi.rs),/sys/class/net+ethtoolWake-on-LAN status & magic packet sender (wol.rs, enablingpc.wakeon Linux), BlueZ LE Advertising Manager beacon (ble_beacon.rs), Linux system diagnostics (doctor.rs),pkexecargument forwarding (elevated.rs), and pure-Rust image decoding/resizing/thumbnailing (image.rs).Series Roadmap
Part 1 ((feat(linux): Linux platform foundation, Qt6 windowing, and packaging (Part 1/6) #34, merged)linux-1-build) — Build, CI, Qt6 windowing,linux/mod.rsfoundation, CLIlinux_watch, and packaginglinux-2-basics) — Clipboard, Freedesktop notifications (toast.rs,pc_notifications.rs), tray & hotkeys, autostart, shell, shortcuts, single-instance, widget, WoL, BLE beacon, and doctor checks (this PR)linux-3-input) — Input injection (uinput/ Wayland / X11), deck actions, frameless Wayland/X11 window move/resize filter, and window capturelinux-4-media) — Audio (wpctl/pactl), low-latency PCM output, PC loopback audio stream, MPRIS (media_sessions.rs,smtc.rs), OpenH264/FFmpeg H.264 & MP4, phone/PC screen mirroring, v4l2loopback virtual camera, PipeWire/PulseAudio virtual microphone, Bluetooth HFP, and voice recording conversionlinux-5-storage) — FUSE3 virtual filesystem (fuser) and file-manager sidebar bookmarks (gtk-3.0/bookmarks,user-places.xbel)linux-6-updater) — Linux HTTP client (curl), self-updater (.deb/.AppImage/.tar.gz), and setup uninstaller