[BUG]: Monitor Index Preferences Issue #431

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

Originally created by @fin3ss3g0d on GitHub (Jul 12, 2024).

Describe the bug
I noticed if I start Komorebi using komorebic.exe start, stop it using komorebic.exe stop, then try to start it again using komorebic.exe start and I have set specific monitor index preferences in my komorebi.json file that it will not start again. Only when I remove the monitor_index_preferences section from my komorebi.json file is it able to start again. If I want to use my custom monitor_index_preferences section in komorebi.json I have to sign out of my Windows desktop session and sign back in again (pretty inconvenient). When looking at Process Hacker after running komorebic.exe start the second time, the komorebic.exe process has a high CPU usage and appears to be stuck in a loop.

To Reproduce
Steps to reproduce the behavior:
Described above.

Expected behavior
You should be able to issue the komorebic.exe start/stop commands multiple times within the same desktop session while having monitor_index_preferences set in your komorebi.json file.

Screenshots and Videos
Displays layout:
image

Operating System

OS Name:                   Microsoft Windows 11 Pro
OS Version:                10.0.22631 N/A Build 22631

komorebic check Output

komorebic.exe check
No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\...

Looking for configuration files in C:\Users\...

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

Found C:\Users\...\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag

Additional context
Output of komorebic.exe monitor-information:

{
  "DELD105-5&d92dbb1&0&UID4352": {
    "left": -3840,
    "top": 0,
    "right": 3840,
    "bottom": 2160
  },
  "DELD107-5&d92dbb1&0&UID4355": {
    "left": -1947,
    "top": -2160,
    "right": 3840,
    "bottom": 2160
  },
  "DELD107-5&d92dbb1&0&UID4353": {
    "left": 0,
    "top": 0,
    "right": 3840,
    "bottom": 2160
  }
}

Contents of komorebi.json:

