[BUG]: closing and opening a window right after komorebi doesnt detect the new window #537

Open
opened 2026-01-05 14:51:22 +01:00 by adam · 0 comments
Owner

Originally created by @jklasdjklasdc on GitHub (Dec 6, 2024).

Summary

if a window is closed and then a window is opened right after komorebi seems to be stuck working with the closing the window and misses the window open event

https://github.com/user-attachments/assets/c083b4e0-9578-4558-b30e-d0d7995e9c3d

Version Information

C:\Users\User>systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version"
OS Name: Microsoft Windows 11 Home
OS Version: 10.0.22631 N/A Build 22631

C:\Users\User>d
'd' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\User>d:

D:>cd d:\programs\komerobi

d:\programs\komerobi>komorebic --version
komorebic 0.1.31
branch:master
commit_hash:40b32332
build_time:2024-12-01 00:59:06 +00:00
build_env:rustc 1.83.0 (90b35a623 2024-11-26),stable-x86_64-pc-windows-msvc

Komorebi Configuration

{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.30/schema.json",
  "app_specific_configuration_path": "$Env:KOMOREBI_CONFIG_HOME/applications.json",
  "window_hiding_behaviour": "Cloak",
  "cross_monitor_move_behaviour": "Insert",
  "default_workspace_padding": 0,
  "default_container_padding": 0,
  "border": false,
  "border_width": 2,
  "border_offset": -1,
  "theme": {
    "palette": "Base16",
    "name": "Ashes",
    "unfocused_border": "Base03",
    "bar_accent": "Base0D"
  },
  "unmanaged_window_operation_behaviour": "Op",
  "stackbar": {
    "height": 40,
    "mode": "OnStack",
    "tabs": {
      "width": 300,
      "focused_text": "#00a542",
      "unfocused_text": "#b3b3b3",
      "background": "#141414"
    }
  },
  "transparency": false,
  "transparency_alpha": 230,
  "mouse_follows_focus": false,
  "ignore_rules": [
    [
      {
        "id": "Adding books...",
        "kind": "Title",
        "matching_strategy": "Equals"
      },
      {
        "id": "calibre.exe",
        "kind": "Exe",
        "matching_strategy": "Equals"
      },
      {
        "id": "Qt672QWindowIcon",
        "kind": "Class",
        "matching_strategy": "Equals"
      }
    ]
  ],
  "slow_application_identifiers": [],
  "floating_applications": [
    [
      {
        "kind": "Title",
        "id": "Help"
      },
      {
        "id": "BorgCalendar.exe",
        "kind": "Exe"
      }
    ],
    [
      {
        "kind": "Class",
        "id": "TkTopLevel",
        "matching_strategy": "Equals"
      }
    ],
    [
      {
        "kind": "Class",
        "id": "Main HighGUI class",
        "matching_strategy": "Equals"
      }
    ]
  ],
  "tray_and_multi_window_applications": [
    [
      {
        "kind": "Exe",
        "id": "xdm-app.exe",
        "matching_strategy": "Equals"
      }
    ],
    [
      {
        "kind": "Class",
        "id": "wailsWindow",
        "matching_strategy": "Equals"
      },
      {
        "kind": "Title",
        "id": "Zen",
        "matching_strategy": "Equals"
      },
      {
        "kind": "Exe",
        "id": "Zen.exe",
        "matching_strategy": "Equals"
      }
    ],
    [
      {
        "kind": "Exe",
        "id": "JDownloader2.exe",
        "matching_strategy": "Equals"
      }
    ]
  ],
  "object_name_change_applications": [
    [
      {
        "id": "soffice.bin",
        "kind": "Exe",
        "matching_strategy": "Equals"
      },
      {
        "id": "SALFRAME",
        "kind": "Class",
        "matching_strategy": "Equals"
      }
    ]
  ]
}
{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.30/schema.bar.json",
  "monitor": {
    "index": 0,
    "work_area_offset": {
      "left": 0,
      "top": 40,
      "right": 0,
      "bottom": 40
    }
  },
  "position": {
    "start": { "x": 0, "y": 0 },
    "end": {
      "x": 1920,
      "y": 40
    }
  },
  "font_family": "JetBrains Mono",
  "theme": {
    "palette": "Base16",
    "name": "Ashes",
    "accent": "Base0D"
  },
  "left_widgets": [
    {
      "Komorebi": {
        "workspaces": {
          "enable": false,
          "hide_empty_workspaces": false
        },
        "layout": {
          "enable": false
        },
        "focused_window": {
          "enable": true,
          "show_icon": true
        }
      }
    }
  ],
  "right_widgets": [
    {
      "Media": {
        "enable": false
      }
    },
    {
      "Storage": {
        "enable": false
      }
    },
    {
      "Memory": {
        "enable": false
      }
    },
    {
      "Network": {
        "enable": true,
        "show_total_data_transmitted": false,
        "show_network_activity": true
      }
    },
    {
      "Date": {
        "enable": true,
        "format": "DayDateMonthYear"
      }
    },
    {
      "Time": {
        "enable": true,
        "format": "TwelveHour"
      }
    },
    {
      "Battery": {
        "enable": true
      }
    }
  ]
}

