Skip to content

Commit

Permalink
Fixed titlebar quirks.
Browse files Browse the repository at this point in the history
Chrome and Brave no longer have quirky titlebars.
  • Loading branch information
peddamat committed Jun 11, 2022
1 parent 31430f5 commit 5dd4c16
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/modules/fancyzones/FancyZonesHook/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,31 @@ LRESULT CALLBACK hookWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lP
}
break;

case WM_NCCALCSIZE:
{
if (wParam)
{
if (IsZoomed(window))
{
auto ncParams = reinterpret_cast<NCCALCSIZE_PARAMS*>(lParam);
auto rgrcs = reinterpret_cast<RECT*>(ncParams->rgrc);
// I have no clue why this works, but it prevents Chrome and Brave's
// titlebars from quirking, while also allowing GitKraken's titlebar
// to not disappear...
auto r2 = rgrcs[1];
auto r3 = rgrcs[2];
if (r2.top == r3.top)
{
return 0 | WVR_REDRAW;
}
}
}
else
{
auto b = reinterpret_cast<RECT*>(lParam);
}
}
break;
/**
* WM_DESTROY events are generated when the user closes an application
* window. If this happens, we need to...
Expand Down

0 comments on commit 5dd4c16

Please sign in to comment.