dalyIsaac / Whim

Pluggable dynamic window manager for Windows🏗️🪟
https://dalyisaac.github.io/Whim/
MIT License
171 stars 11 forks source link

`focus_next_monitor` not working when next monitor has no windows #822

Closed urob closed 8 months ago

urob commented 8 months ago

Is there an existing issue for this?

Behavior

Another bug, possibly related to #821. When executing whim.core.focus_next_monitor and the "next" monitor is empty, then the change in focus (sometimes) fails.

Example

  1. Initial active monitor: DISPLAY
  2. whim.core.focus_next_monitor is triggered via a keybind
  3. According to the logs, the next workspace DISPLAY1 is briefly activated, but it subsequently looses focus again
  4. The end result is that the originally active monitor (DISPLAY) still has the focus

Logs

Here are the logs from the focus_next_monitor event. The logs are a bit ambiguous at the end with regards to which monitor is active. But I have verified in various ways that it is indeed the originally active monitor which has the focus in the end.

2024-02-05 22:56:04.964 -05:00 [DBG] KeybindManager:82              [GetCommands]                  Getting commands for keybind 'LAlt + O'
2024-02-05 22:56:04.964 -05:00 [DBG] Command:52                     [TryExecute]                   Trying to execute command whim.core.focus_next_monitor
2024-02-05 22:56:04.964 -05:00 [DBG] MonitorManager:293             [GetNextMonitor]               Getting next monitor for Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]
2024-02-05 22:56:04.964 -05:00 [DBG] ButlerPantry:76                [GetWorkspaceForMonitor]       Getting workspace for monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False]
2024-02-05 22:56:04.965 -05:00 [DBG] Workspace:120                  [FocusLastFocusedWindow]       Focusing last focused window in workspace 1
2024-02-05 22:56:04.965 -05:00 [DBG] Window:68                      [Focus]                        Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:04.968 -05:00 [DBG] WindowManager:370              [OnWindowFocused]              Window focused: Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:04.968 -05:00 [DBG] MonitorManager:78              [WindowFocused]                Focusing hwnd 0x00631272
2024-02-05 22:56:04.969 -05:00 [DBG] MonitorManager:89              [WindowFocused]                Setting active monitor to Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]
2024-02-05 22:56:04.970 -05:00 [DBG] ButlerEventHandlers:127        [WindowManager_WindowFocused]  Window focused: Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:04.971 -05:00 [DBG] Workspace:81                   [WindowFocused]                Focused window Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272} in workspace 1
2024-02-05 22:56:04.972 -05:00 [DBG] ButlerPantry:82                [GetWorkspaceForWindow]        Getting workspace for window Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:04.972 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 1
2024-02-05 22:56:04.973 -05:00 [DBG] ButlerPantry:65                [GetMonitorForWorkspace]       Found monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False] for workspace 1
2024-02-05 22:56:04.973 -05:00 [DBG] FocusIndicatorPlugin:93        [Show]                         Showing focus indicator
2024-02-05 22:56:04.974 -05:00 [DBG] WorkspaceManager:67            [ActiveWorkspace]              Getting active workspace for monitor Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]
2024-02-05 22:56:04.974 -05:00 [DBG] ButlerPantry:76                [GetWorkspaceForMonitor]       Getting workspace for monitor Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]
2024-02-05 22:56:04.974 -05:00 [DBG] FocusIndicatorWindow.xaml:32   [Activate]                     Activating focus indicator window
2024-02-05 22:56:04.983 -05:00 [DBG] DeferWindowPosHandle:46        [.ctor]                        Creating new WindowDeferPosHandle
2024-02-05 22:56:04.984 -05:00 [DBG] DeferWindowPosHandle:89        [DeferWindowPos]               Adding window Whim Focus Indicator (Whim.Runner) [21708] <WinUIDesktopWin32WindowClass> {0x00180E00} after 0x0001059E with flags SWP_NOREDRAW, SWP_NOACTIVATE
2024-02-05 22:56:04.984 -05:00 [DBG] DeferWindowPosHandle:120       [Dispose]                      Disposing WindowDeferPosHandle
2024-02-05 22:56:04.984 -05:00 [DBG] DeferWindowPosHandle:146       [Dispose]                      Setting window position 2 times for 1 windows
2024-02-05 22:56:04.985 -05:00 [DBG] NativeManager:83               [ShowWindowNoActivate]         Showing window HWND 0x00180E00 no activate
2024-02-05 22:56:04.994 -05:00 [DBG] NativeManager:83               [ShowWindowNoActivate]         Showing window HWND 0x00180E00 no activate
2024-02-05 22:56:04.999 -05:00 [DBG] DeferWindowPosHandle:182       [Dispose]                      Finished setting window position
2024-02-05 22:56:05.000 -05:00 [DBG] ButlerPantry:50                [GetMonitorForWindow]          Getting monitor for window: Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:05.000 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 1
2024-02-05 22:56:05.000 -05:00 [DBG] ButlerPantry:65                [GetMonitorForWorkspace]       Found monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False] for workspace 1
2024-02-05 22:56:05.000 -05:00 [DBG] ButlerPantry:50                [GetMonitorForWindow]          Getting monitor for window: Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:05.000 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 1
2024-02-05 22:56:05.000 -05:00 [DBG] ButlerPantry:65                [GetMonitorForWorkspace]       Found monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False] for workspace 1
2024-02-05 22:56:05.003 -05:00 [DBG] WindowManager:279              [WinEventProc]                 Windows event 0x0003 for Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:05.004 -05:00 [DBG] WindowManager:370              [OnWindowFocused]              Window focused: Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:05.004 -05:00 [DBG] MonitorManager:78              [WindowFocused]                Focusing hwnd 0x00631272
2024-02-05 22:56:05.004 -05:00 [DBG] MonitorManager:89              [WindowFocused]                Setting active monitor to Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]
2024-02-05 22:56:05.004 -05:00 [DBG] ButlerEventHandlers:127        [WindowManager_WindowFocused]  Window focused: Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:05.004 -05:00 [DBG] Workspace:81                   [WindowFocused]                Focused window Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272} in workspace 1
2024-02-05 22:56:05.005 -05:00 [DBG] ButlerPantry:82                [GetWorkspaceForWindow]        Getting workspace for window Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:05.005 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 1
2024-02-05 22:56:05.005 -05:00 [DBG] ButlerPantry:65                [GetMonitorForWorkspace]       Found monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False] for workspace 1
2024-02-05 22:56:05.005 -05:00 [DBG] FocusIndicatorPlugin:93        [Show]                         Showing focus indicator
2024-02-05 22:56:05.005 -05:00 [DBG] WorkspaceManager:67            [ActiveWorkspace]              Getting active workspace for monitor Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]
2024-02-05 22:56:05.005 -05:00 [DBG] ButlerPantry:76                [GetWorkspaceForMonitor]       Getting workspace for monitor Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]
2024-02-05 22:56:05.005 -05:00 [DBG] FocusIndicatorWindow.xaml:32   [Activate]                     Activating focus indicator window
2024-02-05 22:56:05.006 -05:00 [DBG] DeferWindowPosHandle:46        [.ctor]                        Creating new WindowDeferPosHandle
2024-02-05 22:56:05.006 -05:00 [DBG] DeferWindowPosHandle:89        [DeferWindowPos]               Adding window Whim Focus Indicator (Whim.Runner) [21708] <WinUIDesktopWin32WindowClass> {0x00180E00} after 0x0001059E with flags SWP_NOREDRAW, SWP_NOACTIVATE
2024-02-05 22:56:05.006 -05:00 [DBG] DeferWindowPosHandle:120       [Dispose]                      Disposing WindowDeferPosHandle
2024-02-05 22:56:05.006 -05:00 [DBG] DeferWindowPosHandle:146       [Dispose]                      Setting window position 2 times for 1 windows
2024-02-05 22:56:05.007 -05:00 [DBG] NativeManager:83               [ShowWindowNoActivate]         Showing window HWND 0x00180E00 no activate
2024-02-05 22:56:05.007 -05:00 [DBG] NativeManager:83               [ShowWindowNoActivate]         Showing window HWND 0x00180E00 no activate
2024-02-05 22:56:05.007 -05:00 [DBG] DeferWindowPosHandle:182       [Dispose]                      Finished setting window position
2024-02-05 22:56:05.008 -05:00 [DBG] ButlerPantry:50                [GetMonitorForWindow]          Getting monitor for window: Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:05.008 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 1
2024-02-05 22:56:05.008 -05:00 [DBG] ButlerPantry:65                [GetMonitorForWorkspace]       Found monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False] for workspace 1
2024-02-05 22:56:05.008 -05:00 [DBG] ButlerPantry:50                [GetMonitorForWindow]          Getting monitor for window: Tmux / 2 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x00631272}
2024-02-05 22:56:05.008 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 1
2024-02-05 22:56:05.008 -05:00 [DBG] ButlerPantry:65                [GetMonitorForWorkspace]       Found monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False] for workspace 1
2024-02-05 22:56:05.008 -05:00 [DBG] DeferWindowPosManager:62       [RecoverLayout]                Attempting to recover layout
2024-02-05 22:56:05.008 -05:00 [DBG] DeferWindowPosManager:71       [RecoverLayout]                No windows to recover layout for