Hotkey Configuration

#Requires AutoHotkey v2.0.2
#SingleInstance Force
SetWorkingDir(A_ScriptDir)
#Include *i
#Include
#Include
try TraySetIcon(".\ico.ico")
#Include ./komorebic.lib.ahk
try FileDelete("lastStartup.txt")
ToolTip("komorebi loading...")
SetTimer(ToolTip.bind(""), -1000)

RunWait("cmd /c "komorebic.exe stop --bar"", A_ScriptDir, "hide")
Sleep(1000)
RunWait("cmd /c "komorebic.exe start --bar --await-configuration > lastStartup.txt"", A_ScriptDir, "hide")
; RunWait("cmd /c "komorebic.exe start --bar --await-configuration > lastStartup.txt & start ./lastStartup.txt"", A_ScriptDir, "hide")
; RunWait("cmd /c "komorebic.exe stop --ahk --bar & komorebic.exe start & komorebic.exe start --bar"", A_ScriptDir, "hide")
; RunWait("cmd /c "komorebic.exe stop --ahk --bar & komorebic.exe start --bar --await-configuration"", A_ScriptDir, "hide")
; RunWait("cmd /c "komorebic.exe stop --ahk --bar & komorebic.exe start --bar --await-configuration --tcp-port 1554"", A_ScriptDir, "hide")
; run("komorebi-bar.exe", A_ScriptDir, "hide")
Komorebic(cmd) {
RunWait(format("komorebic.exe {}", cmd), , "Hide")
}
; komorebic visible-windows
; komorebic state
; komorebic.exe stop --ahk --bar & komorebic.exe start --bar
+!^#q::{
RunWait("cmd /c "komorebic.exe stop --bar"", A_ScriptDir, "hide")
}
+!Q::{
Reload()
}
; RunWait("cmd /c "komorebic clear-workspace-layout-rules 0 0"", A_WorkingDir, "hide")
; RunWait("cmd /c "komorebic clear-workspace-layout-rules 0 1"", A_WorkingDir, "hide")
; RunWait("cmd /c "komorebic clear-workspace-layout-rules 0 2"", A_WorkingDir, "hide")
; RunWait("cmd /c "komorebic clear-workspace-layout-rules 0 3"", A_WorkingDir, "hide")x
; RunWait("cmd /c "komorebic clear-workspace-layout-rules 0 4"", A_WorkingDir, "hide")
; RunWait("cmd /c "komorebic clear-workspace-layout-rules 0 5"", A_WorkingDir, "hide")
WorkspaceCustomLayout(0, 0, "test1.json")
WorkspaceCustomLayout(0, 1, "test1.json")
WorkspaceCustomLayout(0, 2, "test1.json")
WorkspaceCustomLayout(0, 3, "test1.json")
WorkspaceCustomLayout(0, 4, "test1.json")

ActiveWindowBorderColour(255, 0, 150, "single")
ActiveWindowBorderColour(256, 165, 66, "stack")
ActiveWindowBorderColour(255, 51, 153, "monocle")
ActiveWindowBorderWidth(2)

; ContainerPadding(0, 0, 0)
; ContainerPadding(0, 1, 0)
; ContainerPadding(0, 2, 0)
; ContainerPadding(0, 3, 0)
; ContainerPadding(0, 4, 0)
CompleteConfiguration()
WinWait("komorebi-bar")
WinSetStyle("+E0x20", "komorebi-bar")
WinSetTransparent(200, "komorebi-bar")
WinMove(0, 0, A_ScreenWidth, 40, "ahk_exe komorebi-bar.exe")
; WinGetPos(&x, &y, &w, &h, "komorebi-bar")
; CoordMode("Mouse", "Screen")
; while 1 {
; MouseGetPos(&mx, &my)
; WinWaitActive("Program Manager ahk_exe explorer.exe")
; try WinMinimize("komorebi-bar")
; WinWaitNotActive("Program Manager ahk_exe explorer.exe")
; try WinRestore("komorebi-bar")
; ; if mx >= x && mx <= w - x && my >= y && my <= y + h {
; ; try WinHide("komorebi-bar")
; ; } else {
; ; try WinShow("komorebi-bar")
; ; }
; }

