mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-11 07:32:51 +02:00
fix(komorebi): don't raise the border window to top
This trades one issue for another, in order of importance: - Pop-up windows such as a file upload dialog box for Firefox no longer have a window border drawn over the top - better. - Opaquely bordered windows without DWM decorations, combined with a -1 offset / single pixel border end up as invisible borders (e.g. EPIC Games Launcher).
This commit is contained in:
@@ -103,6 +103,7 @@ use windows::Win32::UI::WindowsAndMessaging::GWL_EXSTYLE;
|
|||||||
use windows::Win32::UI::WindowsAndMessaging::GWL_STYLE;
|
use windows::Win32::UI::WindowsAndMessaging::GWL_STYLE;
|
||||||
use windows::Win32::UI::WindowsAndMessaging::GW_HWNDNEXT;
|
use windows::Win32::UI::WindowsAndMessaging::GW_HWNDNEXT;
|
||||||
use windows::Win32::UI::WindowsAndMessaging::HWND_BOTTOM;
|
use windows::Win32::UI::WindowsAndMessaging::HWND_BOTTOM;
|
||||||
|
use windows::Win32::UI::WindowsAndMessaging::HWND_NOTOPMOST;
|
||||||
use windows::Win32::UI::WindowsAndMessaging::HWND_TOP;
|
use windows::Win32::UI::WindowsAndMessaging::HWND_TOP;
|
||||||
use windows::Win32::UI::WindowsAndMessaging::LWA_ALPHA;
|
use windows::Win32::UI::WindowsAndMessaging::LWA_ALPHA;
|
||||||
use windows::Win32::UI::WindowsAndMessaging::LWA_COLORKEY;
|
use windows::Win32::UI::WindowsAndMessaging::LWA_COLORKEY;
|
||||||
@@ -380,13 +381,19 @@ impl WindowsApi {
|
|||||||
SetWindowPosition::NO_ACTIVATE
|
SetWindowPosition::NO_ACTIVATE
|
||||||
};
|
};
|
||||||
|
|
||||||
// Always raise the border window to the top, but not overlapping
|
// TODO(raggi): This leaves the window behind the active window, which
|
||||||
// topmost windows, so that when it is a single-pixel inset border, it
|
// can result e.g. single pixel window borders being invisible in the
|
||||||
// always draws atop the window (i.e. support an offset of -1 that
|
// case of opaque window borders (e.g. EPIC Games Launcher). Ideally
|
||||||
// draws over the Windows 11 default translucent single pixel border,
|
// we'd be able to pass a parent window to place ourselves just in front
|
||||||
// while reamining visible in cases such as the EPIC Games launcher that
|
// of, however the SetWindowPos API explicitly ignores that parameter
|
||||||
// uses an opaque custom border).
|
// unless the window being positioned is being activated - and we don't
|
||||||
let position = HWND_TOP;
|
// want to activate the border window here. We can hopefully find a
|
||||||
|
// better workaround in the future.
|
||||||
|
// The trade-off chosen prevents the border window from sitting over the
|
||||||
|
// top of other pop-up dialogs such as a file picker dialog from
|
||||||
|
// Firefox. When adjusting this in the future, it's important to check
|
||||||
|
// those dialog cases.
|
||||||
|
let position = HWND_NOTOPMOST;
|
||||||
Self::set_window_pos(hwnd, layout, position, flags.bits())
|
Self::set_window_pos(hwnd, layout, position, flags.bits())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user