A new style desktop shell for Windows 11: menu bar, Dock, Finder, Spotlight, Control Center and Liquid Glass, in native C++.
Rust
Title bars: no flash of the Windows buttons on restore and after zoom
Eternity070628ad7671cc63e4
diff --git a/src/janelas/macjanela.cpp b/src/janelas/macjanela.cppindex 22e8047..6bcf74a 100644--- a/src/janelas/macjanela.cpp+++ b/src/janelas/macjanela.cpp@@ -1503,6 +1503,9 @@ void ZoomShow(HWND h) { // a janela aparece de novo (fim da animação, ou segu// preta. Pinta antes de mostrar e de novo logo depois.if (in) { ApplyColors(in); PaintNC(in); }RedrawWindow(h, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);+ // a faixa (por cima dos botões do Windows do app) volta ANTES de a janela aparecer, já no tamanho novo, e espera um+ // quadro da tela; antes ela voltava depois e os botões do Windows piscavam por um instante+ if (in && in->transit && in->custom && in->filho) { in->transit = false; PlaceOverlay(in); DwmFlush(); in->transit = true; }BOOL off = FALSE; DwmSetWindowAttribute(h, 13 /*DWMWA_CLOAK*/, &off, sizeof(off));if (in) PaintNC(in);RedrawWindow(h, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);@@ -1882,6 +1885,9 @@ void PlaceOverlay(Info* in) {if (!in->overlay || in->transit) return;if (GetPropW(in->owner, L"MacJanelaPintando")) return; // aparecendo: a barra espera a janela pintarbool show = !(in->custom && in->recusa) && IsWindowVisible(in->owner) && !IsIconic(in->owner) && !Fullscreen(in->owner) && !controles::IsAlert(in->owner) && !TakenByShell(in->owner);+ // a faixa filha (dentro da janela do app) some e volta junto com a janela: minimizada, fica como está, e ao restaurar+ // já está lá (escondê-la e mostrá-la de novo depois fazia os botões do Windows piscarem)+ if (!show && in->filho && IsIconic(in->owner) && !(in->custom && in->recusa)) return;if (!show) { ShowWindow(in->overlay, SW_HIDE); if (in->minis) ShowWindow(in->minis, SW_HIDE); return; }Paint(in); // UpdateLayeredWindow já posiciona e redimensionaif (!IsWindowVisible(in->overlay)) { ShowWindow(in->overlay, SW_SHOWNOACTIVATE); KeepAbove(in); if (in->custom) Minis(in); }@@ -3196,9 +3202,11 @@ void CALLBACK UncloakShown(HWND h, UINT, UINT_PTR id, DWORD) { // função nomeOpenReveal(h);return;}- BOOL off = FALSE; DwmSetWindowAttribute(h, 13 /*DWMWA_CLOAK*/, &off, sizeof(off));DWORD_PTR ref = 0;- if (GetWindowSubclass(h, OwnerProc, SUBCLASS_ID, &ref) && ref) { Info* in = (Info*)ref; PlaceOverlay(in); UpdateShadow(in); KeepAbove(in); }+ Info* in0 = GetWindowSubclass(h, OwnerProc, SUBCLASS_ID, &ref) && ref ? (Info*)ref : nullptr;+ if (in0 && in0->custom && in0->filho) { PlaceOverlay(in0); DwmFlush(); } // a faixa antes da janela (sem piscar)+ BOOL off = FALSE; DwmSetWindowAttribute(h, 13 /*DWMWA_CLOAK*/, &off, sizeof(off));+ if (in0) { PlaceOverlay(in0); UpdateShadow(in0); KeepAbove(in0); }(void)id;}