Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspaces gets stuck after dpms cycle/monitor connect #798

Open
chmanie opened this issue Dec 2, 2024 · 3 comments
Open

Workspaces gets stuck after dpms cycle/monitor connect #798

chmanie opened this issue Dec 2, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@chmanie
Copy link
Contributor

chmanie commented Dec 2, 2024

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: �[31mThe application panicked (crashed).�[0m
Message:  �[36mFailed to get workspaces: SerdeError(Error("invalid number", line: 59, column: 18))�[0m
Location: �[35msrc/clients/compositor/hyprland.rs�[0m:�[35m243�[0m

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: #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;
}
@chmanie chmanie added the bug Something isn't working label Dec 2, 2024
@chmanie chmanie changed the title Focused workspace gets stuck after dpms cycle/monitor connect Workspaces gets stuck after dpms cycle/monitor connect Dec 2, 2024
@chmanie
Copy link
Contributor Author

chmanie commented 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: hyprwm/Hyprland#7608

@JakeStanger
Copy link
Owner

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.

@chmanie
Copy link
Contributor Author

chmanie commented 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

@chmanie chmanie reopened this Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants