[BUG]: display_index_preferences prevents komorebi from starting #455

Closed
opened 2026-01-05 14:50:50 +01:00 by adam · 7 comments
Owner

Originally created by @ferenyl on GitHub (Aug 27, 2024).

Describe the bug
When display_index_preferences is present in config, start fails.

komorebi.exe stops without output

When i run komorebi from source:

2024-08-27T13:29:30.102350Z  INFO foreground_lock_timeout: komorebi::windows_api: current value of ForegroundLockTimeout is 0
2024-08-27T13:29:30.104526Z  INFO komorebi: creating window manager from static configuration file: C:\Users\USR\.config\komorebi\komorebi.json
2024-08-27T13:29:30.105446Z  INFO komorebi::border_manager: purging known borders: []
2024-08-27T13:29:30.114724Z  INFO init: komorebi::window_manager: initialising

To Reproduce
Steps to reproduce the behavior:

  1. add display_index_preferences with three monitors
  2. start komorebi with komorebic start -whkd

Expected behavior
komorebi should start

Operating System
OS Name: Microsoft Windows 11 Home
OS Version: 10.0.22631 N/A Build 22631

komorebic check Output

KOMOREBI_CONFIG_HOME detected: C:\Users\USR\.config\komorebi

Looking for configuration files in C:\Users\USR\.config\komorebi

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\USR\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
komorebic monitor-information
{
  "MSI3CA8-5&2fdae59&0&UID4352": {
    "left": 0,
    "top": 0,
    "right": 2560,
    "bottom": 1440
  },
  "MSI3CA8-5&2fdae59&0&UID4355": {
    "left": -2560,
    "top": 0,
    "right": 2560,
    "bottom": 1440
  },
  "MSI3CA8-5&2fdae59&0&UID4358": {
    "left": -5120,
    "top": 0,
    "right": 2560,
    "bottom": 1440
  }
}
{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.25/schema.json",
  "app_specific_configuration_path": "$Env:USERPROFILE/applications.yaml",
  "window_hiding_behaviour": "Cloak",
  "cross_monitor_move_behaviour": "Insert",
  "default_workspace_padding": 0,
  "default_container_padding": 5,
  "border": true,
  "border_width": 5,
  "border_offset": -1,
  "border_colours": {
    "single": "#42a5f5",
    "stack": "#00a542",
    "monocle": "#ff3399",
    "unfocused": "#808080"
  },
  "stackbar": {
    "height": 20,
    "mode": "OnStack",
    "tabs": {
      "width": 200,
      "focused_text": "#00a542",
      "unfocused_text": "#b3b3b3",
      "background": "#141414"
    }
  },
  "display_index_preferences": {
    "0": "MSI3CA8-5&2fdae59&0&UID4352",
    "1": "MSI3CA8-5&2fdae59&0&UID4355",
    "2": "MSI3CA8-5&2fdae59&0&UID4358"
  },
  "monitors": [
    {
      "workspaces": [
        {
          "name": "Grid",
          "layout": "Grid"
        },
        {
          "name": "BSP",
          "layout": "BSP"
        }
      ]
    },
    {
      "workspaces": [
        {
          "name": "Prime",
          "custom_layout": "C:/Users/USR/.config/komorebi/custom.json"
        },
        {
          "name": "BSP",
          "layout": "BSP"
        }
      ]
    },
    {
      "workspaces": [
        {
          "name": "Prime",
          "custom_layout": "C:/Users/USR/.config/komorebi/custom.json"
        },
        {
          "name": "BSP",
          "layout": "BSP"
        }
      ]
    }
    
  ]
}
Originally created by @ferenyl on GitHub (Aug 27, 2024). **Describe the bug** When display_index_preferences is present in config, start fails. komorebi.exe stops without output When i run komorebi from source: ``` 2024-08-27T13:29:30.102350Z INFO foreground_lock_timeout: komorebi::windows_api: current value of ForegroundLockTimeout is 0 2024-08-27T13:29:30.104526Z INFO komorebi: creating window manager from static configuration file: C:\Users\USR\.config\komorebi\komorebi.json 2024-08-27T13:29:30.105446Z INFO komorebi::border_manager: purging known borders: [] 2024-08-27T13:29:30.114724Z INFO init: komorebi::window_manager: initialising ``` **To Reproduce** Steps to reproduce the behavior: 1. add display_index_preferences with three monitors 2. start komorebi with komorebic start -whkd **Expected behavior** komorebi should start **Operating System** OS Name: Microsoft Windows 11 Home OS Version: 10.0.22631 N/A Build 22631 **`komorebic check` Output** ``` KOMOREBI_CONFIG_HOME detected: C:\Users\USR\.config\komorebi Looking for configuration files in C:\Users\USR\.config\komorebi Found komorebi.json; this file can be passed to the start command with the --config flag Found C:\Users\USR\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag ``` ``` komorebic monitor-information { "MSI3CA8-5&2fdae59&0&UID4352": { "left": 0, "top": 0, "right": 2560, "bottom": 1440 }, "MSI3CA8-5&2fdae59&0&UID4355": { "left": -2560, "top": 0, "right": 2560, "bottom": 1440 }, "MSI3CA8-5&2fdae59&0&UID4358": { "left": -5120, "top": 0, "right": 2560, "bottom": 1440 } } ``` ``` { "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.25/schema.json", "app_specific_configuration_path": "$Env:USERPROFILE/applications.yaml", "window_hiding_behaviour": "Cloak", "cross_monitor_move_behaviour": "Insert", "default_workspace_padding": 0, "default_container_padding": 5, "border": true, "border_width": 5, "border_offset": -1, "border_colours": { "single": "#42a5f5", "stack": "#00a542", "monocle": "#ff3399", "unfocused": "#808080" }, "stackbar": { "height": 20, "mode": "OnStack", "tabs": { "width": 200, "focused_text": "#00a542", "unfocused_text": "#b3b3b3", "background": "#141414" } }, "display_index_preferences": { "0": "MSI3CA8-5&2fdae59&0&UID4352", "1": "MSI3CA8-5&2fdae59&0&UID4355", "2": "MSI3CA8-5&2fdae59&0&UID4358" }, "monitors": [ { "workspaces": [ { "name": "Grid", "layout": "Grid" }, { "name": "BSP", "layout": "BSP" } ] }, { "workspaces": [ { "name": "Prime", "custom_layout": "C:/Users/USR/.config/komorebi/custom.json" }, { "name": "BSP", "layout": "BSP" } ] }, { "workspaces": [ { "name": "Prime", "custom_layout": "C:/Users/USR/.config/komorebi/custom.json" }, { "name": "BSP", "layout": "BSP" } ] } ] } ```
adam added the bug label 2026-01-05 14:50:50 +01:00
adam closed this issue 2026-01-05 14:50:50 +01:00
Author
Owner