Logs (continuation after next keypress)

This is just to show that it is indeed DISPLAY that was active in the end.

2024-02-05 22:56:05.008 -05:00 [DBG] DeferWindowPosManager:62       [RecoverLayout]                Attempting to recover layout
2024-02-05 22:56:05.008 -05:00 [DBG] DeferWindowPosManager:71       [RecoverLayout]                No windows to recover layout for
2024-02-05 22:56:06.259 -05:00 [DBG] KeybindManager:82              [GetCommands]                  Getting commands for keybind 'LAlt + H'
2024-02-05 22:56:06.260 -05:00 [DBG] Command:52                     [TryExecute]                   Trying to execute command whim.custom.activate_next_workspace
2024-02-05 22:56:06.260 -05:00 [DBG] ButlerChores:80                [ActivateAdjacent]             Activating next workspace
2024-02-05 22:56:06.260 -05:00 [DBG] ButlerPantry:76                [GetWorkspaceForMonitor]       Getting workspace for monitor Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]

Config

// let me know if anything is relevant here

Environment

Steps To Reproduce

see above

Anything else?

No response

dalyIsaac commented 8 months ago

I think this builds upon #827 - hopefully the desktop focus mitigation helps here. I found and fixed a separate but related issue where it wasn't possible to focus a monitor if the monitor's workspace had only minimized windows. I've found with these fixes that monitor focus changes appear consistent on my machine, though the opaque nature of inspecting the windows events a bit tricky to fully diagnose.

