feat: Unified IPC-based status bar updates with i3status-rs support#198
Conversation
This introduces the `UpdateStatus` IPC command in the rust backend replacing the outdated `xsetroot` method to set status bar text. It now seamlessly triggers both X11 (updating all monitors) and Wayland bar redraws using the existing `bar_update_seq` invalidation mechanism. Additionally, this allows parsing native `i3status-rs` JSON format directly, translating it into internal string rendering opcodes for instantWM to seamlessly use its features. If the JSON is invalid or absent, it falls back to parsing regular instantWM bar opcode string. Co-authored-by: paperbenni <15818888+paperbenni@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Reviewer's GuideImplements a new IPC-based mechanism for updating the status bar text (including i3status-rs/i3bar JSON support) and ensures both X11 and Wayland bars are properly redrawn on status changes, while cleaning up some X11 property handling. Sequence diagram for IPC-based status bar updatesequenceDiagram
actor User
participant Instantwmctl
participant IpcSocket
participant Wm
participant BackendX11
participant BackendWayland
participant Bar
User->>Instantwmctl: instantwmctl update-status text
Instantwmctl->>IpcSocket: send IpcCommand.UpdateStatus(text)
IpcSocket->>Wm: deliver UpdateStatus(text)
Wm->>Wm: set g.status_text = text
Wm->>Bar: bar.mark_dirty()
alt backend is X11
Wm->>BackendX11: ctx = wm.ctx()
BackendX11->>BackendX11: match WmCtx.X11(ctx)
BackendX11->>Bar: draw_bars_x11(core, x11, x11_runtime, systray)
else backend is Wayland
Wm->>BackendWayland: bar.mark_dirty() triggers redraw
end
Bar-->>User: updated status visible on all monitors
Class diagram for status item parsing with i3bar JSON supportclassDiagram
class StatusItem {
<<enum>>
+Text(String)
+SetFg(String)
+SetBg(String)
+ResetColors
}
class StatusParser {
+parse_status_items(bytes: U8Slice) Vec_StatusItem
+parse_i3bar_json(bytes: U8Slice) Option_Vec_StatusItem
}
class SerdeJson {
+from_str(json_str: String) Vec_Value
}
StatusParser ..> StatusItem : produces
StatusParser ..> SerdeJson : uses
SerdeJson ..> StatusItem : values_mapped_to
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
📝 WalkthroughWalkthroughThis PR introduces i3bar JSON parsing support for the status bar and adds a new UpdateStatus IPC command that allows dynamic status text updates via CLI and IPC, while adding serde_json as a dependency and refactoring atom comparisons for consistency. Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as instantwmctl CLI
participant IPC as IPC Server
participant WM as Window Manager
participant X11 as X11 Backend
CLI->>IPC: UpdateStatus(text)
IPC->>WM: Dispatch UpdateStatus
WM->>WM: wm.g.status_text = text
WM->>X11: draw_bars_x11()
X11->>X11: Render status bar
X11-->>WM: Rendering complete
WM->>IPC: Return OK
IPC-->>CLI: Command completed
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- In
parse_i3bar_json, you always returnSome(items)even whenitemsis empty, which prevents the legacy parser from running; consider returningNonewhen noStatusItems were produced so the fallback path still works. - The comparison
e.atom == u32::from(u32::from(AtomEnum::WM_NAME))inevents.rslooks like an accidental double conversion and should likely be simplified to a singleu32::from(AtomEnum::WM_NAME)for clarity and correctness. - It looks like temporary patch artifacts (
patch.diff,events.rs.orig,events.rs.patch,events.rs.rej) were committed; these should be removed from the repo before merging.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `parse_i3bar_json`, you always return `Some(items)` even when `items` is empty, which prevents the legacy parser from running; consider returning `None` when no `StatusItem`s were produced so the fallback path still works.
- The comparison `e.atom == u32::from(u32::from(AtomEnum::WM_NAME))` in `events.rs` looks like an accidental double conversion and should likely be simplified to a single `u32::from(AtomEnum::WM_NAME)` for clarity and correctness.
- It looks like temporary patch artifacts (`patch.diff`, `events.rs.orig`, `events.rs.patch`, `events.rs.rej`) were committed; these should be removed from the repo before merging.
## Individual Comments
### Comment 1
<location path="rust/src/bar/status.rs" line_range="77-79" />
<code_context>
+ if let Some(full_text) = obj.get("full_text").and_then(Value::as_str) {
+ items.push(StatusItem::Text(full_text.to_string()));
+ }
+ if !items.is_empty() {
+ items.push(StatusItem::ResetColors);
+ items.push(StatusItem::Text(" ".to_string()));
+ }
+ }
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Using the global `items` emptiness to decide on `ResetColors`/spacing can misfire when earlier blocks have already added items.
Because this check is based on the global `items` list rather than the current `block`, later blocks that add no items will still append `ResetColors` and a space as long as any earlier block added something. That can introduce separators/resets with no corresponding content. Consider tracking whether the current block added items (e.g., a `block_had_items` flag) and using that for this condition instead.
Suggested implementation:
```rust
let mut items = Vec::new();
for block in array {
let obj = block.as_object()?;
let mut block_had_items = false;
```
```rust
if let Some(bg) = obj.get("background").and_then(Value::as_str) {
if bg.starts_with('#') {
block_had_items = true;
items.push(StatusItem::SetBg(bg.to_string()));
}
}
if let Some(full_text) = obj.get("full_text").and_then(Value::as_str) {
block_had_items = true;
items.push(StatusItem::Text(full_text.to_string()));
}
```
```rust
if let Some(full_text) = obj.get("full_text").and_then(Value::as_str) {
block_had_items = true;
items.push(StatusItem::Text(full_text.to_string()));
}
if block_had_items {
items.push(StatusItem::ResetColors);
items.push(StatusItem::Text(" ".to_string()));
}
```
```rust
```
I only see part of the block-processing logic. For the behavior to be fully correct, every place inside the `for block in array` loop that pushes a `StatusItem` for that block (e.g., foreground color, underline, icons, short_text, etc.) should also set `block_had_items = true` right before or after the `items.push(...)`. That ensures the `ResetColors`/spacing is only added when the current block contributed at least one item.
</issue_to_address>
### Comment 2
<location path="rust/src/events.rs" line_range="582" />
<code_context>
+
+ let net_wm_name = ctx.x11_runtime.netatom.wm_name;
+- if e.atom == u32::from(AtomEnum::WM_NAME as u32) || e.atom == net_wm_name {
++ if e.atom == u32::from(u32::from(AtomEnum::WM_NAME)) || e.atom == net_wm_name {
+ update_title_x11(&mut ctx.core, &ctx.x11, ctx.x11_runtime, win);
+ }
</code_context>
<issue_to_address>
**issue:** There appears to be an unnecessary double `u32::from` conversion on `AtomEnum::WM_NAME`.
`u32::from(u32::from(AtomEnum::WM_NAME))` converts the atom enum twice and is likely an accidental change. Please simplify to a single `u32::from(AtomEnum::WM_NAME)` (or match the pattern used for other atoms in this file) to keep the intent clear and avoid any potential type/trait resolution quirks.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| if !items.is_empty() { | ||
| items.push(StatusItem::ResetColors); | ||
| items.push(StatusItem::Text(" ".to_string())); |
There was a problem hiding this comment.
suggestion (bug_risk): Using the global items emptiness to decide on ResetColors/spacing can misfire when earlier blocks have already added items.
Because this check is based on the global items list rather than the current block, later blocks that add no items will still append ResetColors and a space as long as any earlier block added something. That can introduce separators/resets with no corresponding content. Consider tracking whether the current block added items (e.g., a block_had_items flag) and using that for this condition instead.
Suggested implementation:
let mut items = Vec::new();
for block in array {
let obj = block.as_object()?;
let mut block_had_items = false; if let Some(bg) = obj.get("background").and_then(Value::as_str) {
if bg.starts_with('#') {
block_had_items = true;
items.push(StatusItem::SetBg(bg.to_string()));
}
}
if let Some(full_text) = obj.get("full_text").and_then(Value::as_str) {
block_had_items = true;
items.push(StatusItem::Text(full_text.to_string()));
} if let Some(full_text) = obj.get("full_text").and_then(Value::as_str) {
block_had_items = true;
items.push(StatusItem::Text(full_text.to_string()));
}
if block_had_items {
items.push(StatusItem::ResetColors);
items.push(StatusItem::Text(" ".to_string()));
}I only see part of the block-processing logic. For the behavior to be fully correct, every place inside the for block in array loop that pushes a StatusItem for that block (e.g., foreground color, underline, icons, short_text, etc.) should also set block_had_items = true right before or after the items.push(...). That ensures the ResetColors/spacing is only added when the current block contributed at least one item.
|
|
||
| let net_wm_name = ctx.x11_runtime.netatom.wm_name; | ||
| if e.atom == AtomEnum::WM_NAME.into() || e.atom == net_wm_name { | ||
| if e.atom == u32::from(u32::from(AtomEnum::WM_NAME)) || e.atom == net_wm_name { |
There was a problem hiding this comment.
issue: There appears to be an unnecessary double u32::from conversion on AtomEnum::WM_NAME.
u32::from(u32::from(AtomEnum::WM_NAME)) converts the atom enum twice and is likely an accidental change. Please simplify to a single u32::from(AtomEnum::WM_NAME) (or match the pattern used for other atoms in this file) to keep the intent clear and avoid any potential type/trait resolution quirks.
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
rust/Cargo.toml (1)
49-49: Consider using semver-compatible version specification.The dependency is pinned to a specific patch version
1.0.149. Consider using"1.0"to allow compatible updates, unless strict pinning is intentional for reproducibility.♻️ Suggested change
-serde_json = "1.0.149" +serde_json = "1.0"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@rust/Cargo.toml` at line 49, The Cargo.toml currently pins serde_json to an exact patch "1.0.149"; change the version spec for the serde_json dependency to a semver-compatible string like "1.0" (in Cargo.toml, the serde_json dependency entry) so Cargo can pull compatible patch/minor updates while preserving the 1.0 API compatibility unless strict pinning is required.rust/src/bar/status.rs (1)
63-63: Early return on non-object blocks may be too strict.Using
?onblock.as_object()causes the entire JSON parsing to fail if any single block is not an object. Consider whether a malformed block should skip to fallback parsing or just skip that block.♻️ Alternative: skip non-object blocks instead of failing
for block in array { - let obj = block.as_object()?; + let Some(obj) = block.as_object() else { + continue; + }; if let Some(color) = obj.get("color").and_then(Value::as_str) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@rust/src/bar/status.rs` at line 63, The current use of the try-operator on block.as_object() (let obj = block.as_object()?) causes the whole parse to fail when a single block is not an object; change the logic in the function handling blocks to treat non-object blocks as non-fatal by replacing the try with an explicit check (e.g., if let Some(obj) = block.as_object() { ... } else { continue; }) so malformed/non-object blocks are skipped and fallback parsing or subsequent blocks can proceed; update any downstream uses of obj inside that scope accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@rust/src/bar/status.rs`:
- Around line 55-83: In parse_i3bar_json, the code appends
StatusItem::ResetColors and a space whenever the cumulative items Vec is
non-empty, causing empty blocks to spuriously add separators; fix by tracking
per-block contributions (e.g., create a local block_items Vec or a boolean flag
inside the for loop), push SetFg/SetBg/Text into that per-block container, and
only when that per-block container is non-empty append ResetColors and Text(" ")
to the main items and/or extend items with the block_items; this ensures
ResetColors and spacing are only added for blocks that actually produced
content.
In `@rust/src/events.rs`:
- Line 582: The condition comparing e.atom to the WM_NAME atom uses a redundant
nested conversion u32::from(u32::from(AtomEnum::WM_NAME)); update the comparison
in events.rs (the if that checks e.atom == ...) to use a single conversion
u32::from(AtomEnum::WM_NAME) (as done earlier around the other WM_NAME check) so
the outer u32::from is removed and the comparison remains e.atom ==
u32::from(AtomEnum::WM_NAME) || e.atom == net_wm_name.
In `@rust/src/events.rs.orig`:
- Line 582: The comparison uses a redundant cast: replace the expression
u32::from(AtomEnum::WM_NAME as u32) with u32::from(AtomEnum::WM_NAME) so the
AtomEnum::WM_NAME value is converted directly; update the condition that
compares e.atom (and net_wm_name) to use u32::from(AtomEnum::WM_NAME) to match
the style used elsewhere.
In `@rust/src/events.rs.rej`:
- Around line 1-11: Remove the rejected patch file rust/src/events.rs.rej from
the commit (it’s a temporary patch rejection artifact); ensure the real source
file rust/src/events.rs contains the intended code in the property_notify
function (check the AtomEnum usage around AtomEnum::WM_NAME and netatom.wm_name
and the call to update_title_x11(&mut ctx.core, &ctx.x11, ctx.x11_runtime, win))
and commit only the corrected rust/src/events.rs rather than the .rej file.
In `@rust/src/ipc.rs`:
- Line 1: The file imports draw_bar but doesn't use it; remove the unused import
or replace it with the correct symbol. Locate the use of draw_bars_x11 in this
module (call site referenced as draw_bars_x11) and either delete the unused use
crate::bar::draw_bar; import or change it to use crate::bar::draw_bars_x11 so
the imported symbol matches the actual function used (draw_bars_x11) and
eliminate the unused-import warning.
---
Nitpick comments:
In `@rust/Cargo.toml`:
- Line 49: The Cargo.toml currently pins serde_json to an exact patch "1.0.149";
change the version spec for the serde_json dependency to a semver-compatible
string like "1.0" (in Cargo.toml, the serde_json dependency entry) so Cargo can
pull compatible patch/minor updates while preserving the 1.0 API compatibility
unless strict pinning is required.
In `@rust/src/bar/status.rs`:
- Line 63: The current use of the try-operator on block.as_object() (let obj =
block.as_object()?) causes the whole parse to fail when a single block is not an
object; change the logic in the function handling blocks to treat non-object
blocks as non-fatal by replacing the try with an explicit check (e.g., if let
Some(obj) = block.as_object() { ... } else { continue; }) so
malformed/non-object blocks are skipped and fallback parsing or subsequent
blocks can proceed; update any downstream uses of obj inside that scope
accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 72a08541-0555-4860-a2aa-046ad05012de
⛔ Files ignored due to path filters (1)
rust/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (10)
patch.diffrust/Cargo.tomlrust/src/bar/status.rsrust/src/bin/instantwmctl.rsrust/src/events.rsrust/src/events.rs.origrust/src/events.rs.patchrust/src/events.rs.rejrust/src/ipc.rsrust/src/ipc_types.rs
| fn parse_i3bar_json(bytes: &[u8]) -> Option<Vec<StatusItem>> { | ||
| let mut json_str = std::str::from_utf8(bytes).ok()?; | ||
| if json_str.starts_with(',') { | ||
| json_str = &json_str[1..]; | ||
| } | ||
| let array: Vec<Value> = serde_json::from_str(json_str).ok()?; | ||
| let mut items = Vec::new(); | ||
| for block in array { | ||
| let obj = block.as_object()?; | ||
| if let Some(color) = obj.get("color").and_then(Value::as_str) { | ||
| if color.starts_with('#') { | ||
| items.push(StatusItem::SetFg(color.to_string())); | ||
| } | ||
| } | ||
| if let Some(bg) = obj.get("background").and_then(Value::as_str) { | ||
| if bg.starts_with('#') { | ||
| items.push(StatusItem::SetBg(bg.to_string())); | ||
| } | ||
| } | ||
| if let Some(full_text) = obj.get("full_text").and_then(Value::as_str) { | ||
| items.push(StatusItem::Text(full_text.to_string())); | ||
| } | ||
| if !items.is_empty() { | ||
| items.push(StatusItem::ResetColors); | ||
| items.push(StatusItem::Text(" ".to_string())); | ||
| } | ||
| } | ||
| Some(items) | ||
| } |
There was a problem hiding this comment.
Logic bug: ResetColors and spacing appended incorrectly for empty blocks.
The check at lines 77-80 tests if items is globally non-empty, not whether the current block contributed any items. After processing the first block with content, subsequent blocks that have no color, background, or full_text will still append ResetColors and a space because items is already non-empty from previous iterations.
🐛 Proposed fix: track per-block item count
fn parse_i3bar_json(bytes: &[u8]) -> Option<Vec<StatusItem>> {
let mut json_str = std::str::from_utf8(bytes).ok()?;
if json_str.starts_with(',') {
json_str = &json_str[1..];
}
let array: Vec<Value> = serde_json::from_str(json_str).ok()?;
let mut items = Vec::new();
for block in array {
let obj = block.as_object()?;
+ let items_before = items.len();
if let Some(color) = obj.get("color").and_then(Value::as_str) {
if color.starts_with('#') {
items.push(StatusItem::SetFg(color.to_string()));
}
}
if let Some(bg) = obj.get("background").and_then(Value::as_str) {
if bg.starts_with('#') {
items.push(StatusItem::SetBg(bg.to_string()));
}
}
if let Some(full_text) = obj.get("full_text").and_then(Value::as_str) {
items.push(StatusItem::Text(full_text.to_string()));
}
- if !items.is_empty() {
+ if items.len() > items_before {
items.push(StatusItem::ResetColors);
items.push(StatusItem::Text(" ".to_string()));
}
}
Some(items)
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@rust/src/bar/status.rs` around lines 55 - 83, In parse_i3bar_json, the code
appends StatusItem::ResetColors and a space whenever the cumulative items Vec is
non-empty, causing empty blocks to spuriously add separators; fix by tracking
per-block contributions (e.g., create a local block_items Vec or a boolean flag
inside the for loop), push SetFg/SetBg/Text into that per-block container, and
only when that per-block container is non-empty append ResetColors and Text(" ")
to the main items and/or extend items with the block_items; this ensures
ResetColors and spacing are only added for blocks that actually produced
content.
|
|
||
| let net_wm_name = ctx.x11_runtime.netatom.wm_name; | ||
| if e.atom == AtomEnum::WM_NAME.into() || e.atom == net_wm_name { | ||
| if e.atom == u32::from(u32::from(AtomEnum::WM_NAME)) || e.atom == net_wm_name { |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
x11rb AtomEnum Into u32 conversion
💡 Result:
In x11rb, Atom is just a u32 type alias. (docs.rs)
So you can convert an AtomEnum to u32 with From/Into:
use x11rb::protocol::xproto::AtomEnum;
let id1: u32 = AtomEnum::WM_NAME.into();
let id2: u32 = u32::from(AtomEnum::WM_NAME);AtomEnum explicitly implements From<AtomEnum> for u32, so both forms work (the .into() form just needs the target type known). (docs.rs)
Citations:
- 1: https://docs.rs/x11rb-protocol/latest/x11rb_protocol/protocol/xproto/type.Atom.html
- 2: https://docs.rs/x11rb-protocol/latest/x11rb_protocol/protocol/xproto/struct.AtomEnum.html
🏁 Script executed:
fd "events.rs" --type f rust/Repository: instantOS/instantWM
Length of output: 184
🏁 Script executed:
sed -n '550,555p' rust/src/events.rsRepository: instantOS/instantWM
Length of output: 260
🏁 Script executed:
sed -n '580,585p' rust/src/events.rsRepository: instantOS/instantWM
Length of output: 304
Remove redundant outer u32::from() call.
Line 582 has a redundant nested u32::from(u32::from(AtomEnum::WM_NAME)) conversion. The inner u32::from() already produces a u32, making the outer call unnecessary. Line 552 uses the correct single conversion for the same WM_NAME comparison.
🐛 Proposed fix
- if e.atom == u32::from(u32::from(AtomEnum::WM_NAME)) || e.atom == net_wm_name {
+ if e.atom == u32::from(AtomEnum::WM_NAME) || e.atom == net_wm_name {
update_title_x11(&mut ctx.core, &ctx.x11, ctx.x11_runtime, win);
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if e.atom == u32::from(u32::from(AtomEnum::WM_NAME)) || e.atom == net_wm_name { | |
| if e.atom == u32::from(AtomEnum::WM_NAME) || e.atom == net_wm_name { | |
| update_title_x11(&mut ctx.core, &ctx.x11, ctx.x11_runtime, win); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@rust/src/events.rs` at line 582, The condition comparing e.atom to the
WM_NAME atom uses a redundant nested conversion
u32::from(u32::from(AtomEnum::WM_NAME)); update the comparison in events.rs (the
if that checks e.atom == ...) to use a single conversion
u32::from(AtomEnum::WM_NAME) (as done earlier around the other WM_NAME check) so
the outer u32::from is removed and the comparison remains e.atom ==
u32::from(AtomEnum::WM_NAME) || e.atom == net_wm_name.
| } | ||
|
|
||
| let net_wm_name = ctx.x11_runtime.netatom.wm_name; | ||
| if e.atom == u32::from(AtomEnum::WM_NAME as u32) || e.atom == net_wm_name { |
There was a problem hiding this comment.
Redundant as u32 cast inside u32::from().
Line 582 uses u32::from(AtomEnum::WM_NAME as u32) which is redundant—casting to u32 then calling u32::from() on a u32 is a no-op. This is inconsistent with line 552 which correctly uses u32::from(AtomEnum::WM_NAME).
🧹 Proposed fix
- if e.atom == u32::from(AtomEnum::WM_NAME as u32) || e.atom == net_wm_name {
+ if e.atom == u32::from(AtomEnum::WM_NAME) || e.atom == net_wm_name {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if e.atom == u32::from(AtomEnum::WM_NAME as u32) || e.atom == net_wm_name { | |
| if e.atom == u32::from(AtomEnum::WM_NAME) || e.atom == net_wm_name { |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@rust/src/events.rs.orig` at line 582, The comparison uses a redundant cast:
replace the expression u32::from(AtomEnum::WM_NAME as u32) with
u32::from(AtomEnum::WM_NAME) so the AtomEnum::WM_NAME value is converted
directly; update the condition that compares e.atom (and net_wm_name) to use
u32::from(AtomEnum::WM_NAME) to match the style used elsewhere.
| --- rust/src/events.rs | ||
| +++ rust/src/events.rs | ||
| @@ -581,7 +581,7 @@ pub fn property_notify(ctx: &mut WmCtxX11<'_>, e: &PropertyNotifyEvent) { | ||
| } | ||
|
|
||
| let net_wm_name = ctx.x11_runtime.netatom.wm_name; | ||
| - if e.atom == u32::from(AtomEnum::WM_NAME) || e.atom == net_wm_name { | ||
| + if e.atom == u32::from(AtomEnum::WM_NAME as u32) || e.atom == net_wm_name { | ||
| update_title_x11(&mut ctx.core, &ctx.x11, ctx.x11_runtime, win); | ||
| } | ||
| }; |
There was a problem hiding this comment.
Remove .rej file from the commit.
This is a patch rejection file (events.rs.rej) generated during a failed patch application. It should not be committed to the repository—these are temporary artifacts that indicate merge/patch conflicts.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@rust/src/events.rs.rej` around lines 1 - 11, Remove the rejected patch file
rust/src/events.rs.rej from the commit (it’s a temporary patch rejection
artifact); ensure the real source file rust/src/events.rs contains the intended
code in the property_notify function (check the AtomEnum usage around
AtomEnum::WM_NAME and netatom.wm_name and the call to update_title_x11(&mut
ctx.core, &ctx.x11, ctx.x11_runtime, win)) and commit only the corrected
rust/src/events.rs rather than the .rej file.
| @@ -1,3 +1,4 @@ | |||
| use crate::bar::draw_bar; | |||
There was a problem hiding this comment.
Unused import: draw_bar.
This import is not used in the file. Line 292 calls draw_bars_x11, not draw_bar. The import should be removed or replaced.
🧹 Proposed fix
-use crate::bar::draw_bar;
+use crate::bar::draw_bars_x11;Then update line 292 to use the imported name directly if preferred, or remove the import entirely since draw_bars_x11 is already called with its full path at crate::bar::draw_bars_x11.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@rust/src/ipc.rs` at line 1, The file imports draw_bar but doesn't use it;
remove the unused import or replace it with the correct symbol. Locate the use
of draw_bars_x11 in this module (call site referenced as draw_bars_x11) and
either delete the unused use crate::bar::draw_bar; import or change it to use
crate::bar::draw_bars_x11 so the imported symbol matches the actual function
used (draw_bars_x11) and eliminate the unused-import warning.
UpdateStatuscommand to IPC Enum.instantwmctl update-status "text"in CLI.parse_status_itemsto gracefully readi3status-rsstandard output line format (JSON block array format) or fallback.draw_bars_x11for all monitors instead of justselmon_idx.bar.mark_dirty()method to bump layout seq invalidation natively.PR created automatically by Jules for task 10398353351146917924 started by @paperbenni
Summary by Sourcery
Introduce IPC-driven status bar updates and broaden status parsing to support i3bar/i3status-rs output while ensuring bars redraw correctly on X11 and Wayland.
New Features:
Enhancements:
Summary by CodeRabbit
New Features
Chores