Tags: stianhoiland/cmdtab
Tags
Refactor for Alt-G (toggle groupByApp) Adding Alt-G means that the switcher can drastically change its state mid-switching, so accommodations for this must be made - Move mouse pos reset from focus change -> resize - Move resize calls to keyboard hook - Remove UpdateSwitcher (and call UpdateApps/ResizeSwitcher/RedrawSwitcher individually) - Add Alt-G to toggle groupByApp As noted above, revert UpdateSwitcher from fbc252a - My hope was to centralize the call sequence, but this became to restrictive (maybe it was Alt-Q that motivated this revert?)
Maintenance & prevent undesired mouse selection - avoid compiler error about unused variable 'success' - declare callbacks early and don't pass them as arguments - code style (whitespace) - remove a redundant-ish foreground window check (looks like it doesn't cause any problems) - prevent accidental mouse selection - vertically extend mouse selection area of icons, for uSaBiLiTy
Maintenance, mouse support, and ultimate stuck key fix Highlights - Mouse support! (#6) - Now using a new technique to fix stuck keys and match Windows Alt-Tab behaviours (#4, #9) - Fix wrong window selection after using Alt-Q - If switching to window fails play unintrusive sound instead of show error message box (#21) - First step towards DPI awareness by adding manifest (#10, #13) - Dev: better support for non-MSVC and non-CMake envs (i.e. mingw-w64) Changelog - various code style changes (include style, conditionals, whitespace, comments, var names, return over break in case statements) - some newlines and file encoding changes - when switching fails play sound instead of show error message box - remove redundant Debug function - support stdout and attached debuggers for debug output (mingw gcc vs MSVC) - use GetLastActivePopup when calling SetForegroundWindow (hmm, why exactly?) - move ReceiveLastInputEvent down to cmdtab impl. - new config option for "askAutorun" - remove near-useless config option "restoreOnCancel" and RestorableWindow - add some more debug printing and don't key repeat debug hotkeys - split SelectNextWindow & SelectFirstWindow into *Window and *App variants - use new technique to avoid stuck mod keys and match Windows Alt-Tab behavior - new SendModKeysUp function called on (mod1Up || mod2Up) - skip injected mod keys up kbd hook messages - consume (mod1Up || mod2Up) kbd hook messages - call ReceiveLastInputEvent only on ShowSwitcher - fix selection bug after using Alt-Q - don't ReleaseDC in in OnWindowPaint (hmm, why?) - rename WindowProcedure to SwitcherWindowProcedure - rename "OnWindowEvent" functions to "OnSwitcherEvent" - mouse support! - fix hourglass mouse cursor - switch fallthrough in EventHookProcedure - remove WM_DESTROY - use build type Debug -> MinSizeRel in CMakeLists.txt - reword "run automatically as administrator" to "autorun as admin" in README.md - reword "run automatically on login" to "autorun on login" in README.md - fix locale info in .rc -- Thanks to @german-one for spotting this and contributing fixes! (#11, #13) - use .manifest: Currently implements UAC, Visual Styles, and DPI awareness - The manifest is required for updated visual styles on non-MSVC compilers - add a simple Makefile to support non-CMake builds
fix bug causing cmdtab to stop remembering new window activations fix crash when invoked with 0 windows remove show delay and "ignore minimized" non-feature change icon to vibrant blue to suit both light and dark themes ensure msgbox gets kbd focus some code cleanup remove comments
Activation order & much more, CMake build After much deliberation and study, cmdtab has been rebuilt to support true activation order. What's that you say? Doesn't cmdtab--the best macOS-style app/window switcher for Windows--already support that? Well, cmdtab has been overpromising and underdelivering this whole time. Previously cmdtab relied on the order that Windows gives its top-level windows in when the EnumWindows function is called, and that order is the Z-order. The Z-order and the activation order are in some circumstances different, and not so subtly at that. If you minimize a window it is sent to the bottom of the Z-order, and therefore, in versions of cmdtab prior to v1.5, that window would be displayed last in the cmdtab switcher, even if it was the window that was just in the foreground. Windows has no documented API for querying the activation order of desktop windows, only the Z-order. This has put me on the path to discover the best way to keep track of the activation order of windows. There are many possible solutions to this, each with merits, quirks, gotchas, both subtle and not. Especially minimizing any involvement with the going-ons of the Windows shell was a goal. Although in hindsight the solution in cmdtab is at once obvious, it was nevertheless arrived at only after considering what felt like every other possible solution. This gives me confidence, and the results speak for themselves. Coupled with fixes to seemingly inscrutable bugs regarding stuck keys and subtly mismatching behavior between Windows' stock Alt-Tab switcher and cmdtab, along with a near astronomical improvement in memory usage and window capacity (70% memory usage decrease and yet 3200% increase of window capacity!), as well as color theme awareness and rudimentary handling of pesky UWP windows, this is clearly the best version of cmdtab yet. It has taken close scrutiny of subtleties of the Win32 API to arrive here; the minutia of which knowledge is required to eek out the minimal surface area for a dead simple window switcher is surprisingly vast. But now the jank is gone. Go forth and enjoy finally knowing wtf is going on with your Windows desktop. Changes / highlights / improvements / fixes - this change log will have a lesser detail level than previously; everything is renamed and moved around - add resource info to cmdtab.exe - cmdtab.exe has a new (placeholder) icon - new build system CMake, instructions in README.md - get rid of cmdtab.h, put includes in cmdtab.c - remove bit array macros - experiment with windows.h NO* defines - specify comctl version with linker directive for prettier message dialog - reduce struct definitions from 9 to 3: string, app, config - use simplified typedefs & lowercase null - separate Win32 "wrappers" from cmdtab implementation - try out PascalCase - debug macro and print function -> Debug, Print, Error, Ask - use less intrusive "alt hack" (mouse input instead of kbd) - UWP handling (TODO icons) - slightly expanded IsAltTabWindow filter & default blacklist - use strsafe.h - fix crash caused by some apps' product name (#2) - PostMessage instead of SendMessage for window management functions - dark mode and accent color awareness - don't ShowWindow if already foreground - extensive logging - move bitmap resizing from draw function to resize function - put blacklist checking logic in separate function - complete restructure of window handling: linked_window_t[] -> app[] - massive memory usage reduction - impl persistent window activation order - measure performance of window handling - improve error handling of access failure on getting filepath - improve legibility of hwnd printing - combine and simplify print functions - complete restructure & simplification of selection handling - fix text alignment bug caused by not #including math.h - fix text alignment bias from right to left - fix stuck modifier keys - restructure keyboard hook procedure for maximum performance - fix alt key / window menu inconsistency compared to Windows Alt-Tab - impl select first app corner case when on bare desktop - impl Alt-Q to quit process - impl some debug hotkeys, Alt-B, Alt-F11, Alt-F12 - improve input passthrough / sink - rely on switcher being top-most window vs. active window - refactor WndProc & wWinMain
PreviousNext