[PR #26] [MERGED] Layout update deadlock fix #27

Closed
opened 2026-05-22 22:04:53 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/system-tray/pull/26
Author: @JakeStanger
Created: 9/20/2025
Status: Merged
Merged: 9/20/2025
Merged by: @JakeStanger

Base: masterHead: fix/layout-update


📝 Commits (5)

  • f7a1551 refactor(menu): avoid logging full icon data in debug impl
  • fdfb100 fix(client): debounce menu layout updates
  • dfaea12 refactor(client): tidy code
  • 1381dc2 chore(examples/basic): add tracing subscriber
  • 80fac4f build(deps): update all

📊 Changes

5 files changed (+274 additions, -96 deletions)

View changed files

📝 Cargo.lock (+165 -64)
📝 Cargo.toml (+5 -4)
📝 examples/basic.rs (+2 -0)
📝 src/client.rs (+49 -26)
📝 src/menu.rs (+53 -2)

📄 Description

This fixes a few things and makes a few code improvements. Most importantly, this fixes a long-standing bug with the dbusmenu implementation where some clients could send an update and cause the client to hang:

VLC (the known example) has a habit of sending a burst of 100+ layout updates within a 30ms timeframe, which exceeds the Tokio/zbus throughput. It's hard to say what happened exactly, but my guess is that some internal mutex got overwhelmed and deadlocked.

The fix is to debounce the events, ie only process the last one within a timeframe. This does add a small (50ms) processing delay but ensures the events get where they're supposed to go.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/system-tray/pull/26 **Author:** [@JakeStanger](https://github.com/JakeStanger) **Created:** 9/20/2025 **Status:** ✅ Merged **Merged:** 9/20/2025 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `master` ← **Head:** `fix/layout-update` --- ### 📝 Commits (5) - [`f7a1551`](https://github.com/JakeStanger/system-tray/commit/f7a15519c900f773e4ed052a847e9a0ae1bf389e) refactor(menu): avoid logging full icon data in debug impl - [`fdfb100`](https://github.com/JakeStanger/system-tray/commit/fdfb100ccc9b237b5ebc0fd6b4d3e6fe150804eb) fix(client): debounce menu layout updates - [`dfaea12`](https://github.com/JakeStanger/system-tray/commit/dfaea12c8bafa2599dee0c2e31f1ad033ce53cae) refactor(client): tidy code - [`1381dc2`](https://github.com/JakeStanger/system-tray/commit/1381dc215dce9b1f1d080e48e2917e4b0b570257) chore(examples/basic): add tracing subscriber - [`80fac4f`](https://github.com/JakeStanger/system-tray/commit/80fac4fda349a8f34953df009cfc2cec153fef2a) build(deps): update all ### 📊 Changes **5 files changed** (+274 additions, -96 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+165 -64) 📝 `Cargo.toml` (+5 -4) 📝 `examples/basic.rs` (+2 -0) 📝 `src/client.rs` (+49 -26) 📝 `src/menu.rs` (+53 -2) </details> ### 📄 Description This fixes a few things and makes a few code improvements. Most importantly, this fixes a long-standing bug with the `dbusmenu` implementation where some clients could send an update and cause the client to hang: VLC (the known example) has a habit of sending a burst of 100+ layout updates within a 30ms timeframe, which exceeds the Tokio/zbus throughput. It's hard to say what happened exactly, but my guess is that some internal mutex got overwhelmed and deadlocked. The fix is to debounce the events, ie only process the last one within a timeframe. This does add a small (50ms) processing delay but ensures the events get where they're supposed to go. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-22 22:04:53 +01:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/system-tray#27
No description provided.