Skip to content

armgit / WacOS

Public Imported from GitHub
0

A new style desktop shell for Windows 11: menu bar, Dock, Finder, Spotlight, Control Center and Liquid Glass, in native C++.

Rust

Issue #362: menu bar menus stay under their title with the Dock on the left

Eternity070628126a8f26254b
diff --git a/src/menu/context_menu.cpp b/src/menu/context_menu.cpp
index a971359..59f2e0e 100644
--- a/src/menu/context_menu.cpp
+++ b/src/menu/context_menu.cpp
@@ -840,7 +840,11 @@ static void OpenLevel(Session& s, std::vector<MItem>* items, POINT anchor, const
d = { wr.left + (LONG)(pk & 0xFFFF), wr.top + (LONG)((pk >> 16) & 0xFFFF), wr.left + (LONG)((pk >> 16 >> 16) & 0xFFFF), wr.top + (LONG)((pk >> 16 >> 16 >> 16) & 0xFFFF) };
if (IntersectRect(&x, &d, &mi.rcMonitor) && EqualRect(&x, &d)) { // na tela (oculto: fica fora dela)
int gap = (int)(4 * sc);
+ // issue #362: menu da barra de menus (raiz aberta logo abaixo do topo da tela) fica embaixo do título,
+ // como no Mac, por cima do Dock do lado. Andando para o lado do Dock, a maçã abria longe do ícone
+ bool daBarra = !parentWin && anchor.y - mi.rcMonitor.top < (LONG)(60 * sc);
if (d.right - d.left >= d.bottom - d.top) { if (d.top > (mi.rcMonitor.top + mi.rcMonitor.bottom) / 2) wa.bottom = std::min<LONG>(wa.bottom, d.top - gap); }
+ else if (daBarra) {}
else if (d.left < (mi.rcMonitor.left + mi.rcMonitor.right) / 2) wa.left = std::max<LONG>(wa.left, d.right + gap);
else wa.right = std::min<LONG>(wa.right, d.left - gap);
if (wa.bottom - wa.top < 200 || wa.right - wa.left < 200) wa = mi.rcWork; // não sobra lugar: como antes