{
    "$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": 20,
    "default_container_padding": 20,
    "border": true,
    "border_width": 8,
    "border_offset": -1,
    "border_colours": {
        "single": "#42a5f5",
        "stack": "#00a542",
        "monocle": "#ff3399",
        "unfocused": "#808080"
    },
    "stackbar": {
        "height": 40,
        "mode": "OnStack",
        "tabs": {
            "width": 300,
            "focused_text": "#00a542",
            "unfocused_text": "#b3b3b3",
            "background": "#141414"
        }
    },
    "monitors": [
        {
            "workspaces": [
                {
                    "name": "I",
                    "layout": "BSP"
                },
                {
                    "name": "II",
                    "layout": "VerticalStack"
                },
                {
                    "name": "III",
                    "layout": "HorizontalStack"
                },
                {
                    "name": "IV",
                    "layout": "RightMainVerticalStack"
                },
                {
                    "name": "V",
                    "layout": "Grid"
                }
            ]
        },
        {
            "workspaces": [
                {
                    "name": "I",
                    "layout": "BSP"
                },
                {
                    "name": "II",
                    "layout": "VerticalStack"
                },
                {
                    "name": "III",
                    "layout": "HorizontalStack"
                },
                {
                    "name": "IV",
                    "layout": "RightMainVerticalStack"
                },
                {
                    "name": "V",
                    "layout": "Grid"
                }
            ]
        },
        {
            "workspaces": [
                {
                    "name": "I",
                    "layout": "BSP"
                },
                {
                    "name": "II",
                    "layout": "VerticalStack"
                },
                {
                    "name": "III",
                    "layout": "HorizontalStack"
                },
                {
                    "name": "IV",
                    "layout": "RightMainVerticalStack"
                },
                {
                    "name": "V",
                    "layout": "Grid"
                }
            ]
        }
    ],
    "monitor_index_preferences": {
        "2": {
            "left": -3840,
            "top": 0,
            "right": 3840,
            "bottom": 2160
        },
        "0": {
            "left": 0,
            "top": 0,
            "right": 3840,
            "bottom": 2160
        },
        "1": {
            "left": -1947,
            "top": -2160,
            "right": 3840,
            "bottom": 2160
        }
    }
}
Originally created by @fin3ss3g0d on GitHub (Jul 12, 2024). **Describe the bug** I noticed if I start `Komorebi` using `komorebic.exe start`, stop it using `komorebic.exe stop`, then try to start it again using `komorebic.exe start` and I have set specific monitor index preferences in my `komorebi.json` file that it will not start again. Only when I remove the `monitor_index_preferences` section from my `komorebi.json` file is it able to start again. If I want to use my custom `monitor_index_preferences` section in `komorebi.json` I have to sign out of my Windows desktop session and sign back in again (pretty inconvenient). When looking at `Process Hacker` after running `komorebic.exe start` the second time, the `komorebic.exe` process has a high CPU usage and appears to be stuck in a loop. **To Reproduce** Steps to reproduce the behavior: Described above. **Expected behavior** You should be able to issue the `komorebic.exe start/stop` commands multiple times within the same desktop session while having `monitor_index_preferences` set in your `komorebi.json` file. **Screenshots and Videos** Displays layout: ![image](https://github.com/user-attachments/assets/0e0c8239-b9c5-441c-9ae0-3295fbd9720f) **Operating System** ``` systeminfo.exe | grep "^OS Name\|^OS Version" OS Name: Microsoft Windows 11 Pro OS Version: 10.0.22631 N/A Build 22631 ``` **`komorebic check` Output** ``` komorebic.exe check No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\... Looking for configuration files in C:\Users\... Found komorebi.json; this file can be passed to the start command with the --config flag Found C:\Users\...\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag ``` **Additional context** Output of `komorebic.exe monitor-information`: ```json { "DELD105-5&d92dbb1&0&UID4352": { "left": -3840, "top": 0, "right": 3840, "bottom": 2160 }, "DELD107-5&d92dbb1&0&UID4355": { "left": -1947, "top": -2160, "right": 3840, "bottom": 2160 }, "DELD107-5&d92dbb1&0&UID4353": { "left": 0, "top": 0, "right": 3840, "bottom": 2160 } } ``` Contents of `komorebi.json`: ```json { "$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": 20, "default_container_padding": 20, "border": true, "border_width": 8, "border_offset": -1, "border_colours": { "single": "#42a5f5", "stack": "#00a542", "monocle": "#ff3399", "unfocused": "#808080" }, "stackbar": { "height": 40, "mode": "OnStack", "tabs": { "width": 300, "focused_text": "#00a542", "unfocused_text": "#b3b3b3", "background": "#141414" } }, "monitors": [ { "workspaces": [ { "name": "I", "layout": "BSP" }, { "name": "II", "layout": "VerticalStack" }, { "name": "III", "layout": "HorizontalStack" }, { "name": "IV", "layout": "RightMainVerticalStack" }, { "name": "V", "layout": "Grid" } ] }, { "workspaces": [ { "name": "I", "layout": "BSP" }, { "name": "II", "layout": "VerticalStack" }, { "name": "III", "layout": "HorizontalStack" }, { "name": "IV", "layout": "RightMainVerticalStack" }, { "name": "V", "layout": "Grid" } ] }, { "workspaces": [ { "name": "I", "layout": "BSP" }, { "name": "II", "layout": "VerticalStack" }, { "name": "III", "layout": "HorizontalStack" }, { "name": "IV", "layout": "RightMainVerticalStack" }, { "name": "V", "layout": "Grid" } ] } ], "monitor_index_preferences": { "2": { "left": -3840, "top": 0, "right": 3840, "bottom": 2160 }, "0": { "left": 0, "top": 0, "right": 3840, "bottom": 2160 }, "1": { "left": -1947, "top": -2160, "right": 3840, "bottom": 2160 } } } ```
adam added the bug label 2026-01-05 14:50:42 +01:00
adam closed this issue 2026-01-05 14:50:42 +01:00
Author
Owner

@LGUG2Z commented on GitHub (Jul 13, 2024):

that it will not start again.

Can you run komorebi.exe directly and share the log output?

@LGUG2Z commented on GitHub (Jul 13, 2024): > that it will not start again. Can you run `komorebi.exe` directly and share the log output?
Author
Owner

@LGUG2Z commented on GitHub (Jul 13, 2024):

Also display_index_preferences will probably suit you better here as all of your monitors have unique IDs:

  "display_index_preferences": {
    "0": "DELD107-5&d92dbb1&0&UID4353",
    "1": "DELD107-5&d92dbb1&0&UID4355",
    "2": "DELD105-5&d92dbb1&0&UID4352",
  }

Edit: updated this snippet to match the monitor IDs you posted

@LGUG2Z commented on GitHub (Jul 13, 2024): Also `display_index_preferences` will probably suit you better here as all of your monitors have unique IDs: ``` "display_index_preferences": { "0": "DELD107-5&d92dbb1&0&UID4353", "1": "DELD107-5&d92dbb1&0&UID4355", "2": "DELD105-5&d92dbb1&0&UID4352", } ``` Edit: updated this snippet to match the monitor IDs you posted
Author
Owner

@fin3ss3g0d commented on GitHub (Jul 13, 2024):

But if I start/stop Komorebi I get a different unique ID each time for each monitor. I just ran monitor information again in the same desktop session as yesterday and now I am getting the following:

{
  "DELD105-5&d92dbb1&0&UID4352": {
    "left": -3840,
    "top": 0,
    "right": 3840,
    "bottom": 2160
  },
  "DELD107-5&d92dbb1&0&UID4353": {
    "left": 0,
    "top": 0,
    "right": 3840,
    "bottom": 2160
  },
  "DELD107-5&d92dbb1&0&UID4355": {
    "left": -1947,
    "top": -2160,
    "right": 3840,
    "bottom": 2160
  }
}

Also, I just stopped and started Komorebi again today with the same configuration file settings and as you can see from above all of my monitor rectangle information is the same, but Komorebi is now saying that monitor 3 is monitor 2? It randomly flipped the order, and I cannot get it to go back to normal or respect my configuration.

@fin3ss3g0d commented on GitHub (Jul 13, 2024): But if I start/stop Komorebi I get a different unique ID each time for each monitor. I just ran monitor information again in the same desktop session as yesterday and now I am getting the following: ``` { "DELD105-5&d92dbb1&0&UID4352": { "left": -3840, "top": 0, "right": 3840, "bottom": 2160 }, "DELD107-5&d92dbb1&0&UID4353": { "left": 0, "top": 0, "right": 3840, "bottom": 2160 }, "DELD107-5&d92dbb1&0&UID4355": { "left": -1947, "top": -2160, "right": 3840, "bottom": 2160 } } ``` Also, I just stopped and started Komorebi again today with the same configuration file settings and as you can see from above all of my monitor rectangle information is the same, but Komorebi is now saying that monitor 3 is monitor 2? It randomly flipped the order, and I cannot get it to go back to normal or respect my configuration.
Author
Owner

@LGUG2Z commented on GitHub (Jul 13, 2024):

as you can see from above all of my monitor rectangle information is the same, but Komorebi is now saying that monitor 3 is monitor 2

The output of the monitor-info command is an unordered map - to see the actual ordering you need to inspect the order in the monitors array output by the state command.

Example using jq: komorebic state | jq '.monitors.elements[].device_id'

@LGUG2Z commented on GitHub (Jul 13, 2024): > as you can see from above all of my monitor rectangle information is the same, but Komorebi is now saying that monitor 3 is monitor 2 The output of the monitor-info command is an unordered map - to see the actual ordering you need to inspect the order in the `monitors` array output by the state command. Example using `jq`: `komorebic state | jq '.monitors.elements[].device_id'`
Author
Owner

@LGUG2Z commented on GitHub (Jul 13, 2024):

But if I start/stop Komorebi I get a different unique ID each time for each monitor

From your first post:

{
  "DELD105-5&d92dbb1&0&UID4352": {
    "left": -3840,
    "top": 0,
    "right": 3840,
    "bottom": 2160
  },
  "DELD107-5&d92dbb1&0&UID4355": {
    "left": -1947,
    "top": -2160,
    "right": 3840,
    "bottom": 2160
  },
  "DELD107-5&d92dbb1&0&UID4353": {
    "left": 0,
    "top": 0,
    "right": 3840,
    "bottom": 2160
  }
}

From your second post:

{
  "DELD105-5&d92dbb1&0&UID4352": {
    "left": -3840,
    "top": 0,
    "right": 3840,
    "bottom": 2160
  },
  "DELD107-5&d92dbb1&0&UID4353": {
    "left": 0,
    "top": 0,
    "right": 3840,
    "bottom": 2160
  },
  "DELD107-5&d92dbb1&0&UID4355": {
    "left": -1947,
    "top": -2160,
    "right": 3840,
    "bottom": 2160
  }
}

The monitor IDs themselves are the same ^

@LGUG2Z commented on GitHub (Jul 13, 2024): > But if I start/stop Komorebi I get a different unique ID each time for each monitor From your first post: ```json { "DELD105-5&d92dbb1&0&UID4352": { "left": -3840, "top": 0, "right": 3840, "bottom": 2160 }, "DELD107-5&d92dbb1&0&UID4355": { "left": -1947, "top": -2160, "right": 3840, "bottom": 2160 }, "DELD107-5&d92dbb1&0&UID4353": { "left": 0, "top": 0, "right": 3840, "bottom": 2160 } } ``` From your second post: ```json { "DELD105-5&d92dbb1&0&UID4352": { "left": -3840, "top": 0, "right": 3840, "bottom": 2160 }, "DELD107-5&d92dbb1&0&UID4353": { "left": 0, "top": 0, "right": 3840, "bottom": 2160 }, "DELD107-5&d92dbb1&0&UID4355": { "left": -1947, "top": -2160, "right": 3840, "bottom": 2160 } } ``` The monitor IDs themselves are the same ^
Author
Owner

@fin3ss3g0d commented on GitHub (Jul 13, 2024):

I understand the output of komorebic.exe monitor-information is unordered. I'm saying I used the same configuration mapped to each monitor rectangle and when I issued komorebic focus-monitor 2 after stopping and starting Komorebi, it went to the monitor labeled 2 here when before it was going to the monitor labeled 3 which is the desired behavior. Which is confusing to me because it is mathematically impossible as I mapped everything with the rectangle data.

image

I mapped my monitors in komorebi.json by unique ID with a display_index_preferences section previously, but the monitor order was changing similarly to what I am experiencing now above so I thought I was getting different unique IDs. I just signed out and signed back in again with the same exact monitor_index_preferences section and now everything is back to normal and monitor 3 is where it is supposed to be. There is definitely some issue going on and it happens only if you stop and start Komorebi at least once within the same desktop session. The first launch has consistently always respected my config and has been accurate.

@fin3ss3g0d commented on GitHub (Jul 13, 2024): I understand the output of `komorebic.exe monitor-information` is unordered. I'm saying I used the same configuration mapped to each monitor rectangle and when I issued `komorebic focus-monitor 2` after stopping and starting Komorebi, it went to the monitor labeled 2 here when before it was going to the monitor labeled 3 which is the desired behavior. Which is confusing to me because it is mathematically impossible as I mapped everything with the rectangle data. ![image](https://github.com/user-attachments/assets/6e4d6c23-8ef8-4648-b26c-ce81eaa54b0c) I mapped my monitors in `komorebi.json` by unique ID with a `display_index_preferences` section previously, but the monitor order was changing similarly to what I am experiencing now above so I thought I was getting different unique IDs. I just signed out and signed back in again with the same exact `monitor_index_preferences` section and now everything is back to normal and monitor 3 is where it is supposed to be. There is definitely some issue going on and it happens only if you stop and start Komorebi at least once within the same desktop session. The first launch has consistently always respected my config and has been accurate.
Author
Owner

@fin3ss3g0d commented on GitHub (Jul 13, 2024):

Updates:

  1. First of all, thank you for your very quick replies and for developing this project. This project is absolutely AMAZING ❤️
  2. I just found out what was causing the index mismatch. If I start Komorebi then turn off one of my monitors and turn it back on, it jacks up Komorebi and my index preferences no longer work. I had to sign out & sign back in again in order to fix the issue. One of my GPU ports periodically flashes my monitor black, and I have to turn it off and back on to fix the problem. You can test this for yourself, but I think if you turn off a monitor Komorebi is not able to recover the index preferences after this.
  3. Using display_index_preferences is now working and is much easier. The index issues I was receiving when using this in my config was probably due to me turning off that monitor. Thank you for this tip! Thank you for the state command trick as well!
  4. I have been trying to reproduce the CPU spin and unable to start bug, but I haven't been successful. I didn't know that if you ran komorebi.exe that it would log everything in the terminal. If I am unable to trigger the bug in the next couple of days, I will close this out. Then if I end up being able to trigger it later, I will just reopen this. Thanks again!
@fin3ss3g0d commented on GitHub (Jul 13, 2024): **Updates:** 1. First of all, thank you for your very quick replies and for developing this project. This project is absolutely AMAZING ❤️ 2. I just found out what was causing the index mismatch. If I start Komorebi then turn off one of my monitors and turn it back on, it jacks up Komorebi and my index preferences no longer work. I had to sign out & sign back in again in order to fix the issue. One of my GPU ports periodically flashes my monitor black, and I have to turn it off and back on to fix the problem. You can test this for yourself, but I think if you turn off a monitor Komorebi is not able to recover the index preferences after this. 3. Using `display_index_preferences` is now working and is much easier. The index issues I was receiving when using this in my config was probably due to me turning off that monitor. Thank you for this tip! Thank you for the `state` command trick as well! 4. I have been trying to reproduce the CPU spin and unable to start bug, but I haven't been successful. I didn't know that if you ran `komorebi.exe` that it would log everything in the terminal. If I am unable to trigger the bug in the next couple of days, I will close this out. Then if I end up being able to trigger it later, I will just reopen this. Thanks again!
Author
Owner

@fin3ss3g0d commented on GitHub (Jul 13, 2024):

If you are able to trigger the monitor power off/on bug and you want to track it here we can leave this open. That's if you consider it a bug for this project.

@fin3ss3g0d commented on GitHub (Jul 13, 2024): If you are able to trigger the monitor power off/on bug and you want to track it here we can leave this open. That's if you consider it a bug for this project.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#431