urob commented 8 months ago

Thanks for looking into this. Unfortunately, the issue hasn't been fully resolved yet for me. But I think it's definitely related to #837: Activating an fully empty workspace now works as expected. However, trying to activate a workspace with at least one minimized window and no un-minimized windows still losses focus.

More logs below:

Initial conditions

Switching to workspace 2 on monitor 2 results in monitor 1 (DISPLAY) first getting focused at 16:23:53:073. There's a bit forth and back after that, but in the end monitor 1 is the one that has the focus.

Logs

2024-02-10 16:23:53.069 -05:00 [DBG] KeybindManager:82              [GetCommands]                  Getting commands for keybind 'LAlt + H'
2024-02-10 16:23:53.069 -05:00 [DBG] Command:52                     [TryExecute]                   Trying to execute command whim.custom.activate_next_workspace
2024-02-10 16:23:53.069 -05:00 [DBG] ButlerChores:99                [ActivateAdjacent]             Activating next workspace
2024-02-10 16:23:53.069 -05:00 [DBG] ButlerPantry:76                [GetWorkspaceForMonitor]       Getting workspace for monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False]
2024-02-10 16:23:53.069 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 2
2024-02-10 16:23:53.069 -05:00 [DBG] ButlerPantry:70                [GetMonitorForWorkspace]       Could not find monitor for workspace 2
2024-02-10 16:23:53.069 -05:00 [DBG] ButlerChores:21                [Activate]                     Activating workspace 2 in monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False]
2024-02-10 16:23:53.069 -05:00 [DBG] ButlerPantry:76                [GetWorkspaceForMonitor]       Getting workspace for monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False]
2024-02-10 16:23:53.069 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 2
2024-02-10 16:23:53.069 -05:00 [DBG] ButlerPantry:70                [GetMonitorForWorkspace]       Could not find monitor for workspace 2
2024-02-10 16:23:53.069 -05:00 [DBG] ButlerPantry:124               [SetMonitorWorkspace]          Setting workspace 2 to monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False]
2024-02-10 16:23:53.069 -05:00 [DBG] Workspace:441                  [Deactivate]                   Deactivating workspace 1
2024-02-10 16:23:53.069 -05:00 [DBG] Window:86                      [Hide]                         Tmux / 0 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x0001059E}
2024-02-10 16:23:53.069 -05:00 [DBG] NativeManager:59               [HideWindow]                   Hiding window HWND 0x0001059E
2024-02-10 16:23:53.073 -05:00 [DBG] WindowManager:381              [OnWindowFocused]              Window focused: 
2024-02-10 16:23:53.073 -05:00 [DBG] MonitorManager:78              [OnWindowFocused]              Focusing hwnd 0x00000000
2024-02-10 16:23:53.073 -05:00 [DBG] MonitorManager:89              [OnWindowFocused]              Setting active monitor to Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]
2024-02-10 16:23:53.073 -05:00 [DBG] ButlerEventHandlers:120        [OnWindowFocused]              Window focused: 
2024-02-10 16:23:53.073 -05:00 [DBG] FocusIndicatorPlugin:137       [Hide]                         Hiding focus indicator
2024-02-10 16:23:53.073 -05:00 [DBG] NativeManager:59               [HideWindow]                   Hiding window HWND 0x00D60A48
2024-02-10 16:23:53.079 -05:00 [DBG] MonitorManager:104             [ActivateEmptyMonitor]         Activating empty monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False]
2024-02-10 16:23:53.079 -05:00 [DBG] Workspace:459                  [DoLayout]                     Workspace 2
2024-02-10 16:23:53.079 -05:00 [DBG] DeferWorkspacePosManager:23    [DoLayout]                     Layout 2
2024-02-10 16:23:53.079 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 2
2024-02-10 16:23:53.079 -05:00 [DBG] ButlerPantry:65                [GetMonitorForWorkspace]       Found monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False] for workspace 2
2024-02-10 16:23:53.079 -05:00 [DBG] DeferWorkspacePosManager:39    [DoLayout]                     Starting layout for workspace 2
2024-02-10 16:23:53.079 -05:00 [DBG] FocusIndicatorPlugin:137       [Hide]                         Hiding focus indicator
2024-02-10 16:23:53.079 -05:00 [DBG] NativeManager:59               [HideWindow]                   Hiding window HWND 0x00D60A48
2024-02-10 16:23:53.080 -05:00 [DBG] DeferWorkspacePosManager:50    [SetWindowPos]                 Setting window positions for workspace 2
2024-02-10 16:23:53.080 -05:00 [DBG] SliceLayoutEngine:145          [DoLayout]                     Doing layout on (X: 3846, Y: 48, Width: 3828, Height: 2106) on Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False], with 0 windows and 1 minimized windows
2024-02-10 16:23:53.080 -05:00 [DBG] DeferWorkspacePosManager:59    [SetWindowPos]                 Window Dropbox (explorer) [2856] <CabinetWClass> {0x00230FD4} has rectangle (X: 0, Y: 0, Width: 0, Height: 0)
2024-02-10 16:23:53.080 -05:00 [DBG] DeferWindowPosHandle:46        [.ctor]                        Creating new WindowDeferPosHandle
2024-02-10 16:23:53.080 -05:00 [DBG] DeferWindowPosHandle:120       [Dispose]                      Disposing WindowDeferPosHandle
2024-02-10 16:23:53.080 -05:00 [DBG] DeferWindowPosHandle:146       [Dispose]                      Setting window position 2 times for 0 windows
2024-02-10 16:23:53.080 -05:00 [DBG] NativeManager:77               [MinimizeWindow]               Minimizing window HWND 0x00230FD4
2024-02-10 16:23:53.104 -05:00 [DBG] NativeManager:77               [MinimizeWindow]               Minimizing window HWND 0x00230FD4
2024-02-10 16:23:53.113 -05:00 [DBG] DeferWindowPosHandle:182       [Dispose]                      Finished setting window position
2024-02-10 16:23:53.113 -05:00 [DBG] FocusIndicatorPlugin:93        [Show]                         Showing focus indicator
2024-02-10 16:23:53.113 -05:00 [DBG] WorkspaceManager:67            [ActiveWorkspace]              Getting active workspace for monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False]
2024-02-10 16:23:53.113 -05:00 [DBG] ButlerPantry:76                [GetWorkspaceForMonitor]       Getting workspace for monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False]
2024-02-10 16:23:53.113 -05:00 [DBG] FocusIndicatorPlugin:114       [Show]                         Window Dropbox (explorer) [2856] <CabinetWClass> {0x00230FD4} is minimized
2024-02-10 16:23:53.113 -05:00 [DBG] FocusIndicatorPlugin:137       [Hide]                         Hiding focus indicator
2024-02-10 16:23:53.113 -05:00 [DBG] NativeManager:59               [HideWindow]                   Hiding window HWND 0x00D60A48
2024-02-10 16:23:53.114 -05:00 [DBG] Workspace:120                  [FocusLastFocusedWindow]       Focusing last focused window in workspace 2
2024-02-10 16:23:53.114 -05:00 [DBG] Workspace:127                  [FocusLastFocusedWindow]       No windows in workspace 2 to focus, focusing desktop
2024-02-10 16:23:53.114 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 2
2024-02-10 16:23:53.114 -05:00 [DBG] ButlerPantry:65                [GetMonitorForWorkspace]       Found monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False] for workspace 2
2024-02-10 16:23:53.120 -05:00 [DBG] WindowManager:381              [OnWindowFocused]              Window focused: 
2024-02-10 16:23:53.120 -05:00 [DBG] MonitorManager:78              [OnWindowFocused]              Focusing hwnd 0x00000000
2024-02-10 16:23:53.120 -05:00 [DBG] MonitorManager:89              [OnWindowFocused]              Setting active monitor to Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]
2024-02-10 16:23:53.120 -05:00 [DBG] ButlerEventHandlers:120        [OnWindowFocused]              Window focused: 
2024-02-10 16:23:53.120 -05:00 [DBG] FocusIndicatorPlugin:137       [Hide]                         Hiding focus indicator
2024-02-10 16:23:53.120 -05:00 [DBG] NativeManager:59               [HideWindow]                   Hiding window HWND 0x00D60A48
2024-02-10 16:23:53.121 -05:00 [DBG] MonitorManager:104             [ActivateEmptyMonitor]         Activating empty monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False]
2024-02-10 16:23:53.121 -05:00 [DBG] ButlerPantry:76                [GetWorkspaceForMonitor]       Getting workspace for monitor Monitor[Bounds=(X: 3840, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 3840, Y: 0, Width: 3840, Height: 2160) Name=\\.\DISPLAY1 ScaleFactor=150 IsPrimary=False]
2024-02-10 16:23:53.123 -05:00 [DBG] WindowManager:288              [WinEventProc]                 Windows event 0x8003 for Tmux / 0 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x0001059E}
2024-02-10 16:23:53.123 -05:00 [DBG] WindowManager:398              [OnWindowHidden]               Window hidden: Tmux / 0 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x0001059E}
2024-02-10 16:23:53.123 -05:00 [DBG] ButlerPantry:50                [GetMonitorForWindow]          Getting monitor for window: Tmux / 0 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x0001059E}
2024-02-10 16:23:53.123 -05:00 [DBG] ButlerPantry:58                [GetMonitorForWorkspace]       Getting monitor for workspace 1
2024-02-10 16:23:53.123 -05:00 [DBG] ButlerPantry:70                [GetMonitorForWorkspace]       Could not find monitor for workspace 1
2024-02-10 16:23:53.123 -05:00 [DBG] WindowManager:402              [OnWindowHidden]               Window Tmux / 0 (WindowsTerminal) [17740] <CASCADIA_HOSTING_WINDOW_CLASS> {0x0001059E} is not tracked in a monitor, ignoring event
2024-02-10 16:23:53.123 -05:00 [DBG] DeferWindowPosManager:62       [RecoverLayout]                Attempting to recover layout
2024-02-10 16:23:53.123 -05:00 [DBG] DeferWindowPosManager:71       [RecoverLayout]                No windows to recover layout for
2024-02-10 16:23:53.123 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x00D60A48
2024-02-10 16:23:53.124 -05:00 [DBG] WindowManager:288              [WinEventProc]                 Windows event 0x8002 for Dropbox (explorer) [2856] <CabinetWClass> {0x00230FD4}
2024-02-10 16:23:53.124 -05:00 [DBG] DeferWindowPosManager:62       [RecoverLayout]                Attempting to recover layout
2024-02-10 16:23:53.124 -05:00 [DBG] DeferWindowPosManager:71       [RecoverLayout]                No windows to recover layout for
2024-02-10 16:23:53.124 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x01E60C54
2024-02-10 16:23:53.124 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x00F20B8C
2024-02-10 16:23:53.124 -05:00 [DBG] WindowManager:134              [CreateWindow]                 Created window Whim Bar (Whim.Runner) [28720] <WinUIDesktopWin32WindowClass> {0x00F20B8C}
2024-02-10 16:23:53.125 -05:00 [DBG] WindowManager:267              [WinEventProc]                 Window 0x00F20B8C with event 0x0003 was ignored, but still notifying listeners of focus
2024-02-10 16:23:53.125 -05:00 [DBG] WindowManager:381              [OnWindowFocused]              Window focused: 
2024-02-10 16:23:53.125 -05:00 [DBG] MonitorManager:78              [OnWindowFocused]              Focusing hwnd 0x00000000
2024-02-10 16:23:53.125 -05:00 [DBG] MonitorManager:89              [OnWindowFocused]              Setting active monitor to Monitor[Bounds=(X: 0, Y: 0, Width: 3840, Height: 2160) WorkingArea=(X: 0, Y: 0, Width: 3840, Height: 2160) Name=DISPLAY ScaleFactor=150 IsPrimary=True]
2024-02-10 16:23:53.125 -05:00 [DBG] ButlerEventHandlers:120        [OnWindowFocused]              Window focused: 
2024-02-10 16:23:53.125 -05:00 [DBG] FocusIndicatorPlugin:137       [Hide]                         Hiding focus indicator
2024-02-10 16:23:53.125 -05:00 [DBG] NativeManager:59               [HideWindow]                   Hiding window HWND 0x00D60A48
2024-02-10 16:23:53.125 -05:00 [DBG] DeferWindowPosManager:62       [RecoverLayout]                Attempting to recover layout
2024-02-10 16:23:53.125 -05:00 [DBG] DeferWindowPosManager:71       [RecoverLayout]                No windows to recover layout for
2024-02-10 16:23:53.125 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x00010100
2024-02-10 16:23:53.125 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x000100F8
2024-02-10 16:23:53.126 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x000100F4
2024-02-10 16:23:53.126 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x00010100
2024-02-10 16:23:53.126 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x000100F8
2024-02-10 16:23:53.126 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x01E60C54
2024-02-10 16:23:53.126 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x01E60C54
2024-02-10 16:23:53.126 -05:00 [DBG] WindowManager:288              [WinEventProc]                 Windows event 0x800B for Dropbox (explorer) [2856] <CabinetWClass> {0x00230FD4}
2024-02-10 16:23:53.126 -05:00 [DBG] WindowManager:559              [OnWindowMoved]                Window moved: Dropbox (explorer) [2856] <CabinetWClass> {0x00230FD4}
2024-02-10 16:23:53.126 -05:00 [DBG] DeferWindowPosManager:62       [RecoverLayout]                Attempting to recover layout
2024-02-10 16:23:53.126 -05:00 [DBG] DeferWindowPosManager:71       [RecoverLayout]                No windows to recover layout for
2024-02-10 16:23:53.126 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x01E60C54
2024-02-10 16:23:53.127 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x01E60C54
2024-02-10 16:23:53.127 -05:00 [DBG] WindowManager:288              [WinEventProc]                 Windows event 0x800B for Dropbox (explorer) [2856] <CabinetWClass> {0x00230FD4}
2024-02-10 16:23:53.127 -05:00 [DBG] WindowManager:559              [OnWindowMoved]                Window moved: Dropbox (explorer) [2856] <CabinetWClass> {0x00230FD4}
2024-02-10 16:23:53.127 -05:00 [DBG] DeferWindowPosManager:62       [RecoverLayout]                Attempting to recover layout
2024-02-10 16:23:53.127 -05:00 [DBG] DeferWindowPosManager:71       [RecoverLayout]                No windows to recover layout for
2024-02-10 16:23:53.135 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x00010100
2024-02-10 16:23:53.135 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x000100F8
2024-02-10 16:23:53.136 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x000100F4
2024-02-10 16:23:53.137 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x00010100
2024-02-10 16:23:53.137 -05:00 [DBG] WindowManager:330              [AddWindow]                    Adding window 0x000100F8
urob commented 8 months ago

Forgot to mention, running on current main including #828 (65676c6)

urob commented 8 months ago

Oops, the last two comments were meant for #821. This indeed seems to be fixed by #827 and #828.