!F4::Komorebic("close")

; Focus windows
!j::Komorebic("focus left")
!k::Komorebic("focus down")
!i::Komorebic("focus up")
!l::Komorebic("focus right")

!+[::Komorebic("cycle-focus previous")
!+]::Komorebic("cycle-focus next")

; Move windows
!+j::Komorebic("move left")
!+k::Komorebic("move down")
!+i::Komorebic("move up")
!+l::Komorebic("move right")

; Stack windows
; !Left::Komorebic("stack left")
; !Down::Komorebic("stack down")
; !Up::Komorebic("stack up")
; !Right::Komorebic("stack right")
; !;::Komorebic("unstack")
![::Komorebic("cycle-stack previous")
!]::Komorebic("cycle-stack next")

; Resize
; !=::Komorebic("resize-axis horizontal increase")
; !-::Komorebic("resize-axis horizontal decrease")
; !+=::Komorebic("resize-axis vertical increase")
; !+_::Komorebic("resize-axis vertical decrease")

; Manipulate windows
+!Space::Komorebic("toggle-float")
+!Enter::Komorebic("toggle-monocle")

; Window manager options
!+z::Komorebic("retile")
!p::Komorebic("toggle-pause")

; Layouts
; !x::Komorebic("flip-layout horizontal")
; !y::Komorebic("flip-layout vertical")

; Workspaces
!a::Komorebic("focus-workspace 0")
!s::Komorebic("focus-workspace 1")
!d::Komorebic("focus-workspace 2")
!f::Komorebic("focus-workspace 3")
; !5::Komorebic("focus-workspace 4")
; !6::Komorebic("focus-workspace 5")
; !7::Komorebic("focus-workspace 6")
; !8::Komorebic("focus-workspace 7")

; ; Move windows across workspaces
!+a::Komorebic("move-to-workspace 0")
!+s::Komorebic("move-to-workspace 1")
!+d::Komorebic("move-to-workspace 2")
!+f::Komorebic("move-to-workspace 3")
; !+5::Komorebic("move-to-workspace 4")
; !+6::Komorebic("move-to-workspace 5")
; !+7::Komorebic("move-to-workspace 6")
; !+8::Komorebic("move-to-workspace 7")

Output of komorebic check

d:\programs\komerobi>komorebic check
KOMOREBI_CONFIG_HOME detected: D:\programs\komerobi

Looking for configuration files in D:\programs\komerobi

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

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

