[GH-ISSUE #798] Workspaces gets stuck after dpms cycle/monitor connect #5872

Open
opened 2026-05-23 01:53:42 +01:00 by JakeStanger · 7 comments
Owner

Originally created by @chmanie on GitHub (Dec 2, 2024).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/798

Describe the bug
I'm on Hyprland and I'm having the issue that after a while the focused workspace is "stuck" at a certain number and won't change until I issue ironbar reload. Also, no new workspaces are recognized and added. Everything else (like hover) seems to still work fine.

The log might be helpful (maybe?):

2024-12-02T17:32:23.751961Z  INFO ironbar: 134: Ironbar version 0.16.1
2024-12-02T17:32:23.751986Z  INFO ironbar: 135: Starting application
2024-12-02T17:32:23.836061Z  WARN GTK: 112: [Gtk] Theme parsing error: gtk-dark.css:6691:68: Invalid name of pseudo-class
2024-12-02T17:32:23.856208Z  INFO ironbar::ipc::server: 39: Starting IPC on /run/user/1000/ironbar-ipc.sock
2024-12-02T17:32:23.857272Z  INFO ironbar::bar: 117: Initializing bar 'bar-8' on 'DP-2'
2024-12-02T17:32:23.858753Z  INFO ironbar::clients::compositor::hyprland: 32: Starting Hyprland event listener
2024-12-02T17:32:23.868836Z  INFO ironbar::clients::volume: 168: connected to server
2024-12-02T17:32:23.988301Z  WARN GTK: 112: [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled
2024-12-02T17:32:23.988337Z  WARN GTK: 112: [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled
2024-12-02T17:32:23.988345Z  WARN GTK: 112: [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled
2024-12-02T17:32:24.740601Z  WARN GTK: 112: [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled
2024-12-02T17:32:24.872342Z  WARN GTK: 112: [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled
2024-12-02T17:32:31.226025Z ERROR ironbar::logging: 49: The application panicked (crashed).
Message:  Failed to get workspaces: SerdeError(Error("invalid number", line: 59, column: 18))
Location: src/clients/compositor/hyprland.rs:243

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

2024-12-02T17:32:31.226629Z ERROR GTK: 111: [Gdk] CRITICAL: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

[...] omitted. It's the same GTK error for ~200x within the 10s of screen power cycle

2024-12-02T17:32:43.130341Z  INFO ironbar::bar: 117: Initializing bar 'bar-16' on 'DP-2'
2024-12-02T17:32:48.056530Z  INFO ironbar: 192: Shutting down

To Reproduce
Steps to reproduce the behavior:

  1. Use Hyprland on an external screen
  2. Have ironbar running
  3. Switch off the screen, then switch it on again
  4. Switch the current workspace to another one
  5. The focused workspace is stuck at the one that it was before switching off the screen

Expected behavior
The focused workspace changes in sync with the Hyprland workspace

System information:

  • Distro: NixOS 24.11
  • Compositor: Hyprland 0.45.2 built from branch v0.45.2-b at commit 12f9a0d0b93f691d4d9923716557154d74777b0a
  • Ironbar version: 0.16.1

I also tested this with this PR: https://github.com/JakeStanger/ironbar/pull/748 to the same result.

Configuration

Config
{
  "anchor_to_edges": true,
  "center": [],
  "end": [
    {
      "icon_size": 34,
      "type": "tray"
    },
    {
      "type": "volume"
    },
    {
      "label": "{{100000:/nix/store/8zlq6r23cwwkwzkk7dcrymjk52r9sf20-ds_battery.sh}}",
      "type": "label"
    },
    {
      "format": "%d/%m %H:%M",
      "type": "clock"
    }
  ],
  "height": 30,
  "icon_theme": "Tokyonight-Dark",
  "position": "top",
  "start": [
    {
      "name_map": {
        "0": "0",
        "1": "1",
        "2": "2",
        "3": "3",
        "4": "4",
        "5": "5",
        "6": "6",
        "7": "7",
        "8": "8",
        "9": "9"
      },
      "type": "workspaces"
    }
  ]
}
Styles
.background {
    background-color: rgba(255,255,255,0.1);
    border-bottom: 0px solid #ffffff;
}

.container {
    font-family: "SFNS Nerd Font", Roboto, Helvetica, Arial, sans-serif;
    border: none;
    border-radius: 0px;
    font-weight: 400;
    margin-top: 3px;
    transition-property: background-color;
    transition-duration: .5s;
}

.workspaces {
    background: #ffffff;
    margin: 8px 0 8px 10px;
    padding: 0px;
    border-radius: 15px;
    border: 0px;
    font-weight: bold;
    font-style: normal;
    opacity: 0.9;
    font-size: 16px;
    color: #000000;
}

.workspaces .item {
    min-width: 0;
    padding: 0 10px;
    margin: 5px;
    border-radius: 15px;
    color: #000000;
    background-color: #cccccc;
    transition: all 0.3s ease-in-out;
    opacity: 0.4;
}

.workspaces .item.focused {
    padding: 0 20px;
    opacity: 1.0;
}

.workspaces .item:hover {
    opacity: 0.7;
}

.clock {
    background-color: #ffffff;
    font-size: 16px;
    color: #000000;
    border-radius: 15px;
    padding: 1px 10px 0px 10px;
    margin: 8px 10px 8px 0;
    opacity: 0.8;
}

.upower {
    background-color: #ffffff;
    font-size: 16px;
    color: #000000;
    border-radius: 15px;
    padding: 2px 10px;
    margin: 8px 15px 8px 0;
    opacity: 0.8;
}

.volume {
    background-color: #ffffff;
    font-size: 16px;
    color: #000000;
    border-radius: 15px;
    padding: 2px 10px;
    margin: 8px 15px 8px 0;
    opacity: 0.8;
}

.label {
    background-color: #ffffff;
    font-size: 16px;
    color: #000000;
    border-radius: 15px;
    padding: 2px 10px;
    margin: 8px 15px 8px 0;
    opacity: 0.8;
}

.tray {
    margin-right: 10px;
    padding: 0;
    color: #000000;
}

Originally created by @chmanie on GitHub (Dec 2, 2024). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/798 **Describe the bug** I'm on Hyprland and I'm having the issue that after a while the focused workspace is "stuck" at a certain number and won't change until I issue `ironbar reload`. Also, no new workspaces are recognized and added. Everything else (like hover) seems to still work fine. The log might be helpful (maybe?): ``` 2024-12-02T17:32:23.751961Z INFO ironbar: 134: Ironbar version 0.16.1 2024-12-02T17:32:23.751986Z INFO ironbar: 135: Starting application 2024-12-02T17:32:23.836061Z WARN GTK: 112: [Gtk] Theme parsing error: gtk-dark.css:6691:68: Invalid name of pseudo-class 2024-12-02T17:32:23.856208Z INFO ironbar::ipc::server: 39: Starting IPC on /run/user/1000/ironbar-ipc.sock 2024-12-02T17:32:23.857272Z INFO ironbar::bar: 117: Initializing bar 'bar-8' on 'DP-2' 2024-12-02T17:32:23.858753Z INFO ironbar::clients::compositor::hyprland: 32: Starting Hyprland event listener 2024-12-02T17:32:23.868836Z INFO ironbar::clients::volume: 168: connected to server 2024-12-02T17:32:23.988301Z WARN GTK: 112: [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled 2024-12-02T17:32:23.988337Z WARN GTK: 112: [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled 2024-12-02T17:32:23.988345Z WARN GTK: 112: [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled 2024-12-02T17:32:24.740601Z WARN GTK: 112: [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled 2024-12-02T17:32:24.872342Z WARN GTK: 112: [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled 2024-12-02T17:32:31.226025Z ERROR ironbar::logging: 49: The application panicked (crashed). Message: Failed to get workspaces: SerdeError(Error("invalid number", line: 59, column: 18)) Location: src/clients/compositor/hyprland.rs:243 Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets. 2024-12-02T17:32:31.226629Z ERROR GTK: 111: [Gdk] CRITICAL: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed [...] omitted. It's the same GTK error for ~200x within the 10s of screen power cycle 2024-12-02T17:32:43.130341Z INFO ironbar::bar: 117: Initializing bar 'bar-16' on 'DP-2' 2024-12-02T17:32:48.056530Z INFO ironbar: 192: Shutting down ``` **To Reproduce** Steps to reproduce the behavior: 1. Use Hyprland on an external screen 2. Have ironbar running 3. Switch off the screen, then switch it on again 4. Switch the current workspace to another one 5. The focused workspace is stuck at the one that it was before switching off the screen **Expected behavior** The focused workspace changes in sync with the Hyprland workspace **System information:** - Distro: NixOS 24.11 - Compositor: Hyprland 0.45.2 built from branch v0.45.2-b at commit 12f9a0d0b93f691d4d9923716557154d74777b0a - Ironbar version: 0.16.1 I also tested this with this PR: https://github.com/JakeStanger/ironbar/pull/748 to the same result. **Configuration** <details><summary>Config</summary> ```json { "anchor_to_edges": true, "center": [], "end": [ { "icon_size": 34, "type": "tray" }, { "type": "volume" }, { "label": "{{100000:/nix/store/8zlq6r23cwwkwzkk7dcrymjk52r9sf20-ds_battery.sh}}", "type": "label" }, { "format": "%d/%m %H:%M", "type": "clock" } ], "height": 30, "icon_theme": "Tokyonight-Dark", "position": "top", "start": [ { "name_map": { "0": "0", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7", "8": "8", "9": "9" }, "type": "workspaces" } ] } ``` </details> <details><summary>Styles</summary> ```css .background { background-color: rgba(255,255,255,0.1); border-bottom: 0px solid #ffffff; } .container { font-family: "SFNS Nerd Font", Roboto, Helvetica, Arial, sans-serif; border: none; border-radius: 0px; font-weight: 400; margin-top: 3px; transition-property: background-color; transition-duration: .5s; } .workspaces { background: #ffffff; margin: 8px 0 8px 10px; padding: 0px; border-radius: 15px; border: 0px; font-weight: bold; font-style: normal; opacity: 0.9; font-size: 16px; color: #000000; } .workspaces .item { min-width: 0; padding: 0 10px; margin: 5px; border-radius: 15px; color: #000000; background-color: #cccccc; transition: all 0.3s ease-in-out; opacity: 0.4; } .workspaces .item.focused { padding: 0 20px; opacity: 1.0; } .workspaces .item:hover { opacity: 0.7; } .clock { background-color: #ffffff; font-size: 16px; color: #000000; border-radius: 15px; padding: 1px 10px 0px 10px; margin: 8px 10px 8px 0; opacity: 0.8; } .upower { background-color: #ffffff; font-size: 16px; color: #000000; border-radius: 15px; padding: 2px 10px; margin: 8px 15px 8px 0; opacity: 0.8; } .volume { background-color: #ffffff; font-size: 16px; color: #000000; border-radius: 15px; padding: 2px 10px; margin: 8px 15px 8px 0; opacity: 0.8; } .label { background-color: #ffffff; font-size: 16px; color: #000000; border-radius: 15px; padding: 2px 10px; margin: 8px 15px 8px 0; opacity: 0.8; } .tray { margin-right: 10px; padding: 0; color: #000000; } ``` </details>
Author
Owner

@chmanie commented on GitHub (Dec 2, 2024):

OK, I did some more digging, that's probably worth a separate comment.

The hyprland client dies trying to parse this bit:

DATA: [...,{
    "id": 5,
    "name": "5",
    "monitor": "FALLBACK",
    "monitorID": -1,
    "windows": 0,
    "hasfullscreen": false,
    "lastwindow": "0x0",
    "lastwindowtitle": ""
},{
    "id": 7,
    "name": "7",
    "monitor": "?",
    "monitorID": null, // <--- Here, exactly
    "windows": 0,
    "hasfullscreen": false,
    "lastwindow": "0x0",
    "lastwindowtitle": ""
}]

As monitorID is only allowed to be a i128 (and not null). I can't really tell where to look for the culprit now. Is this something Hyprland should not be doing, or is this something that hyprland-rs should fix? In any case, this might not be something that can be solved within ironbar, so I'm closing this.

Just for completeness' sake, it's kind of connected to this: https://github.com/hyprwm/Hyprland/issues/7608

<!-- gh-comment-id:2512292433 --> @chmanie commented on GitHub (Dec 2, 2024): OK, I did some more digging, that's probably worth a separate comment. The hyprland client dies trying to parse this bit: ```jsonc DATA: [...,{ "id": 5, "name": "5", "monitor": "FALLBACK", "monitorID": -1, "windows": 0, "hasfullscreen": false, "lastwindow": "0x0", "lastwindowtitle": "" },{ "id": 7, "name": "7", "monitor": "?", "monitorID": null, // <--- Here, exactly "windows": 0, "hasfullscreen": false, "lastwindow": "0x0", "lastwindowtitle": "" }] ``` As monitorID is only allowed to be a `i128` (and not `null`). I can't really tell where to look for the culprit now. Is this something Hyprland should not be doing, or is this something that `hyprland-rs` should fix? In any case, this might not be something that can be solved within ironbar, so I'm closing this. Just for completeness' sake, it's kind of connected to this: https://github.com/hyprwm/Hyprland/issues/7608
Author
Owner

@JakeStanger commented on GitHub (Jan 2, 2025):

Is this something Hyprland should not be doing, or is this something that hyprland-rs should fix?

Hyprland has practically no spec for its IPC so hard to tell. You have to sorta work on the basis that what Hyprland says goes, so if it's sending null the IPC client should support that.

<!-- gh-comment-id:2568080605 --> @JakeStanger commented on GitHub (Jan 2, 2025): > Is this something Hyprland should not be doing, or is this something that hyprland-rs should fix? Hyprland has practically no spec for its IPC so hard to tell. You have to sorta work on the basis that what Hyprland says goes, so if it's sending null the IPC client should support that.
Author
Owner

@chmanie commented on GitHub (Jan 12, 2025):

I'm reopening this as there is now work being done in hyprland-rs and it would require an update of that dependency.

Furthermore I'd like to flag the other error messages that pop up when switching off a screen:

2025-01-12T14:13:28.583985Z ERROR GTK: 111: [Gdk] CRITICAL: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

The most concerning thing about this error message is that it is logged over 120 times within 1 second, I guess.

Also this but I think this is probably expected

2025-01-12T14:13:40.145202Z ERROR ironbar::clients::compositor::hyprland: 133: unable to locate workspace: 1
2025-01-12T14:13:40.145643Z  INFO ironbar::bar: 117: Initializing bar 'bar-12' on 'DP-2'
2025-01-12T14:13:40.153714Z ERROR ironbar::clients::compositor::hyprland: 88: Unable to locate workspace
<!-- gh-comment-id:2585755785 --> @chmanie commented on GitHub (Jan 12, 2025): I'm reopening this as there is now [work being done in hyprland-rs](https://github.com/hyprland-community/hyprland-rs/pull/302) and it would require an update of that dependency. Furthermore I'd like to flag the other error messages that pop up when switching off a screen: ``` 2025-01-12T14:13:28.583985Z ERROR GTK: 111: [Gdk] CRITICAL: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed ``` The most concerning thing about this error message is that it is logged over 120 times within 1 second, I guess. Also this but I think this is probably expected ``` 2025-01-12T14:13:40.145202Z ERROR ironbar::clients::compositor::hyprland: 133: unable to locate workspace: 1 2025-01-12T14:13:40.145643Z INFO ironbar::bar: 117: Initializing bar 'bar-12' on 'DP-2' 2025-01-12T14:13:40.153714Z ERROR ironbar::clients::compositor::hyprland: 88: Unable to locate workspace ```
Author
Owner

@JakeStanger commented on GitHub (May 19, 2025):

Adding the blocked tag as unfortunately hyprland-rs looks pretty dead currently, and hasn't had a commit in 4 months.

<!-- gh-comment-id:2891270493 --> @JakeStanger commented on GitHub (May 19, 2025): Adding the `blocked` tag as unfortunately `hyprland-rs` looks pretty dead currently, and hasn't had a commit in 4 months.
Author
Owner

@JakeStanger commented on GitHub (Sep 29, 2025):

I've updated the Hyprland IPC crate to new release, which includes a few fixes. Has that helped/resolved the issue?

<!-- gh-comment-id:3346019714 --> @JakeStanger commented on GitHub (Sep 29, 2025): I've updated the Hyprland IPC crate to new release, which includes a few fixes. Has that helped/resolved the issue?
Author
Owner

@chmanie commented on GitHub (Sep 29, 2025):

Thank you! I'll test with the latest version and get back to you!

<!-- gh-comment-id:3346191348 --> @chmanie commented on GitHub (Sep 29, 2025): Thank you! I'll test with the latest version and get back to you!
Author
Owner

@JakeStanger commented on GitHub (Dec 26, 2025):

@chmanie hey, did you get a chance to test this?

<!-- gh-comment-id:3692982963 --> @JakeStanger commented on GitHub (Dec 26, 2025): @chmanie hey, did you get a chance to test this?
Sign in to join this conversation.
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/ironbar#5872
No description provided.