OS Name: Microsoft Windows 11 Pro
OS Version: 10.0.22631 N/A Build 22631
komorebic check Output
No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\{UserName}
Looking for configuration files in C:\Users\{UserName}
Found komorebi.json; this file can be passed to the start command with the --config flag
Found C:\Users\{UserName}\.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
I would be forever grateful if my issue can be verified by others, perhaps for PC as well. There can be connection race issues when a laptop is used with 2 monitors. I can also make a few more tests at requests to narrow down the bug.
Originally created by @CtByte on GitHub (May 7, 2024).
**Describe the bug**
After the computer is woken from sleep, the `komorebic state` changes (using a laptop with 2 monitors).
---
**To Reproduce**
At the time of writing, I am running [version](https://github.com/LGUG2Z/komorebi/commit/871a53821c3bc7866f479132d060fe8a8e902c21) `871a538` of Komorebi
Steps to reproduce the behavior:
1. Run 'komorebic state'
2. Let the computer go to sleep
3. Wake the computer from sleep
4. Run 'komorebic state'
5. See bug
---
**Expected behavior**
When running 'komorebic state' after waking the computer from sleep, it gives the same result even with multiple monitors.
---
**Proposed short term solution**
I proposed the enhancement #803, that could lessen the issue
---
**Screenshots, Videos and Logs**
I am using Zebar to visualize the issue. The buttons represent the workspaces on the 2 monitors (MONITOR5 and MONITOR6).
The state goes from having 2 monitors (MONITOR6, MONITOR5) to listing 3 monitors (MONITOR5, MONITOR6, MONITOR5), ending up in a broken state.
***Initial state (before sleep)***
<img width="144" alt="DISPLAY5 before" src="https://github.com/LGUG2Z/komorebi/assets/165908630/e698b954-cbff-4c01-b20b-5a7464643869">
<img width="156" alt="DISPLAY6 before" src="https://github.com/LGUG2Z/komorebi/assets/165908630/2c6df733-cfc6-4429-a3b1-f29ffc0eea15">
Output of 'komorebic state'
```
{
"monitors": {
"elements": [
{
"id": 17763244,
"name": "DISPLAY6",
"device": null,
"device_id": null,
"size": {
"left": 3840,
"top": 0,
"right": 3840,
"bottom": 2160
},
"work_area_size": {
"left": 3840,
"top": 0,
"right": 3840,
"bottom": 2088
},
"work_area_offset": null,
"workspaces": {
"elements": [
{
"name": "W1",
"containers": {
"elements": [
{
"id": "_OKrk2--SMg8xXXbyfprp"
},
{
"id": "YebDXVJN3GvrW-Ow0TwHr"
},
{
"id": "X2QdD5gkXFn4DZ_tHuf32"
},
{
"id": "b4lt4hb3wrw7HW9cakKQl"
}
],
"focused": 0
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "UltrawideVerticalStack"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [
{
"left": 4807,
"top": 55,
"right": 1905,
"bottom": 2023
},
{
"left": 3850,
"top": 55,
"right": 947,
"bottom": 2023
},
{
"left": 6722,
"top": 55,
"right": 947,
"bottom": 1006
},
{
"left": 6722,
"top": 1071,
"right": 947,
"bottom": 1006
}
],
"resize_dimensions": [
null,
null,
null,
null
],
"tile": true
},
{
"name": "W2",
"containers": {
"elements": [],
"focused": 0
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "BSP"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [],
"resize_dimensions": [],
"tile": true
},
{
"name": "W3",
"containers": {
"elements": [],
"focused": 0
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "BSP"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [],
"resize_dimensions": [],
"tile": true
}
],
"focused": 0
},
"workspace_names": {}
},
{
"id": 46206136,
"name": "DISPLAY5",
"device": null,
"device_id": null,
"size": {
"left": 0,
"top": 0,
"right": 3840,
"bottom": 2160
},
"work_area_size": {
"left": 0,
"top": 0,
"right": 3840,
"bottom": 2088
},
"work_area_offset": null,
"workspaces": {
"elements": [
{
"name": "P1",
"containers": {
"elements": [
{
"id": "xCZamNqUXdxb0TEP3IiOd"
},
{
"id": "kGMvbS7sGwRF8MbjQqY_R"
},
{
"id": "54Jv4HdRGmBKH4UG5h0zo"
}
],
"focused": 0
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "UltrawideVerticalStack"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [
{
"left": 967,
"top": 55,
"right": 1905,
"bottom": 2023
},
{
"left": 10,
"top": 55,
"right": 947,
"bottom": 2023
},
{
"left": 2882,
"top": 55,
"right": 947,
"bottom": 2023
}
],
"resize_dimensions": [
null,
null,
null
],
"tile": true
},
{
"name": "P2",
"containers": {
"elements": [],
"focused": 0
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "UltrawideVerticalStack"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [],
"resize_dimensions": [],
"tile": true
},
{
"name": "P3",
"containers": {
"elements": [],
"focused": 0
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "BSP"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [],
"resize_dimensions": [],
"tile": true
}
],
"focused": 0
},
"workspace_names": {}
}
],
"focused": 1
},
"is_paused": false,
"resize_delta": 50,
"new_window_behaviour": "Create",
"cross_monitor_move_behaviour": "Insert",
"unmanaged_window_operation_behaviour": "Op",
"work_area_offset": {
"left": 0,
"top": 45,
"right": 0,
"bottom": 45
},
"focus_follows_mouse": null,
"mouse_follows_focus": true,
"has_pending_raise_op": false
}
```
***Broken state (after sleep)***
<img width="179" alt="DISPLAY5 after" src="https://github.com/LGUG2Z/komorebi/assets/165908630/02682051-2a72-48b9-b01d-17e85bcd8a09">
<img width="104" alt="DISPLAY6 after" src="https://github.com/LGUG2Z/komorebi/assets/165908630/7cfbf281-93fc-45e3-ada9-8508910d24f9">
Output of 'komorebic state'
```
{
"monitors": {
"elements": [
{
"id": 46206136,
"name": "DISPLAY5",
"device": null,
"device_id": null,
"size": {
"left": 0,
"top": 0,
"right": 3840,
"bottom": 2160
},
"work_area_size": {
"left": 0,
"top": 0,
"right": 3840,
"bottom": 2088
},
"work_area_offset": null,
"workspaces": {
"elements": [
{
"name": "P1",
"containers": {
"elements": [
{
"id": "8aNL2jZDsyPjRt9cJhpMT"
},
{
"id": "-zaVR8I6ywTTTsffCQKcs"
}
],
"focused": 1
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "UltrawideVerticalStack"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [
{
"left": 1925,
"top": 55,
"right": 1905,
"bottom": 2023
},
{
"left": 10,
"top": 55,
"right": 1905,
"bottom": 2023
}
],
"resize_dimensions": [
null,
null
],
"tile": true
},
{
"name": "P2",
"containers": {
"elements": [],
"focused": 0
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "UltrawideVerticalStack"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [],
"resize_dimensions": [],
"tile": true
},
{
"name": "P3",
"containers": {
"elements": [],
"focused": 0
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "BSP"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [],
"resize_dimensions": [],
"tile": true
}
],
"focused": 0
},
"workspace_names": {}
},
{
"id": 17763244,
"name": "DISPLAY6",
"device": null,
"device_id": null,
"size": {
"left": 3840,
"top": 0,
"right": 3840,
"bottom": 2160
},
"work_area_size": {
"left": 3840,
"top": 0,
"right": 3840,
"bottom": 2088
},
"work_area_offset": null,
"workspaces": {
"elements": [
{
"name": null,
"containers": {
"elements": [
{
"id": "rDtx1fwn6mCEa3dEfZH06"
}
],
"focused": 0
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "BSP"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [
{
"left": 3850,
"top": 55,
"right": 3820,
"bottom": 2023
}
],
"resize_dimensions": [
null
],
"tile": true
}
],
"focused": 0
},
"workspace_names": {}
},
{
"id": 46206136,
"name": "DISPLAY5",
"device": null,
"device_id": null,
"size": {
"left": 0,
"top": 0,
"right": 3840,
"bottom": 2160
},
"work_area_size": {
"left": 0,
"top": 0,
"right": 3840,
"bottom": 2088
},
"work_area_offset": null,
"workspaces": {
"elements": [
{
"name": null,
"containers": {
"elements": [],
"focused": 0
},
"monocle_container": null,
"maximized_window": null,
"floating_windows": [],
"layout": {
"Default": "BSP"
},
"layout_rules": [],
"layout_flip": null,
"workspace_padding": 5,
"container_padding": 5,
"latest_layout": [],
"resize_dimensions": [],
"tile": true
}
],
"focused": 0
},
"workspace_names": {}
}
],
"focused": 0
},
"is_paused": false,
"resize_delta": 50,
"new_window_behaviour": "Create",
"cross_monitor_move_behaviour": "Insert",
"unmanaged_window_operation_behaviour": "Op",
"work_area_offset": {
"left": 0,
"top": 45,
"right": 0,
"bottom": 45
},
"focus_follows_mouse": null,
"mouse_follows_focus": true,
"has_pending_raise_op": false
}
```
---
**Operating System**
```
OS Name: Microsoft Windows 11 Pro
OS Version: 10.0.22631 N/A Build 22631
```
---
**`komorebic check` Output**
```
No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\{UserName}
Looking for configuration files in C:\Users\{UserName}
Found komorebi.json; this file can be passed to the start command with the --config flag
Found C:\Users\{UserName}\.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**
I would be forever grateful if my issue can be verified by others, perhaps for PC as well. There can be connection race issues when a laptop is used with 2 monitors. I can also make a few more tests at requests to narrow down the bug.
adam
added the bug label 2026-01-05 14:50:01 +01:00
I think it is also noteworthy, that after the state is broken (waking from the first sleep), the state stays the same even after another sleep.
@CtByte commented on GitHub (May 7, 2024):
I think it is also noteworthy, that after the state is broken (waking from the first sleep), the state stays the same even after another sleep.
I think this should fix a fair few monitor issues, but the code is a mess
@LGUG2Z commented on GitHub (May 14, 2024):
https://github.com/LGUG2Z/komorebi/commit/f6c59c5dfcf901815bebfee1c4836038e96c96cd
I think this should fix a fair few monitor issues, but the code is a mess
What I would expect is to have the offset on the "single window" and the "Stacked window" as well. Can this be related to this change?
As for the bug with the state, I need to do more testing. I could see you've been very busy with Komorebi lately, thank you very much for your hard work!
@CtByte commented on GitHub (May 14, 2024):
@LGUG2Z I am running the "wip" commit you link above.
I have a global offset in my config that does not seem to be respected the same way anymore. I use the `UltrawideVerticalStack` layout.
```
"stackbar": {
"height": 40,
"mode": "OnStack",
"tabs": {
"width": 300,
"focused_text": "#bfaa69",
"unfocused_text": "#f2bdf3",
"background": "#121826"
}
},
"global_work_area_offset":
{
"bottom": 45,
"left": 0,
"right": 0,
"top": 45
},
```
Single window
<img width="351" alt="Screenshot 2024-05-14 092249" src="https://github.com/LGUG2Z/komorebi/assets/165908630/be2d27f8-9e68-4517-9dee-1427c5e1500f">
2 windows
<img width="1058" alt="Screenshot 2024-05-14 092349" src="https://github.com/LGUG2Z/komorebi/assets/165908630/2aba89f3-ef7d-4776-ae57-8e04ca17f3f5">
Stacked windows
<img width="358" alt="Screenshot 2024-05-14 092423" src="https://github.com/LGUG2Z/komorebi/assets/165908630/822e67fb-6afd-4bfb-936e-e9a52571d17f">
What I would expect is to have the offset on the "single window" and the "Stacked window" as well. Can this be related to [this change](https://github.com/LGUG2Z/komorebi/commit/17acb1ac33c7723f676d85c36017c9813e887a15)?
---
As for the bug with the state, I need to do more testing. I could see you've been very busy with Komorebi lately, thank you very much for your hard work!
I have a global offset in my config that does not seem to be respected the same way anymore. I use the UltrawideVerticalStack layout.
Can you share the values recorded in komorebic state for work_area_offset (at the top level), work_area_offset (at the monitor level) and single_window_work_area_offset (at the monitor level) for each of these 3 situations in the screenshots?
@LGUG2Z commented on GitHub (May 14, 2024):
> I have a global offset in my config that does not seem to be respected the same way anymore. I use the UltrawideVerticalStack layout.
Can you share the values recorded in `komorebic state` for `work_area_offset` (at the top level), `work_area_offset` (at the monitor level) and `single_window_work_area_offset` (at the monitor level) for each of these 3 situations in the screenshots?
wip is also updated with much nicer code now :) https://github.com/LGUG2Z/komorebi/commit/952bc13c296e1c59937579940abf9ddf6ed14668
Also, when I set the monitor level work_area_offset in the config then it is present in the state on the monitor level, but it is only respected when there are multiple windows on the workspace (same as the top level setting).
The single_window_work_area_offset is always null.
@CtByte commented on GitHub (May 14, 2024):
Also, when I set the monitor level `work_area_offset` in the config then it is present in the state on the monitor level, but it is only respected when there are multiple windows on the workspace (same as the top level setting).
The `single_window_work_area_offset` is always `null`.
This commit is getting closer to the desired state for monitor connection and reconnection
Bounded channel that acts on events (+ backpressure for all the events that get spammed on connect/disconnect)
Resolution Change and Display Connection Change events are handled separately
Monitor configurations are cached on
Loading/reloading the static config file if display_index_preferences is set
On monitor disconnection
Improved (I think?) deduping to not end up with more monitors in the state than are actually connected
@LGUG2Z commented on GitHub (May 15, 2024):
https://github.com/LGUG2Z/komorebi/commit/d364b00b1520ad5327bdb3002a61829fd6c84ed2
This commit is getting closer to the desired state for monitor connection and reconnection
* Bounded channel that acts on events (+ backpressure for all the events that get spammed on connect/disconnect)
* Resolution Change and Display Connection Change events are handled separately
* Monitor configurations are cached on
* Loading/reloading the static config file if `display_index_preferences` is set
* On monitor disconnection
* Improved (I think?) deduping to not end up with more monitors in the state than are actually connected
Really like the fitting branch name. I can confirm that as of the d364b00 commit, the offset issue has been fixed.
I will put Komorebi through a few sleeps to check the state.
The last couple of days has been busy for you, like a big spring cleaning. Take good care of yourself, my friend (if I may) :)
@CtByte commented on GitHub (May 15, 2024):
Really like the fitting branch name. I can confirm that as of the d364b00 commit, the offset issue has been fixed.
I will put Komorebi through a few sleeps to check the state.
The last couple of days has been busy for you, like a big spring cleaning. Take good care of yourself, my friend (if I may) :)
I found a few things while running the d364b00 commit, would you prefer I open new issues linking to the monitor-madness branch? I think it would make sense to keep this issue "clean".
@CtByte commented on GitHub (May 15, 2024):
I found a few things while running the d364b00 commit, would you prefer I open new issues linking to the monitor-madness branch? I think it would make sense to keep this issue "clean".
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @CtByte on GitHub (May 7, 2024).
Describe the bug
After the computer is woken from sleep, the
komorebic statechanges (using a laptop with 2 monitors).To Reproduce
At the time of writing, I am running version
871a538of KomorebiSteps to reproduce the behavior:
Expected behavior
When running 'komorebic state' after waking the computer from sleep, it gives the same result even with multiple monitors.
Proposed short term solution
I proposed the enhancement #803, that could lessen the issue
Screenshots, Videos and Logs
I am using Zebar to visualize the issue. The buttons represent the workspaces on the 2 monitors (MONITOR5 and MONITOR6).
The state goes from having 2 monitors (MONITOR6, MONITOR5) to listing 3 monitors (MONITOR5, MONITOR6, MONITOR5), ending up in a broken state.
Initial state (before sleep)
Output of 'komorebic state'
Broken state (after sleep)
Output of 'komorebic state'
Operating System
komorebic checkOutputAdditional context
I would be forever grateful if my issue can be verified by others, perhaps for PC as well. There can be connection race issues when a laptop is used with 2 monitors. I can also make a few more tests at requests to narrow down the bug.
@CtByte commented on GitHub (May 7, 2024):
I think it is also noteworthy, that after the state is broken (waking from the first sleep), the state stays the same even after another sleep.
@LGUG2Z commented on GitHub (May 14, 2024):
https://github.com/LGUG2Z/komorebi/commit/f6c59c5dfcf901815bebfee1c4836038e96c96cd
I think this should fix a fair few monitor issues, but the code is a mess
@CtByte commented on GitHub (May 14, 2024):
@LGUG2Z I appreciate the honesty :) I will put the code to the test
@CtByte commented on GitHub (May 14, 2024):
@LGUG2Z I am running the "wip" commit you link above.
I have a global offset in my config that does not seem to be respected the same way anymore. I use the
UltrawideVerticalStacklayout.Single window

2 windows

Stacked windows

What I would expect is to have the offset on the "single window" and the "Stacked window" as well. Can this be related to this change?
As for the bug with the state, I need to do more testing. I could see you've been very busy with Komorebi lately, thank you very much for your hard work!
@CtByte commented on GitHub (May 14, 2024):
The same is true when I use the monitor offset. The setting is only respected if there are multiple unstacked windows on the workspace.
@LGUG2Z commented on GitHub (May 14, 2024):
Can you share the values recorded in
komorebic stateforwork_area_offset(at the top level),work_area_offset(at the monitor level) andsingle_window_work_area_offset(at the monitor level) for each of these 3 situations in the screenshots?wip is also updated with much nicer code now :) https://github.com/LGUG2Z/komorebi/commit/952bc13c296e1c59937579940abf9ddf6ed14668
@CtByte commented on GitHub (May 14, 2024):
I built the 952bc13 commit and executed the
komorebic statein the 3 window configurations. I decided to include a bit more code just to be sure.The summary is basically that the top level setting is present and both monitor level settings are
nullin all 3.komorebic.json
single window
2 windows
Stacked monitors
As for the broken state, the new commit seems to be working better, but I need a bit more time to test it properly.
@CtByte commented on GitHub (May 14, 2024):
Also, when I set the monitor level
work_area_offsetin the config then it is present in the state on the monitor level, but it is only respected when there are multiple windows on the workspace (same as the top level setting).The
single_window_work_area_offsetis alwaysnull.@LGUG2Z commented on GitHub (May 14, 2024):
Okay I have just reproduced this 🤞 Time to dig...
@LGUG2Z commented on GitHub (May 15, 2024):
Fixed the offsets bug on master (and rebased to the monitor-madness branch)
@LGUG2Z commented on GitHub (May 15, 2024):
https://github.com/LGUG2Z/komorebi/commit/d364b00b1520ad5327bdb3002a61829fd6c84ed2
This commit is getting closer to the desired state for monitor connection and reconnection
display_index_preferencesis set@CtByte commented on GitHub (May 15, 2024):
Really like the fitting branch name. I can confirm that as of the d364b00 commit, the offset issue has been fixed.
I will put Komorebi through a few sleeps to check the state.
The last couple of days has been busy for you, like a big spring cleaning. Take good care of yourself, my friend (if I may) :)
@CtByte commented on GitHub (May 15, 2024):
I found a few things while running the d364b00 commit, would you prefer I open new issues linking to the monitor-madness branch? I think it would make sense to keep this issue "clean".
@LGUG2Z commented on GitHub (May 15, 2024):
Yeah please add them in a separate issue if they are unrelated to monitors jumping around in the state 🙏
@CtByte commented on GitHub (May 15, 2024):
The state is the same after sleep.
Thank you very much for fixing it. 🎉