Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wm): correct use of z-order flags
We had been setting managed windows to HWND_TOPMOST which is a sticky and viral parameter. This was also the cause of the border window ending up behind other windows in an undesirable fashion, as even though it was marked WS_EX_TOPMOST, we were then having to mark it HWND_NOTOPTMOST when raising it to avoid it ending up drawing over other windows. Since we've fixed the border window to no longer be visible when unmanaged windows are focused, we can now set the border window to HWND_TOP when we reposition, which will ensure it's drawing in the order that we want. Now we also set managed windows only to HWND_TOP, rather than HWND_TOPMOST which stops us from incorrectly reordering internal concerns vs. child windows and owned windows that we're not managing. Windows are still brought to the foreground as expected/desired, but they're no longer 'sticking' there, nor are they drawing over the border window. This change does have a slight transition behavior as it initially rolls out, as prior versions of the Komorebi have been setting HWND_TOPMOST, which as a sticky parameter won't be cleared until the application or host system removes that flag. This means that the final z-order behavior will come good eventually. To immediately see the correct results, restarting affected apps or logging out / in will do. Unfortuantely we can't just set HWND_NOTTOPMOST, as similarly to setting HWND_TOPMOST, this can cause issues with an applications intended owned-window Z-Ordering - mostly affecting toolwindows and child windows, such as file dialogs, toolbars and so on, most of which we do not manage.
- Loading branch information