@ferenyl commented on GitHub (Aug 27, 2024):

After some debugging i found that i got stuck on this: b799fd3077/komorebi/src/windows_api.rs (L290)

@ferenyl commented on GitHub (Aug 27, 2024): After some debugging i found that i got stuck on this: https://github.com/LGUG2Z/komorebi/blob/b799fd30774b5ae9289481a33f735af8c6047650/komorebi/src/windows_api.rs#L290
Author
Owner

@LGUG2Z commented on GitHub (Aug 27, 2024):

Are you able to add some debug lines in that block to see what the values of preference and len are in there? There must be a subtle logic bug here but I can't figure it out from looking at it

@LGUG2Z commented on GitHub (Aug 27, 2024): Are you able to add some debug lines in that block to see what the values of preference and len are in there? There must be a subtle logic bug here but I can't figure it out from looking at it
Author
Owner

@LGUG2Z commented on GitHub (Aug 27, 2024):

3101e089b3

This might fix it; I have a feeling that reserve doesn't actually grow the Vec len 🤔

@LGUG2Z commented on GitHub (Aug 27, 2024): https://github.com/LGUG2Z/komorebi/commit/3101e089b3feef04c30df735b76a530ed40ae967 This might fix it; I have a feeling that `reserve` doesn't actually grow the Vec len 🤔
Author
Owner

@ferenyl commented on GitHub (Aug 27, 2024):

Can confirm that reserve doesn't grow the Vec len. Going to test the commit now.

@ferenyl commented on GitHub (Aug 27, 2024): Can confirm that reserve doesn't grow the Vec len. Going to test the commit now.
Author
Owner

@ferenyl commented on GitHub (Aug 27, 2024):

That code works! going to build from source and run from that.

@ferenyl commented on GitHub (Aug 27, 2024): That code works! going to build from source and run from that.
Author
Owner

@LGUG2Z commented on GitHub (Aug 27, 2024):

Excellent, I'll merge the fix to master when I get back from the office tonight 🎉

@LGUG2Z commented on GitHub (Aug 27, 2024): Excellent, I'll merge the fix to master when I get back from the office tonight 🎉
Author
Owner

@LGUG2Z commented on GitHub (Aug 28, 2024):

This is now on master and will be part of the next nightly release on Saturday 🚀

@LGUG2Z commented on GitHub (Aug 28, 2024): This is now on master and will be part of the next nightly release on Saturday 🚀
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#455