[BUG]: Custom layout is ignored when there are only two windows #226

Closed
opened 2026-01-05 14:49:08 +01:00 by adam · 5 comments
Owner

Originally created by @averrin on GitHub (Jun 29, 2023).

Describe the bug
I have a custom layout (just 70% width instead of 50%) and it works until there are only two windows on a workspace. It fallbacks to 50%

To Reproduce

  1. set custom layout
  2. minimize all windows but two

Expected behavior
Width of the left is 70%

Operating System
Windows 11
komorebi is built from master branch.

komorebic state Output

{
  "monitors": {
    "elements": [
      {
        "id": 65537,
        "name": "DISPLAY1",
        "size": {
          "left": 0,
          "top": 0,
          "right": 3840,
          "bottom": 2160
        },
        "work_area_size": {
          "left": 0,
          "top": 0,
          "right": 3840,
          "bottom": 2100
        },
        "work_area_offset": null,
        "workspaces": {
          "elements": [
            {
              "name": "I",
              "containers": {
                "elements": [
                  {
                    "windows": {
                      "elements": [
                        {
                          "hwnd": 920248,
                          "title": "komorebi – README.md",
                          "exe": "idea64.exe",
                          "class": "SunAwtFrame",
                          "rect": {
                            "left": -7,
                            "top": 0,
                            "right": 1934,
                            "bottom": 2107
                          }
                        }
                      ],
                      "focused": 0
                    }
                  },
                  {
                    "windows": {
                      "elements": [
                        {
                          "hwnd": 2034344,
                          "title": "Windows PowerShell",
                          "exe": "WindowsTerminal.exe",
                          "class": "CASCADIA_HOSTING_WINDOW_CLASS",
                          "rect": {
                            "left": 1913,
                            "top": 0,
                            "right": 1934,
                            "bottom": 2107
                          }
                        }
                      ],
                      "focused": 0
                    }
                  }
                ],
                "focused": 1
              },
              "monocle_container": null,
              "maximized_window": null,
              "floating_windows": [],
              "layout": {
                "Custom": [
                  {
                    "column": "Primary",
                    "configuration": {
                      "WidthPercentage": 70.0
                    }
                  },
                  {
                    "column": "Tertiary",
                    "configuration": "Horizontal"
                  }
                ]
              },
              "layout_rules": [],
              "layout_flip": null,
              "workspace_padding": 0,
              "container_padding": 0,
              "resize_dimensions": [
                null,
                null
              ],
              "tile": true
            },
...
          ],
          "focused": 0
        }
      }
    ],
    "focused": 0
  },
  "is_paused": false,
  "invisible_borders": {
    "left": 7,
    "top": 0,
    "right": 14,
    "bottom": 7
  },
  "resize_delta": 50,
  "new_window_behaviour": "Create",
  "cross_monitor_move_behaviour": "Insert",
  "work_area_offset": null,
  "focus_follows_mouse": null,
  "mouse_follows_focus": true,
  "has_pending_raise_op": false,
  "remove_titlebars": false,
...
Originally created by @averrin on GitHub (Jun 29, 2023). **Describe the bug** I have a custom layout (just 70% width instead of 50%) and it works until there are only two windows on a workspace. It fallbacks to 50% **To Reproduce** 1. set custom layout 2. minimize all windows but two **Expected behavior** Width of the left is 70% **Operating System** Windows 11 komorebi is built from master branch. **`komorebic state` Output** ``` { "monitors": { "elements": [ { "id": 65537, "name": "DISPLAY1", "size": { "left": 0, "top": 0, "right": 3840, "bottom": 2160 }, "work_area_size": { "left": 0, "top": 0, "right": 3840, "bottom": 2100 }, "work_area_offset": null, "workspaces": { "elements": [ { "name": "I", "containers": { "elements": [ { "windows": { "elements": [ { "hwnd": 920248, "title": "komorebi – README.md", "exe": "idea64.exe", "class": "SunAwtFrame", "rect": { "left": -7, "top": 0, "right": 1934, "bottom": 2107 } } ], "focused": 0 } }, { "windows": { "elements": [ { "hwnd": 2034344, "title": "Windows PowerShell", "exe": "WindowsTerminal.exe", "class": "CASCADIA_HOSTING_WINDOW_CLASS", "rect": { "left": 1913, "top": 0, "right": 1934, "bottom": 2107 } } ], "focused": 0 } } ], "focused": 1 }, "monocle_container": null, "maximized_window": null, "floating_windows": [], "layout": { "Custom": [ { "column": "Primary", "configuration": { "WidthPercentage": 70.0 } }, { "column": "Tertiary", "configuration": "Horizontal" } ] }, "layout_rules": [], "layout_flip": null, "workspace_padding": 0, "container_padding": 0, "resize_dimensions": [ null, null ], "tile": true }, ... ], "focused": 0 } } ], "focused": 0 }, "is_paused": false, "invisible_borders": { "left": 7, "top": 0, "right": 14, "bottom": 7 }, "resize_delta": 50, "new_window_behaviour": "Create", "cross_monitor_move_behaviour": "Insert", "work_area_offset": null, "focus_follows_mouse": null, "mouse_follows_focus": true, "has_pending_raise_op": false, "remove_titlebars": false, ... ```
adam added the bug label 2026-01-05 14:49:08 +01:00
adam closed this issue 2026-01-05 14:49:08 +01:00
Author
Owner

@averrin commented on GitHub (Jul 1, 2023):

komorebic workspace-custom-layout-rule 0 0 2 ~/custom.yaml doesn't help either =(

@averrin commented on GitHub (Jul 1, 2023): `komorebic workspace-custom-layout-rule 0 0 2 ~/custom.yaml` doesn't help either =(
Author
Owner

@LGUG2Z commented on GitHub (Jul 1, 2023):

Let's continue this here: https://github.com/LGUG2Z/komorebi/issues/390

tl;dr Custom layouts require at least the number of columns + 1 to be activated, though this may be reduced to at least the number of columns in the future.

@LGUG2Z commented on GitHub (Jul 1, 2023): Let's continue this here: https://github.com/LGUG2Z/komorebi/issues/390 tl;dr Custom layouts require at least the number of columns + 1 to be activated, though this may be reduced to at least the number of columns in the future.
Author
Owner

@averrin commented on GitHub (Jul 1, 2023):

This works for me: https://github.com/LGUG2Z/komorebi/pull/477
But tbh, looks suspicious and may cause problems in all other cases.

@averrin commented on GitHub (Jul 1, 2023): This works for me: https://github.com/LGUG2Z/komorebi/pull/477 But tbh, looks suspicious and may cause problems in all other cases.
Author
Owner

@averrin commented on GitHub (Jul 1, 2023):

Oh, I see, Im not the smartest guy here.

@averrin commented on GitHub (Jul 1, 2023): Oh, I see, Im not the smartest guy here.
Author
Owner

@LGUG2Z commented on GitHub (Jul 1, 2023):

@averrin I just applied that exact change in the master branch; if your custom layout only contains two columns (primary and tertiary), then your custom layout will load when there are at least 2 windows open (this will be like a master/stack layout I guess?)

@LGUG2Z commented on GitHub (Jul 1, 2023): @averrin I just applied that exact change in the `master` branch; if your custom layout only contains two columns (primary and tertiary), then your custom layout will load when there are at least 2 windows open (this will be like a master/stack layout I guess?)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#226