Originally created by @jklasdjklasdc on GitHub (Dec 6, 2024). ### Summary if a window is closed and then a window is opened right after komorebi seems to be stuck working with the closing the window and misses the window open event https://github.com/user-attachments/assets/c083b4e0-9578-4558-b30e-d0d7995e9c3d ### Version Information C:\Users\User>systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version" OS Name: Microsoft Windows 11 Home OS Version: 10.0.22631 N/A Build 22631 C:\Users\User>d 'd' is not recognized as an internal or external command, operable program or batch file. C:\Users\User>d: D:\>cd d:\programs\komerobi d:\programs\komerobi>komorebic --version komorebic 0.1.31 branch:master commit_hash:40b32332 build_time:2024-12-01 00:59:06 +00:00 build_env:rustc 1.83.0 (90b35a623 2024-11-26),stable-x86_64-pc-windows-msvc ### Komorebi Configuration ```json { "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.30/schema.json", "app_specific_configuration_path": "$Env:KOMOREBI_CONFIG_HOME/applications.json", "window_hiding_behaviour": "Cloak", "cross_monitor_move_behaviour": "Insert", "default_workspace_padding": 0, "default_container_padding": 0, "border": false, "border_width": 2, "border_offset": -1, "theme": { "palette": "Base16", "name": "Ashes", "unfocused_border": "Base03", "bar_accent": "Base0D" }, "unmanaged_window_operation_behaviour": "Op", "stackbar": { "height": 40, "mode": "OnStack", "tabs": { "width": 300, "focused_text": "#00a542", "unfocused_text": "#b3b3b3", "background": "#141414" } }, "transparency": false, "transparency_alpha": 230, "mouse_follows_focus": false, "ignore_rules": [ [ { "id": "Adding books...", "kind": "Title", "matching_strategy": "Equals" }, { "id": "calibre.exe", "kind": "Exe", "matching_strategy": "Equals" }, { "id": "Qt672QWindowIcon", "kind": "Class", "matching_strategy": "Equals" } ] ], "slow_application_identifiers": [], "floating_applications": [ [ { "kind": "Title", "id": "Help" }, { "id": "BorgCalendar.exe", "kind": "Exe" } ], [ { "kind": "Class", "id": "TkTopLevel", "matching_strategy": "Equals" } ], [ { "kind": "Class", "id": "Main HighGUI class", "matching_strategy": "Equals" } ] ], "tray_and_multi_window_applications": [ [ { "kind": "Exe", "id": "xdm-app.exe", "matching_strategy": "Equals" } ], [ { "kind": "Class", "id": "wailsWindow", "matching_strategy": "Equals" }, { "kind": "Title", "id": "Zen", "matching_strategy": "Equals" }, { "kind": "Exe", "id": "Zen.exe", "matching_strategy": "Equals" } ], [ { "kind": "Exe", "id": "JDownloader2.exe", "matching_strategy": "Equals" } ] ], "object_name_change_applications": [ [ { "id": "soffice.bin", "kind": "Exe", "matching_strategy": "Equals" }, { "id": "SALFRAME", "kind": "Class", "matching_strategy": "Equals" } ] ] } { "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.30/schema.bar.json", "monitor": { "index": 0, "work_area_offset": { "left": 0, "top": 40, "right": 0, "bottom": 40 } }, "position": { "start": { "x": 0, "y": 0 }, "end": { "x": 1920, "y": 40 } }, "font_family": "JetBrains Mono", "theme": { "palette": "Base16", "name": "Ashes", "accent": "Base0D" }, "left_widgets": [ { "Komorebi": { "workspaces": { "enable": false, "hide_empty_workspaces": false }, "layout": { "enable": false }, "focused_window": { "enable": true, "show_icon": true } } } ], "right_widgets": [ { "Media": { "enable": false } }, { "Storage": { "enable": false } }, { "Memory": { "enable": false } }, { "Network": { "enable": true, "show_total_data_transmitted": false, "show_network_activity": true } }, { "Date": { "enable": true, "format": "DayDateMonthYear" } }, { "Time": { "enable": true, "format": "TwelveHour" } }, { "Battery": { "enable": true } } ] } ``` ### Hotkey Configuration #Requires AutoHotkey v2.0.2 #SingleInstance Force SetWorkingDir(A_ScriptDir) #Include *i <AutoThemed> #Include <Misc> #Include <base> try TraySetIcon(".\ico.ico") #Include ./komorebic.lib.ahk try FileDelete("lastStartup.txt") ToolTip("komorebi loading...") SetTimer(ToolTip.bind(""), -1000) RunWait("cmd /c `"komorebic.exe stop --bar`"", A_ScriptDir, "hide") Sleep(1000) RunWait("cmd /c `"komorebic.exe start --bar --await-configuration > lastStartup.txt`"", A_ScriptDir, "hide") ; RunWait("cmd /c `"komorebic.exe start --bar --await-configuration > lastStartup.txt & start ./lastStartup.txt`"", A_ScriptDir, "hide") ; RunWait("cmd /c `"komorebic.exe stop --ahk --bar & komorebic.exe start & komorebic.exe start --bar`"", A_ScriptDir, "hide") ; RunWait("cmd /c `"komorebic.exe stop --ahk --bar & komorebic.exe start --bar --await-configuration`"", A_ScriptDir, "hide") ; RunWait("cmd /c `"komorebic.exe stop --ahk --bar & komorebic.exe start --bar --await-configuration --tcp-port 1554`"", A_ScriptDir, "hide") ; run("komorebi-bar.exe", A_ScriptDir, "hide") Komorebic(cmd) { RunWait(format("komorebic.exe {}", cmd), , "Hide") } ; komorebic visible-windows ; komorebic state ; komorebic.exe stop --ahk --bar & komorebic.exe start --bar +!^#q::{ RunWait("cmd /c `"komorebic.exe stop --bar`"", A_ScriptDir, "hide") } +!Q::{ Reload() } ; RunWait("cmd /c `"komorebic clear-workspace-layout-rules 0 0`"", A_WorkingDir, "hide") ; RunWait("cmd /c `"komorebic clear-workspace-layout-rules 0 1`"", A_WorkingDir, "hide") ; RunWait("cmd /c `"komorebic clear-workspace-layout-rules 0 2`"", A_WorkingDir, "hide") ; RunWait("cmd /c `"komorebic clear-workspace-layout-rules 0 3`"", A_WorkingDir, "hide")x ; RunWait("cmd /c `"komorebic clear-workspace-layout-rules 0 4`"", A_WorkingDir, "hide") ; RunWait("cmd /c `"komorebic clear-workspace-layout-rules 0 5`"", A_WorkingDir, "hide") WorkspaceCustomLayout(0, 0, "test1.json") WorkspaceCustomLayout(0, 1, "test1.json") WorkspaceCustomLayout(0, 2, "test1.json") WorkspaceCustomLayout(0, 3, "test1.json") WorkspaceCustomLayout(0, 4, "test1.json") ActiveWindowBorderColour(255, 0, 150, "single") ActiveWindowBorderColour(256, 165, 66, "stack") ActiveWindowBorderColour(255, 51, 153, "monocle") ActiveWindowBorderWidth(2) ; ContainerPadding(0, 0, 0) ; ContainerPadding(0, 1, 0) ; ContainerPadding(0, 2, 0) ; ContainerPadding(0, 3, 0) ; ContainerPadding(0, 4, 0) CompleteConfiguration() WinWait("komorebi-bar") WinSetStyle("+E0x20", "komorebi-bar") WinSetTransparent(200, "komorebi-bar") WinMove(0, 0, A_ScreenWidth, 40, "ahk_exe komorebi-bar.exe") ; WinGetPos(&x, &y, &w, &h, "komorebi-bar") ; CoordMode("Mouse", "Screen") ; while 1 { ; MouseGetPos(&mx, &my) ; WinWaitActive("Program Manager ahk_exe explorer.exe") ; try WinMinimize("komorebi-bar") ; WinWaitNotActive("Program Manager ahk_exe explorer.exe") ; try WinRestore("komorebi-bar") ; ; if mx >= x && mx <= w - x && my >= y && my <= y + h { ; ; try WinHide("komorebi-bar") ; ; } else { ; ; try WinShow("komorebi-bar") ; ; } ; } !F4::Komorebic("close") ; Focus windows !j::Komorebic("focus left") !k::Komorebic("focus down") !i::Komorebic("focus up") !l::Komorebic("focus right") !+[::Komorebic("cycle-focus previous") !+]::Komorebic("cycle-focus next") ; Move windows !+j::Komorebic("move left") !+k::Komorebic("move down") !+i::Komorebic("move up") !+l::Komorebic("move right") ; Stack windows ; !Left::Komorebic("stack left") ; !Down::Komorebic("stack down") ; !Up::Komorebic("stack up") ; !Right::Komorebic("stack right") ; !;::Komorebic("unstack") ![::Komorebic("cycle-stack previous") !]::Komorebic("cycle-stack next") ; Resize ; !=::Komorebic("resize-axis horizontal increase") ; !-::Komorebic("resize-axis horizontal decrease") ; !+=::Komorebic("resize-axis vertical increase") ; !+_::Komorebic("resize-axis vertical decrease") ; Manipulate windows +!Space::Komorebic("toggle-float") +!Enter::Komorebic("toggle-monocle") ; Window manager options !+z::Komorebic("retile") !p::Komorebic("toggle-pause") ; Layouts ; !x::Komorebic("flip-layout horizontal") ; !y::Komorebic("flip-layout vertical") ; Workspaces !a::Komorebic("focus-workspace 0") !s::Komorebic("focus-workspace 1") !d::Komorebic("focus-workspace 2") !f::Komorebic("focus-workspace 3") ; !5::Komorebic("focus-workspace 4") ; !6::Komorebic("focus-workspace 5") ; !7::Komorebic("focus-workspace 6") ; !8::Komorebic("focus-workspace 7") ; ; Move windows across workspaces !+a::Komorebic("move-to-workspace 0") !+s::Komorebic("move-to-workspace 1") !+d::Komorebic("move-to-workspace 2") !+f::Komorebic("move-to-workspace 3") ; !+5::Komorebic("move-to-workspace 4") ; !+6::Komorebic("move-to-workspace 5") ; !+7::Komorebic("move-to-workspace 6") ; !+8::Komorebic("move-to-workspace 7") ### Output of komorebic check d:\programs\komerobi>komorebic check KOMOREBI_CONFIG_HOME detected: D:\programs\komerobi Looking for configuration files in D:\programs\komerobi Found komorebi.json; this file can be passed to the start command with the --config flag Found C:\Users\User\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
adam added the bugi-will-not-work-on-thiskomorebii-am-stuck labels 2026-01-05 14:51:22 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#537