Commit Graph

12 Commits

Author SHA1 Message Date
LGUG2Z
b96a302451 docs(readme): initial readme, license and sample config 2021-08-05 18:16:49 -07:00
LGUG2Z
0ca3320939 refactor(logging): make use of tracing::instrument 2021-08-05 13:46:22 -07:00
LGUG2Z
77aa4c0d21 feat(debug): track and hard-restore hwnds
This stores a constantly updated list of known HWNDs at
~/komorebi.hwnd.json which can be used to restore windows that may
disappear into a permanently hidden state during development using a new
'restore-windows' command with komorebic.
2021-08-05 11:36:07 -07:00
LGUG2Z
da8214cdc7 fix(wm): switch only to different workspaces
Previously a Show event when clicking Firefox tabs would trigger a
refocusing of monitors and workspaces every time for a known hwnd, which
meant that in practice, the tab would be taken out of the current window
and a new window would be created.

This commit ensures that the workspace switch is only done if it would
be to a different monitor/workspace combination.
2021-08-05 09:52:03 -07:00
LGUG2Z
73568922d5 fix(workspaces): let set_foreground_window fail
When hiding/restoring windows as part of workspace switching, calls to
SetForegroundWindow fail, and if they fail, other hidden windows get
lost forever in hidden mode when the error is returned up the call chain
using the ? operator.

This commit separates out the focus() calls from the loops restoring
windows when switching workspaces, and also ensures that calls to
SetForegroundWindow will log an error, but ultimately continue to the
end of the focus() function call.
2021-07-30 21:05:02 -07:00
LGUG2Z
b867db1900 fix(wm): switch to focused workspace
This commit fixes corruption of workspace state when clicking a link
brings to the foreground a window in a different workspace, and also
ensures that the workspace containing the window coming to the
foreground will be focused and switched to as part of the Show event.
2021-07-30 14:41:59 -07:00
LGUG2Z
230b534735 feat(wm): add query command to cli
Added a query command to komorebic to return the WindowManager struct
serialized to JSON to help with debugging and maybe help others to build
tools like stackline for yabai in the future.
2021-07-30 14:11:09 -07:00
LGUG2Z
793ba51695 fix(wm): add settings to multi-window exes 2021-07-30 12:29:28 -07:00
LGUG2Z
8c939328d1 feat(wm): ensure workspace count
Allow the number of workspaces for a given monitor to be pre-created, so
that configuration options can be sent (name, padding, layout) before
the workspace has ever been activated.
2021-07-30 12:06:31 -07:00
LGUG2Z
d8a717950c fix(wm): unmanage multi-window exes on hide
Looks like explorer.exe is not the only one. Making the comparison
against a list instead.
2021-07-30 10:59:23 -07:00
LGUG2Z
b0c3480262 fix(wm): float/monocle toggle, invisible borders
This commit fixes issues with toggling on and off Monocle and Floating
Window mode by ensuring that the relevant windows are always at the top
of the Z order, and in the latter case, ensuring that the top visible
window is used to search the local floating window state of the process.

After some experimenting I seem to have been able to adjust to remove
all of the invisible window borders by default, so if desired, a user
can now have no gaps at all.

Also upgraded to the latest version of the windows-rs crate since I saw
it was available. Thankfully no breaking changes.
2021-07-30 10:44:31 -07:00
LGUG2Z
61cee458a1 feat(wm): initial commit
One week of blissful, in-the-zone coding, applying all of the lessons
learnt from the development of yatta.
2021-07-29 16:23:42 -07:00