Skip to content

Commit

Permalink
backport W2000
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed May 5, 2024
1 parent e44aa56 commit c8ead8f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/winmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ static COLORREF (WINAPI * pGetThemeSysColor)(HTHEME hth, int colid) = 0;
static HTHEME (WINAPI * pOpenThemeData)(HWND, LPCWSTR pszClassList) = 0;
static HRESULT (WINAPI * pCloseThemeData)(HTHEME) = 0;

static BOOL (WINAPI * pGetLayeredWindowAttributes)(HWND, COLORREF *, BYTE *, DWORD *) = 0;


#define dont_debug_guardpath

Expand Down Expand Up @@ -494,6 +496,8 @@ load_dwm_funcs(void)
(void *)GetProcAddress(user32, "SetWindowCompositionAttribute");
pSystemParametersInfo =
(void *)GetProcAddress(user32, "SystemParametersInfoW");
pGetLayeredWindowAttributes =
(void *)GetProcAddress(user32, "GetLayeredWindowAttributes");
}
if (uxtheme) {
DWORD win_version = GetVersion();
Expand Down Expand Up @@ -7682,10 +7686,10 @@ static int dynfonts = 0;
WINDOWINFO curr_wnd_info;
curr_wnd_info.cbSize = sizeof(WINDOWINFO);
GetWindowInfo(curr_wnd, &curr_wnd_info);
if (class_atom == curr_wnd_info.atomWindowType) {
if (class_atom == curr_wnd_info.atomWindowType && pGetLayeredWindowAttributes) {
bool layered = GetWindowLong(curr_wnd, GWL_EXSTYLE) & WS_EX_LAYERED;
BYTE b;
GetLayeredWindowAttributes(curr_wnd, 0, &b, 0);
pGetLayeredWindowAttributes(curr_wnd, 0, &b, 0);
bool hidden = layered && !b;
if (!hidden) {
all_hidden = false;
Expand Down Expand Up @@ -7730,10 +7734,14 @@ static int dynfonts = 0;
if (!manage_tab_hiding())
break;
}
else if (manage_tab_hiding() && class_atom == curr_wnd_info.atomWindowType) {
else if (manage_tab_hiding()
&& class_atom == curr_wnd_info.atomWindowType
&& pGetLayeredWindowAttributes
)
{
bool layered = GetWindowLong(curr_wnd, GWL_EXSTYLE) & WS_EX_LAYERED;
BYTE b;
GetLayeredWindowAttributes(curr_wnd, 0, &b, 0);
pGetLayeredWindowAttributes(curr_wnd, 0, &b, 0);
bool hidden = layered && !b;
//printf("check [%p] min %d %p hidden %d\n", wnd, currmin, curr_wnd, hidden);
//printf("[%p] layered %d attr %d hidden %d\n", wnd, layered, b, hidden);
Expand Down

0 comments on commit c8ead8f

Please sign in to comment.