A new style desktop shell for Windows 11: menu bar, Dock, Finder, Spotlight, Control Center and Liquid Glass, in native C++.
Rust
Fix issues #40, #29 and #24
Eternity07062891beb5e21372
diff --git a/docs/registro-mudancas.txt b/docs/registro-mudancas.txtindex 59d5f60..1630a44 100644--- a/docs/registro-mudancas.txt+++ b/docs/registro-mudancas.txt@@ -1575,3 +1575,31 @@ Compilado (tudo), instalado, Shell e reserva do Finder reiniciados às 23:07 semNÃO testado: o login com o WacOS no lugar do Explorador (exige sair da conta), o evento de brilho de verdade (PC de mesa), umachamada real ao Gemini/Groq/OpenAI (sem chave aqui).DESFAZER: reverter o commit.++[2026-11-23 15:00, hora do PC] Issues #40, #29 e #24 (depois da build-34).+ - Cantos Ativos "abre e fecha na hora" (#40): src/menu/context_menu.cpp: os Ajustes abrem o menu no apertar; perto da borda de+ baixo ele abre para cima, por cima do ponteiro, e o soltar do mesmo clique escolhia o item embaixo. O soltar até 0,5 s depois+ de abrir, sem o ponteiro andar mais de 3 px, não escolhe nada (vale para todos os menus).+ - Wi-Fi "não conectado" estando conectado (#40): src/shell/menubar.cpp e central.cpp: desde o Windows 11 24H2 o nome da rede só+ sai com a permissão de localização; a consulta falhava e isso virava "não conectado". Conectado agora é o estado da placa; sem+ o nome aparece "Conectado". O nome passa a ser lido como UTF-8 (acentos).+ - Launchpad com pacotes do sistema (#40): src/shell/launchpad.cpp: "Esconder as ferramentas do Windows" (launchpad_sem_sistema)+ passa a vir ligado e também tira os pacotes do próprio Windows (_cw5n1h2txyewy: Click to Do, Introdução, Backup do Windows,+ Configurações).+ - Barra de tarefas do Windows "aparece às vezes" (#40): src/shell/main.cpp: um gancho EVENT_OBJECT_SHOW esconde na hora a barra que+ o Explorador mostrar de novo (antes só o tique de 1 s).+ - Maximizar pulando para dentro e fora da barra (#24): src/shell/limites.cpp: apps de barra própria maximizados passam a borda+ invisível de redimensionar (~8-11 px) de propósito; isso contava como "por cima da barra" e a correção brigava com o app.+ Agora só corrige quem passa mais que essa borda.+ - Ajustes sem barra de rolagem (#29): src/ajustes/main.cpp: o indicador fino do Mac aparece ao rolar e some 0,9 s depois.+ - Pedidos do #40: "Ocultar e mostrar a barra de menus automaticamente" (barra_ocultar, Ajustes > Central de Controle; a barra não+ reserva o topo e aparece com o ponteiro encostado no topo); "Tamanho dos ícones do Launchpad" (launchpad_icones: Grande,+ Médio, Pequeno; Ajustes > Mesa e Dock); Ilha desligada ou no estilo "Só quando houver algo": "Mostrar ao arrastar arquivos"+ (ilha_arrastar, padrão ligado): com o botão apertado e andando, uma faixa invisível no lugar do notch recebe o arquivo e a+ Ilha abre na Estante (src/shell/ilha.cpp, revelar.cpp avisa apertar/soltar).+ Traduções nos 11 idiomas. Compilação completa e instalação.+ Testado: janela sem moldura do Electron maximizada ficou parada (5 leituras, nenhuma correção no log); a barra some e a área de+ trabalho vai até o topo com barra_ocultar=1 e volta ao desligar (ajustes.txt devolvido igual); a página da Central de Controle+ com a opção nova (foto). NÃO testado: o menu dos Cantos (precisa clicar), o Wi-Fi (PC com cabo), a barra aparecendo com o+ ponteiro no topo, o arrastar até a Ilha, a barra de rolagem (precisa rolar), a barra do Windows reaparecendo.+ DESFAZER: reverter o commit.diff --git a/src/ajustes/main.cpp b/src/ajustes/main.cppindex 94d31c0..6125db7 100644--- a/src/ajustes/main.cpp+++ b/src/ajustes/main.cpp@@ -42,7 +42,11 @@ const float SEARCH_H = 28, ACCOUNT_H = 50;const float PAD = 20, GROUP_R = 8, GROUP_GAP = 11;float ROW_H = 38;const UINT WM_APP_REBUILD = WM_APP + 1, WM_APP_BITMAP = WM_APP + 2;-const UINT_PTR T_REFRESH = 1, T_ANIM = 2, T_CARET = 3, T_FRENTE = 4; // T_FRENTE: vem para a frente depois de aparecer+const UINT_PTR T_REFRESH = 1, T_ANIM = 2, T_CARET = 3, T_FRENTE = 4, T_BARRA = 5; // T_FRENTE: vem para a frente depois de aparecer+// Indicador de rolagem do Mac (issue #29: "a barra de rolagem nem sempre aparece"; não havia nenhuma): aparece ao rolar+// e some 0,9 s depois da última rolagem+DWORD g_barraAte = 0;+float MaxScroll();HWND g_hwnd;HINSTANCE g_inst;@@ -138,13 +142,13 @@ std::map<std::wstring, std::wstring> g_settings;void Invalidate() { if (g_hwnd) InvalidateRect(g_hwnd, nullptr, FALSE); }double Qpf() { static LARGE_INTEGER f{}; if (!f.QuadPart) QueryPerformanceFrequency(&f); return (double)f.QuadPart; }// medida da rolagem (log "rolagem: ..."): quadros, tempo e quanto custa desenhar um quadro-struct Rolagem { bool on = false; int n = 0; double soma = 0, pior = 0, parte[6]{}; LARGE_INTEGER ini{}, ult{}; } g_rol;-// partes do quadro (diagnóstico da rolagem, issue #29): 0 conteúdo, 1 cena desfocada, 2 barra lateral e resto, 3 EndDraw, 4 Present-static LARGE_INTEGER g_marca;+struct Rolagem { bool on = false; int n = 0; double soma = 0, pior = 0, parte[6]{}; LARGE_INTEGER ini{}, ult{}; } g_rol;+// partes do quadro (diagnóstico da rolagem, issue #29): 0 conteúdo, 1 cena desfocada, 2 barra lateral e resto, 3 EndDraw, 4 Present+static LARGE_INTEGER g_marca;static void Marca(int k) { LARGE_INTEGER t; QueryPerformanceCounter(&t); if (g_rol.on && k >= 0) g_rol.parte[k] += (t.QuadPart - g_marca.QuadPart) * 1000.0 / Qpf(); g_marca = t; }-D2D1_POINT_2F ToDip(int x, int y) { return { x / g_scale, y / g_scale }; }-// A rolagem desenhada em pixel inteiro da tela. Com o passo a cada quadro do monitor (build-30), o deslocamento caía-// em frações de pixel diferentes a cada quadro e o texto e as miniaturas da Aparência tremiam (issue #8, 22/11/2026).+D2D1_POINT_2F ToDip(int x, int y) { return { x / g_scale, y / g_scale }; }+// A rolagem desenhada em pixel inteiro da tela. Com o passo a cada quadro do monitor (build-30), o deslocamento caía+// em frações de pixel diferentes a cada quadro e o texto e as miniaturas da Aparência tremiam (issue #8, 22/11/2026).float RoloPx() { return std::round(g_scroll * g_scale) / g_scale; }bool In(const D2D1_RECT_F& r, D2D1_POINT_2F p) { return p.x >= r.left && p.x < r.right && p.y >= r.top && p.y < r.bottom; }D2D1_SIZE_F ClientDip() { RECT rc; GetClientRect(g_hwnd, &rc); return { rc.right / g_scale, rc.bottom / g_scale }; }@@ -1781,6 +1785,12 @@ void Render() {aj::Text(c, g_page.title, D2D1::RectF(SIDE_W + (g_tahoe ? 94 : 88), 0, s.width - 20, 50), g_tfTitle, pal.text);if (g_tahoe && !Golden()) tahoe::Panel(dc, br, PanelRect(s.height), PanelR(), g_dark); // Golden Gate: sem painel flutuante+ if (float maxS = MaxScroll(); maxS > 0 && GetTickCount() < g_barraAte && !g_sheet.open) {+ float top = TOOL_H + 4, bot = s.height - 6, h = bot - top;+ float bh = std::max(28.f, h * h / (h + maxS)), by = top + (h - bh) * std::clamp(g_scroll / maxS, 0.f, 1.f);+ br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.38f) : D2D1::ColorF(0, 0, 0, 0.35f));+ dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(s.width - 9, by, s.width - 4, by + bh), 2.5f, 2.5f), br);+ }DrawSidebar(c, pal, s.height);if (g_sheet.open) { g_hits.clear(); DrawSheet(c, pal); }if (winClip) { dc->PopLayer(); tahoe::WindowRim(dc, br, s, winR, g_dark); }@@ -2003,11 +2013,11 @@ LRESULT CALLBACK WndProc(HWND h, UINT m, WPARAM w, LPARAM l) {g_quadroPendente = false;if (!g_relogio) return 0;WndProc(h, WM_TIMER, T_ANIM, 0); // o mesmo passo do temporizador- if (GetUpdateRect(h, nullptr, FALSE)) { // desenha já, neste quadro- LARGE_INTEGER a, b; QueryPerformanceCounter(&a);- Render(); ValidateRect(h, nullptr);- QueryPerformanceCounter(&b);- if (g_rol.on) { double ms = (b.QuadPart - a.QuadPart) * 1000.0 / Qpf(); g_rol.n++; g_rol.soma += ms; g_rol.pior = std::max(g_rol.pior, ms); }+ if (GetUpdateRect(h, nullptr, FALSE)) { // desenha já, neste quadro+ LARGE_INTEGER a, b; QueryPerformanceCounter(&a);+ Render(); ValidateRect(h, nullptr);+ QueryPerformanceCounter(&b);+ if (g_rol.on) { double ms = (b.QuadPart - a.QuadPart) * 1000.0 / Qpf(); g_rol.n++; g_rol.soma += ms; g_rol.pior = std::max(g_rol.pior, ms); }}return 0;}@@ -2093,6 +2103,7 @@ LRESULT CALLBACK WndProc(HWND h, UINT m, WPARAM w, LPARAM l) {if (pt.x / g_scale < SIDE_W) g_sideScroll = std::clamp(g_sideScroll + d, 0.f, SideMaxScroll());else {g_scrollTarget = std::clamp(g_scrollTarget + d, 0.f, MaxScroll());+ g_barraAte = GetTickCount() + 900; SetTimer(h, T_BARRA, 950, nullptr);if (!g_rol.on) { g_rol = {}; g_rol.on = true; QueryPerformanceCounter(&g_rol.ini); g_rol.ult = g_rol.ini; }LigaRelogio(h);}@@ -2101,6 +2112,7 @@ LRESULT CALLBACK WndProc(HWND h, UINT m, WPARAM w, LPARAM l) {}case WM_TIMER:if (w == T_SLIDE) { FlushSlide(); return 0; }+ if (w == T_BARRA) { KillTimer(h, T_BARRA); Invalidate(); return 0; } // o indicador de rolagem someif (w == T_FRENTE) { // já à mostra (o Shell terminou a animação de abrir): para a frente de verdadeKillTimer(h, T_FRENTE);if (GetForegroundWindow() != h) { LiberaFrente(); SetForegroundWindow(h); }@@ -2131,7 +2143,7 @@ LRESULT CALLBACK WndProc(HWND h, UINT m, WPARAM w, LPARAM l) {g_rol.parte[0] / q, g_rol.parte[1] / q, g_rol.parte[2] / q, g_rol.parte[3] / q, g_rol.parte[4] / q);g_rol.on = false;}- if (g_scroll == g_scrollTarget) g_relogio = false; // chegou: a thread do ritmo para+ if (g_scroll == g_scrollTarget) g_relogio = false; // chegou: a thread do ritmo paraif (g_scroll == g_scrollTarget && g_toggleAnim.empty()) KillTimer(h, T_ANIM);Invalidate();} else if (w == T_CARET) {diff --git a/src/ajustes/paginas.cpp b/src/ajustes/paginas.cppindex 00f1424..f3718ac 100644--- a/src/ajustes/paginas.cpp+++ b/src/ajustes/paginas.cpp@@ -1590,7 +1590,12 @@ Page CentralControle() {[](bool v) { SetSetting(L"barra_embaixo", v ? L"1" : L"0"); },L"Os menus ficam à esquerda do Dock e os ícones e o relógio à direita. Precisa do Dock embaixo, no monitor principal; não vale no tema Leopard.");baixo.icon = 0xE90E; baixo.iconColor = C_GRAY;- p.groups.push_back(G({ clock, baixo, todos, priv }));+ // issue #40: como no Mac, a barra some e as janelas usam o topo da tela; aparece com o ponteiro no topo+ Row ocultar = Toggle(L"Ocultar e mostrar a barra de menus automaticamente", [] { return Setting(L"barra_ocultar", L"0") == L"1"; },+ [](bool v) { SetSetting(L"barra_ocultar", v ? L"1" : L"0"); },+ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.");+ ocultar.icon = 0xE8A7; ocultar.iconColor = C_GRAY;+ p.groups.push_back(G({ clock, ocultar, baixo, todos, priv }));return p;}@@ -1614,6 +1619,10 @@ Page IlhaDinamica() {ilha.push_back(Toggle(L"Avisar “Copiado” ao copiar", on(L"ilha_copiado", L"1"), set(L"ilha_copiado"),L"Um aviso rápido na ilha quando você copia um texto, uma imagem ou arquivos."));}+ // issue #40: com a ilha desligada (ou no estilo "Só quando houver algo"), aparece na Estante ao arrastar um arquivo até o topo+ if (Setting(L"ilha", L"0") != L"1" || Setting(L"ilha_estilo", L"notch") == L"notificacao")+ ilha.push_back(Toggle(L"Mostrar ao arrastar arquivos", on(L"ilha_arrastar", L"1"), set(L"ilha_arrastar"),+ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra."));p.groups.push_back(G(ilha, L"Ilha Dinâmica"));if (Setting(L"ilha", L"0") == L"1")p.groups.push_back(G({ Note(L"Na ilha também ficam a bolinha laranja (microfone) ou verde (câmera) em uso, o timer (aba Timer: pausar, parar, ±1 minuto) e o histórico do que você copiou (aba Transferência).") }));@@ -1659,7 +1668,11 @@ Page PersonalizarDock() {p.groups.push_back(G({ raio, cor, opac }, L"Fundo"));Row ind = Popup(L"Indicador de app aberto", { L"Ponto", L"Traço" }, [] { return Setting(L"dock_indicador", L"ponto") == L"traco" ? 1 : 0; },[](int i) { SetSetting(L"dock_indicador", i == 1 ? L"traco" : L"ponto"); });- p.groups.push_back(G({ Flag(L"Mostrar o Launchpad", L"dock_launchpad", L"1"), Flag(L"Mostrar a divisória", L"dock_separador", L"1"),+ // issue #40: ícones do Launchpad menores (a grade continua a mesma)+ Row lpIcones = Popup(L"Tamanho dos ícones do Launchpad", { L"Grande", L"Médio", L"Pequeno" },+ [] { double v = _wtof(Setting(L"launchpad_icones", L"1").c_str()); return v < 0.78 ? 2 : v < 0.93 ? 1 : 0; },+ [](int i) { SetSetting(L"launchpad_icones", i == 2 ? L"0.7" : i == 1 ? L"0.85" : L"1"); });+ p.groups.push_back(G({ Flag(L"Mostrar o Launchpad", L"dock_launchpad", L"1"), lpIcones, Flag(L"Mostrar a divisória", L"dock_separador", L"1"),Flag(L"Mostrar o nome ao passar o ponteiro", L"dock_rotulos", L"1"), ind,Flag(L"Mostrar indicadores de aplicativos abertos", L"indicadores", L"1"),Flag(L"Animar aplicativos ao abrir", L"animar_abertura", L"1"),diff --git a/src/comum/idioma_de.inc b/src/comum/idioma_de.incindex 5af119c..00155f9 100644--- a/src/comum/idioma_de.inc+++ b/src/comum/idioma_de.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"Denke nach" },{ L"Perguntar à Siri: “", L"Siri fragen: „" },{ L"Médio", L"Mittel" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"Menüleiste automatisch aus- und einblenden" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"Fenster nutzen den ganzen Bildschirm. Bewege den Zeiger an den oberen Bildschirmrand, um die Menüleiste einzublenden." },+{ L"Tamanho dos ícones do Launchpad", L"Größe der Launchpad-Symbole" },+{ L"Mostrar ao arrastar arquivos", L"Beim Ziehen von Dateien anzeigen" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"Ziehe eine Datei an den oberen Bildschirmrand, und die Insel öffnet sich im Regal, auch wenn sie sonst nicht angezeigt wird." },diff --git a/src/comum/idioma_en.inc b/src/comum/idioma_en.incindex 0dac44b..0dd9980 100644--- a/src/comum/idioma_en.inc+++ b/src/comum/idioma_en.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"Thinking" },{ L"Perguntar à Siri: “", L"Ask Siri: “" },{ L"Médio", L"Medium" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"Automatically hide and show the menu bar" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"Windows use the whole screen. Move the pointer to the top of the screen to show the menu bar." },+{ L"Tamanho dos ícones do Launchpad", L"Launchpad icon size" },+{ L"Mostrar ao arrastar arquivos", L"Show when dragging files" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"Drag a file to the top of the screen and the island opens on the Shelf, even when it is not always shown." },diff --git a/src/comum/idioma_es.inc b/src/comum/idioma_es.incindex 4372975..6dd605b 100644--- a/src/comum/idioma_es.inc+++ b/src/comum/idioma_es.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"Pensando" },{ L"Perguntar à Siri: “", L"Preguntar a Siri: “" },{ L"Médio", L"Mediano" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"Ocultar y mostrar la barra de menús automáticamente" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"Las ventanas usan toda la pantalla. Lleva el puntero a la parte superior de la pantalla para que aparezca la barra." },+{ L"Tamanho dos ícones do Launchpad", L"Tamaño de los iconos de Launchpad" },+{ L"Mostrar ao arrastar arquivos", L"Mostrar al arrastrar archivos" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"Arrastra un archivo a la parte superior de la pantalla y la isla se abre en el Estante, aunque no esté siempre visible." },diff --git a/src/comum/idioma_fr.inc b/src/comum/idioma_fr.incindex 0c2095b..e3ed436 100644--- a/src/comum/idioma_fr.inc+++ b/src/comum/idioma_fr.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"Réflexion" },{ L"Perguntar à Siri: “", L"Demander à Siri : « " },{ L"Médio", L"Moyen" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"Masquer et afficher automatiquement la barre des menus" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"Les fenêtres utilisent tout l'écran. Placez le pointeur en haut de l'écran pour afficher la barre." },+{ L"Tamanho dos ícones do Launchpad", L"Taille des icônes du Launchpad" },+{ L"Mostrar ao arrastar arquivos", L"Afficher en faisant glisser des fichiers" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"Faites glisser un fichier en haut de l'écran et l'îlot s'ouvre sur l'Étagère, même s'il n'est pas toujours affiché." },diff --git a/src/comum/idioma_it.inc b/src/comum/idioma_it.incindex 9bff81e..53100dd 100644--- a/src/comum/idioma_it.inc+++ b/src/comum/idioma_it.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"Sto pensando" },{ L"Perguntar à Siri: “", L"Chiedi a Siri: “" },{ L"Médio", L"Medio" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"Nascondi e mostra automaticamente la barra dei menu" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"Le finestre usano tutto lo schermo. Porta il puntatore in cima allo schermo per mostrare la barra." },+{ L"Tamanho dos ícones do Launchpad", L"Dimensione delle icone di Launchpad" },+{ L"Mostrar ao arrastar arquivos", L"Mostra trascinando file" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"Trascina un file in cima allo schermo e l'isola si apre sullo Scaffale, anche quando non è sempre visibile." },diff --git a/src/comum/idioma_ja.inc b/src/comum/idioma_ja.incindex c1d7f61..02472a6 100644--- a/src/comum/idioma_ja.inc+++ b/src/comum/idioma_ja.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"考え中" },{ L"Perguntar à Siri: “", L"Siri に聞く:「" },{ L"Médio", L"中" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"メニューバーを自動的に隠す/表示" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"ウインドウが画面全体を使います。ポインタを画面の上端に移動するとメニューバーが表示されます。" },+{ L"Tamanho dos ícones do Launchpad", L"Launchpad のアイコンサイズ" },+{ L"Mostrar ao arrastar arquivos", L"ファイルをドラッグしたときに表示" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"ファイルを画面の上端までドラッグすると、常に表示していなくてもアイランドがシェルフで開きます。" },diff --git a/src/comum/idioma_ko.inc b/src/comum/idioma_ko.incindex aa17576..6d0772a 100644--- a/src/comum/idioma_ko.inc+++ b/src/comum/idioma_ko.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"생각 중" },{ L"Perguntar à Siri: “", L"Siri에게 묻기: “" },{ L"Médio", L"중간" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"메뉴 막대 자동으로 가리기 및 보기" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"윈도우가 화면 전체를 사용합니다. 포인터를 화면 맨 위로 옮기면 메뉴 막대가 나타납니다." },+{ L"Tamanho dos ícones do Launchpad", L"Launchpad 아이콘 크기" },+{ L"Mostrar ao arrastar arquivos", L"파일을 드래그할 때 보기" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"파일을 화면 맨 위로 드래그하면 항상 표시되지 않을 때에도 아일랜드가 선반에서 열립니다." },diff --git a/src/comum/idioma_pl.inc b/src/comum/idioma_pl.incindex d6c0fa2..3711d53 100644--- a/src/comum/idioma_pl.inc+++ b/src/comum/idioma_pl.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"Myślę" },{ L"Perguntar à Siri: “", L"Zapytaj Siri: „" },{ L"Médio", L"Średni" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"Automatycznie ukrywaj i pokazuj pasek menu" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"Okna zajmują cały ekran. Przesuń wskaźnik na górę ekranu, aby pokazać pasek menu." },+{ L"Tamanho dos ícones do Launchpad", L"Rozmiar ikon Launchpada" },+{ L"Mostrar ao arrastar arquivos", L"Pokazuj podczas przeciągania plików" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"Przeciągnij plik na górę ekranu, a wyspa otworzy się na Półce, nawet gdy nie jest stale widoczna." },diff --git a/src/comum/idioma_ru.inc b/src/comum/idioma_ru.incindex 5b9050c..aac00cf 100644--- a/src/comum/idioma_ru.inc+++ b/src/comum/idioma_ru.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"Думаю" },{ L"Perguntar à Siri: “", L"Спросить Siri: «" },{ L"Médio", L"Средний" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"Автоматически скрывать и показывать строку меню" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"Окна занимают весь экран. Наведите указатель на верх экрана, чтобы показать строку меню." },+{ L"Tamanho dos ícones do Launchpad", L"Размер значков Launchpad" },+{ L"Mostrar ao arrastar arquivos", L"Показывать при перетаскивании файлов" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"Перетащите файл к верху экрана, и остров откроется на Полке, даже если он не показан постоянно." },diff --git a/src/comum/idioma_tr.inc b/src/comum/idioma_tr.incindex c1e2808..5b84044 100644--- a/src/comum/idioma_tr.inc+++ b/src/comum/idioma_tr.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"Düşünüyor" },{ L"Perguntar à Siri: “", L"Siri'ye sor: “" },{ L"Médio", L"Orta" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"Menü çubuğunu otomatik olarak gizle ve göster" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"Pencereler tüm ekranı kullanır. Menü çubuğunu göstermek için imleci ekranın üstüne götürün." },+{ L"Tamanho dos ícones do Launchpad", L"Launchpad simge boyutu" },+{ L"Mostrar ao arrastar arquivos", L"Dosya sürüklerken göster" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"Bir dosyayı ekranın üstüne sürükleyin; ada her zaman görünmese bile Raf açık olarak görünür." },diff --git a/src/comum/idioma_zh.inc b/src/comum/idioma_zh.incindex eac2a84..f26eec7 100644--- a/src/comum/idioma_zh.inc+++ b/src/comum/idioma_zh.inc@@ -1669,3 +1669,8 @@{ L"Pensando", L"正在思考" },{ L"Perguntar à Siri: “", L"询问 Siri:“" },{ L"Médio", L"中" },+{ L"Ocultar e mostrar a barra de menus automaticamente", L"自动隐藏和显示菜单栏" },+{ L"As janelas usam a tela inteira. Leve o ponteiro até o topo da tela para a barra aparecer.", L"窗口使用整个屏幕。将指针移到屏幕顶部即可显示菜单栏。" },+{ L"Tamanho dos ícones do Launchpad", L"启动台图标大小" },+{ L"Mostrar ao arrastar arquivos", L"拖移文件时显示" },+{ L"Arraste um arquivo até o topo da tela e a ilha aparece aberta na Estante, mesmo quando ela não fica à mostra.", L"将文件拖到屏幕顶部,即使岛未一直显示,也会在架子中打开。" },diff --git a/src/menu/context_menu.cpp b/src/menu/context_menu.cppindex cefa510..79b779d 100644--- a/src/menu/context_menu.cpp+++ b/src/menu/context_menu.cpp@@ -973,8 +973,16 @@ static void OnMouseMove(Session& s, int li, POINT pt) {}}+// O soltar do mesmo clique que abriu o menu (quem abre no apertar: os Ajustes) não escolhe nada. Perto da borda de+// baixo da tela o menu abre para cima, por cima do ponteiro, e o soltar escolhia o item que ficou embaixo dele: o menu+// "abria e fechava" sem dar para escolher (Cantos Ativos, issue #40). Como no Mac: só vale se o ponteiro andou.+static DWORD g_openTick; static POINT g_openPt;static void OnButtonUp(Session& s, int li, POINT pt) {Level& L = s.levels[li];+ if (li == 0 && GetTickCount() - g_openTick < 500 && abs(pt.x - g_openPt.x) <= 3 && abs(pt.y - g_openPt.y) <= 3) {+ Log(L" soltar do clique que abriu o menu: ignorado");+ return;+ }int i = HitItem(L, pt);Log(L" clique solto no nível %d, item %d", li, i);if (i < 0) return;@@ -1362,6 +1370,7 @@ static MItem* RunMenu(HWND owner, std::vector<MItem>& items, POINT pt) {g_plain = g_plainNext; g_plainNext = false;g_above = g_aboveNext; g_aboveNext = false;g_ses = &s;+ g_openTick = GetTickCount(); GetCursorPos(&g_openPt);OpenLevel(s, &items, pt, nullptr, 0);if (g_demo) { s.levels[0].hover = 2; Invalidate(s.levels[0]); }MSG msg;diff --git a/src/shell/central.cpp b/src/shell/central.cppindex bc11126..03a0e17 100644--- a/src/shell/central.cpp+++ b/src/shell/central.cpp@@ -405,10 +405,12 @@ std::wstring Ssid() {HANDLE h = nullptr; DWORD ver = 0;if (WlanOpenHandle(2, nullptr, &ver, &h) != ERROR_SUCCESS) return L"";std::wstring r;+ bool conectado = false; // sem a permissão de localização (Windows 11 24H2) o nome não sai, mas a placa diz que está conectadaPWLAN_INTERFACE_INFO_LIST list = nullptr;if (WlanEnumInterfaces(h, nullptr, &list) == ERROR_SUCCESS && list) {for (DWORD i = 0; i < list->dwNumberOfItems && r.empty(); i++) {if (list->InterfaceInfo[i].isState != wlan_interface_state_connected) continue;+ conectado = true;DWORD sz = 0; PWLAN_CONNECTION_ATTRIBUTES ca = nullptr; WLAN_OPCODE_VALUE_TYPE t;if (WlanQueryInterface(h, &list->InterfaceInfo[i].InterfaceGuid, wlan_intf_opcode_current_connection, nullptr, &sz, (PVOID*)&ca, &t) == ERROR_SUCCESS && ca) {auto& s = ca->wlanAssociationAttributes.dot11Ssid;@@ -422,6 +424,7 @@ std::wstring Ssid() {WlanFreeMemory(list);}WlanCloseHandle(h, nullptr);+ if (r.empty() && conectado) r = Tr(L"Conectado");return r;}diff --git a/src/shell/ilha.cpp b/src/shell/ilha.cppindex 79b9e11..6c330f9 100644--- a/src/shell/ilha.cpp+++ b/src/shell/ilha.cpp@@ -60,7 +60,16 @@ namespace {const UINT WM_IL_FRAME = WM_APP + 1, WM_IL_MEDIA = WM_APP + 2, WM_IL_CAPS = WM_APP + 3, WM_IL_PRIV = WM_APP + 4, WM_IL_DOWN = WM_APP + 5, WM_IL_BRI = WM_APP + 6;const UINT_PTR TM_HOVER = 1, TM_LEAVE = 2, TM_PEEK = 3, TM_HUD = 4, TM_EQ = 5, TM_PAUSE = 6, TM_GONE = 7, TM_TICK = 8, TM_STATS = 9, TM_CAPS = 10, TM_OLA = 11,- TM_FULL = 12; // conferência da tela cheia que ficou para depois (ilha::SetFullscreen)+ TM_FULL = 12, // conferência da tela cheia que ficou para depois (ilha::SetFullscreen)+ TM_ARRASTO = 13, TM_TEMPOFF = 14; // Ilha desligada: arrasto de arquivo até o topo (issue #40)+// Ilha desligada (ilha=0) e "Mostrar ao arrastar arquivos" ligado (ilha_arrastar, padrão 1): enquanto o botão do mouse+// está apertado e andando, uma faixa invisível (alfa 1) fica no lugar do notch. Com o mouse capturado por quem arrasta ela+// não pega clique nenhum; um arquivo arrastado até ela liga a Ilha por um tempo (g_temp), já aberta na Estante, e ela+// some de novo quando fecha.+const UINT WM_IL_BOTAO = WM_APP + 7;+HWND g_faixa;+bool g_temp;+POINT g_botaoEm;ULONGLONG g_fullChecado; // quando a tela cheia foi conferida (ilha::SetFullscreen)bool g_fullPendente;@@ -692,7 +701,42 @@ struct DropTarget : IDropTarget {if (!g_running) Paint();return S_OK;}-} g_dropTgt;+} g_dropTgt;++// a faixa invisível do arrasto: um arquivo chegando liga a Ilha na Estante e a faixa sai do caminho (o arrasto segue+// para a janela da Ilha, que fica embaixo)+struct FaixaTarget : IDropTarget {+ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID r, void** o) override {+ if (r == IID_IUnknown || r == IID_IDropTarget) { *o = this; return S_OK; }+ *o = nullptr; return E_NOINTERFACE;+ }+ ULONG STDMETHODCALLTYPE AddRef() override { return 2; }+ ULONG STDMETHODCALLTYPE Release() override { return 1; }+ HRESULT STDMETHODCALLTYPE DragEnter(IDataObject* d, DWORD k, POINTL p, DWORD* eff) override {+ FORMATETC fe{ CF_HDROP, nullptr, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };+ bool files = d && d->QueryGetData(&fe) == S_OK;+ *eff = files ? DROPEFFECT_COPY : DROPEFFECT_NONE;+ if (files && (!g_on || g_style == S_AVISO)) { // desligada, ou no estilo "Só quando houver algo"+ if (!g_on) g_temp = true;+ KillTimer(g_wnd, TM_TEMPOFF);+ Log(L"ilha: arquivo arrastado até o topo com a Ilha desligada: abre a Estante");+ g_dropTgt.DragEnter(d, k, p, eff);+ ShowWindow(g_faixa, SW_HIDE);+ }+ return S_OK;+ }+ HRESULT STDMETHODCALLTYPE DragOver(DWORD, POINTL, DWORD* eff) override { *eff = g_temp ? DROPEFFECT_COPY : DROPEFFECT_NONE; return S_OK; }+ HRESULT STDMETHODCALLTYPE DragLeave() override { return S_OK; }+ HRESULT STDMETHODCALLTYPE Drop(IDataObject* d, DWORD k, POINTL p, DWORD* eff) override { return g_dropTgt.Drop(d, k, p, eff); }+} g_faixaTgt;++void PoeFaixa() { // no lugar do notch, no topo do monitor principal+ MONITORINFO mi{ sizeof(mi) };+ if (!g_faixa || !GetMonitorInfoW(MonitorFromPoint({ 0, 0 }, MONITOR_DEFAULTTOPRIMARY), &mi)) return;+ float sc = ui::Scale(g_faixa);+ int w = (int)std::lround(320 * sc), hh = (int)std::lround(40 * sc), cx = (mi.rcMonitor.left + mi.rcMonitor.right) / 2;+ SetWindowPos(g_faixa, HWND_TOPMOST, cx - w / 2, mi.rcMonitor.top, w, hh, SWP_NOACTIVATE | SWP_SHOWWINDOW);+}// ================= Transferência// O histórico ficava só na memória: a cada vez que o Shell reiniciava sobrava só o que estava copiado agora ("fica@@ -829,6 +873,7 @@ float HeadH() { return Notch() ? g_barPt : 28.f; } // cabeçalho das abas (nofloat TopOff() { return Notch() ? 0.f : std::max(0.f, (g_barPt - PILL_H) / 2); }Mode Want() {+ if (!g_on && g_temp && !g_full) return g_openOn ? M_OPEN : M_HIDDEN; // ligada só para o arrasto (g_faixa)if (!g_on || g_full) return M_HIDDEN;if (g_peekOn) return M_PEEK;if (g_hudOn) return M_HUD;@@ -1883,6 +1928,12 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {return 0;}case WM_IL_CAPS: SetTimer(h, TM_CAPS, 40, nullptr); return 0;+ case WM_IL_BOTAO: // revelar.cpp (gancho do mouse): botão esquerdo apertado (w = 1) ou solto (w = 0)+ if (w && (!g_on || g_style == S_AVISO) && g_faixa && shell::Setting(L"ilha_arrastar", L"1") != L"0") {+ g_botaoEm = { GET_X_LPARAM(l), GET_Y_LPARAM(l) };+ SetTimer(h, TM_ARRASTO, 150, nullptr);+ } else if (!w) { KillTimer(h, TM_ARRASTO); if (g_faixa && IsWindowVisible(g_faixa)) ShowWindow(g_faixa, SW_HIDE); }+ return 0;case WM_IL_BRI: // brilho.cpp: o brilho da tela mudou (teclas do notebook, Windows); arrastando na Central não mostraif (g_on && g_volOn && !g_full && !g_peekOn && g_mode != M_OPEN && !central::IsOpen()) { g_bri = std::clamp((int)w, 0, 100) / 100.f; ShowHud(HUD_BRI, 1500); }return 0; // o Windows ainda não trocou o estado da tecla@@ -1920,7 +1971,15 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {case TM_CLIP: KillTimer(h, TM_CLIP); ReadClipboard(); if (g_mode == M_OPEN && g_tab == TAB_CLIP && !g_running) Paint(); break;case TM_EQ: StepBars(); if (!g_running) Paint(); UpdateTimers(); break;case TM_HOVER: KillTimer(h, TM_HOVER); if (g_hoverIn && g_mode != M_OPEN && g_mode != M_PEEK) { if (g_mode == M_TIMER) g_tab = TAB_TIMER; g_openOn = true; Update(); } break;- case TM_LEAVE: KillTimer(h, TM_LEAVE); if (!g_hoverIn && !g_dragIn) { Log(L"ilha: ponteiro saiu, fecha"); Close(); if (g_peekOn) SetTimer(h, TM_PEEK, 1500, nullptr); } break;+ case TM_LEAVE: KillTimer(h, TM_LEAVE); if (!g_hoverIn && !g_dragIn) { Log(L"ilha: ponteiro saiu, fecha"); Close(); if (g_peekOn) SetTimer(h, TM_PEEK, 1500, nullptr); if (g_temp) SetTimer(h, TM_TEMPOFF, 700, nullptr); } break;+ case TM_TEMPOFF: KillTimer(h, TM_TEMPOFF); if (g_temp && !g_openOn && !g_dragIn && !g_hoverIn) { g_temp = false; Update(); } break;+ case TM_ARRASTO: { // botão apertado: andou um pouco (arrasto) e ainda está apertado? A faixa espera o arquivo no topo+ bool ainda = GetAsyncKeyState(GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON) < 0;+ POINT p; GetCursorPos(&p);+ if (!ainda) { KillTimer(h, TM_ARRASTO); if (g_faixa) ShowWindow(g_faixa, SW_HIDE); break; }+ if (!IsWindowVisible(g_faixa) && (std::abs(p.x - g_botaoEm.x) > 12 || std::abs(p.y - g_botaoEm.y) > 12)) PoeFaixa();+ break;+ }case TM_PEEK: KillTimer(h, TM_PEEK); if (g_hoverIn && g_mode == M_PEEK) break; g_peekOn = false; g_peek = {}; Update(); break;case TM_HUD: KillTimer(h, TM_HUD); g_hudOn = false; Update(); break;case TM_PAUSE: KillTimer(h, TM_PAUSE); g_pauseHold = false; Update(); break;@@ -2104,6 +2163,13 @@ bool ilha::Create(HINSTANCE hi) {if (GetSystemPowerStatus(&ps) && !(ps.BatteryFlag & 128)) { g_hasBattery = true; g_batAC = ps.ACLineStatus == 1; g_batPct = ps.BatteryLifePercent; }ShelfLoad();RegisterDragDrop(g_wnd, &g_dropTgt);+ { // a faixa invisível do arrasto com a Ilha desligada (issue #40)+ WNDCLASSW fc{}; fc.lpfnWndProc = DefWindowProcW; fc.hInstance = hi; fc.lpszClassName = L"ShellIlhaArrasto";+ RegisterClassW(&fc);+ g_faixa = CreateWindowExW(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_LAYERED, fc.lpszClassName, L"", WS_POPUP,+ 0, 0, 10, 10, nullptr, nullptr, hi, nullptr);+ if (g_faixa) { SetLayeredWindowAttributes(g_faixa, 0, 1, LWA_ALPHA); RegisterDragDrop(g_faixa, &g_faixaTgt); apps::ours.push_back(g_faixa); }+ }Place();ilha::Reload();SetTimer(g_wnd, TM_OLA, 2500, nullptr); // o "olá" depois que a mesa assenta (issue #8)@@ -2240,6 +2306,8 @@ bool ilha::Volume(float level, bool mute) {void ilha::Brilho(int pct) { if (g_wnd) PostMessageW(g_wnd, WM_IL_BRI, (WPARAM)pct, 0); }+void ilha::BotaoMouse(bool down, POINT pt) { if (g_wnd) PostMessageW(g_wnd, WM_IL_BOTAO, down ? 1 : 0, MAKELPARAM(pt.x, pt.y)); }+void ilha::CapsLock() { if (g_wnd && g_on) PostMessageW(g_wnd, WM_IL_CAPS, 0, 0); }// O Windows 11 25H2 não grava mais o uso de programas comuns (ffmpeg, navegadores...) no ConsentStore enquanto usam:diff --git a/src/shell/launchpad.cpp b/src/shell/launchpad.cppindex 0640e3a..c332765 100644--- a/src/shell/launchpad.cpp+++ b/src/shell/launchpad.cpp@@ -121,6 +121,9 @@ bool launchpad::AppDoSistema(const std::wstring& name, const std::wstring& parsi// "Microsoft.Windows.ControlPanel", "Microsoft.Windows.Shell.RunDialog"...; os pacotes da Store também começam// assim ("Microsoft.Windows.Photos_8wekyb3d8bbwe!App", o Fotos) e esses ficamif (p.rfind(L"microsoft.windows.", 0) == 0 && p.find(L'!') == std::wstring::npos) return true;+ // pacotes do próprio Windows (editor cw5n1h2txyewy): Click to Do, Introdução, Backup do Windows, Configurações+ // (o WacOS tem os Ajustes do Sistema). Issue #40: "o Launchpad tem um monte de pacotes do sistema que não são apps"+ if (p.find(L"_cw5n1h2txyewy!") != std::wstring::npos) return true;std::wstring n = name;for (auto& c : n) c = towlower(c);for (auto w : { L"ferramentas do windows", L"windows tools", L"painel de controle", L"control panel", L"windows powershell ise",@@ -138,7 +141,7 @@ bool launchpad::AppDoSistema(const std::wstring& name, const std::wstring& parsibool launchpad::Escondido(const std::wstring& name, const std::wstring& parsing) {if (Hidden(name)) return true;- return shell::Setting(L"launchpad_sem_sistema", L"0") == L"1" && AppDoSistema(name, parsing);+ return shell::Setting(L"launchpad_sem_sistema", L"1") == L"1" && AppDoSistema(name, parsing);}void launchpad::Ocultar(const std::wstring& name) {@@ -300,7 +303,8 @@ Geo Layout() {g.k = g.H / 1080;g.step = 216 * g.k;g.rowStep = 166 * g.k;- g.icon = 108 * g.k;+ // launchpad_icones (issue #40: "os ícones são grandes demais"): 1 grande (padrão), 0,85 médio, 0,7 pequeno; a grade fica+ g.icon = 108 * g.k * (float)std::clamp(_wtof(shell::Setting(L"launchpad_icones", L"1").c_str()), 0.6, 1.0);g.top = (liquid::On() ? 178 : 140) * g.k; // centro da primeira linha (Tahoe: abaixo das categorias)g.left = g.W / 2 - g.step * (COLS - 1) / 2; // centro da primeira colunareturn g;@@ -925,7 +929,7 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {auto mi = [](const std::wstring& t, int id) { ctxmenu::Item i; i.label = t; i.id = id; return i; };std::vector<ctxmenu::Item> items;ctxmenu::Item sys = mi(Tr(L"Ocultar Apps do Sistema"), 1);- sys.checked = shell::Setting(L"launchpad_sem_sistema", L"0") == L"1";+ sys.checked = shell::Setting(L"launchpad_sem_sistema", L"1") == L"1";items.push_back(sys);std::vector<std::wstring> hid;for (std::wstring s = shell::Setting(L"launchpad_ocultos", L""), part; !s.empty();) {diff --git a/src/shell/limites.cpp b/src/shell/limites.cppindex c220c13..3969429 100644--- a/src/shell/limites.cpp+++ b/src/shell/limites.cpp@@ -193,7 +193,13 @@ void limites::Maximizada(HWND h) {RECT wa = shell::WorkAreaFor(hm), wr, fb;if (!GetWindowRect(h, &wr)) return;if (FAILED(DwmGetWindowAttribute(h, DWMWA_EXTENDED_FRAME_BOUNDS, &fb, sizeof(fb)))) fb = wr;- if (fb.top >= wa.top - 1 && fb.bottom <= wa.bottom + 1) return; // dentro da área: nada a fazer+ // A borda invisível de redimensionar (~8 px a 100%) fica para fora numa maximizada comum, e os apps de barra própria+ // (Chromium, Spotify, Gerenciador de Tarefas) não têm moldura do DWM: as "bordas" do quadro passam dela de propósito.+ // Antes isso contava como "por cima da barra": a correção empurrava 8 px, o app maximizava de novo e a janela pulava+ // para dentro e para fora da barra de menus (issue #24, 23/11/2026). Só corrige quem passa mais que essa borda.+ UINT dpi = GetDpiForWindow(h);+ int borda = GetSystemMetricsForDpi(SM_CYSIZEFRAME, dpi) + GetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi) + 2;+ if (fb.top >= wa.top - borda && fb.bottom <= wa.bottom + borda) return; // dentro da área: nada a fazerif (feitas.size() > 64) feitas.clear();if (antes.size() > 64) antes.clear();// a correção vai sem esperar o app (SWP_ASYNCWINDOWPOS): esperando, um app ocupado prendia o Shell inteiro. Enquantodiff --git a/src/shell/main.cpp b/src/shell/main.cppindex b49396d..a105517 100644--- a/src/shell/main.cpp+++ b/src/shell/main.cpp@@ -497,6 +497,18 @@ static void HideTaskbars() {}, 0);}+// A barra do Explorador que ele mostra de novo (Win, notificação, Explorador reiniciado) some na hora. Antes só o tique de+// 1 s a escondia: ela "aparecia às vezes" por até um segundo (issue #40)+static void CALLBACK OnBarraWindows(HWINEVENTHOOK, DWORD, HWND h, LONG obj, LONG child, DWORD, DWORD) {+ if (obj != OBJID_WINDOW || child != CHILDID_SELF || g_quitting || shell::nativo || !h) return;+ wchar_t c[32] = {}; GetClassNameW(h, c, 32);+ if (wcscmp(c, L"Shell_TrayWnd") && wcscmp(c, L"Shell_SecondaryTrayWnd")) return;+ DWORD pid = 0; GetWindowThreadProcessId(h, &pid);+ if (pid == GetCurrentProcessId() || apps::IsShellWindow(h)) return;+ ShowWindowAsync(h, SW_HIDE);+ if (std::find(g_hiddenBars.begin(), g_hiddenBars.end(), h) == g_hiddenBars.end()) g_hiddenBars.push_back(h);+}+static void ShowTaskbars() {for (HWND h : g_hiddenBars) if (IsWindow(h)) ShowWindowAsync(h, SW_SHOWNOACTIVATE);g_hiddenBars.clear();@@ -1046,6 +1058,10 @@ static LRESULT CALLBACK MsgProc(HWND h, UINT m, WPARAM w, LPARAM l) {std::wstring baixo = shell::Setting(L"barra_embaixo", L"0");if (baixo != lastBaixo) { menubar::Displays(); dock::ReloadSettings(); }lastBaixo = baixo;+ static std::wstring lastOcultar = L"?"; // ocultar a barra de menus automaticamente (issue #40)+ std::wstring ocultar = shell::Setting(L"barra_ocultar", L"0");+ if (lastOcultar != L"?" && ocultar != lastOcultar) { menubar::Displays(); dock::ReloadSettings(); }+ lastOcultar = ocultar;}static int lastLang = -1;if (lastLang < 0) lastLang = idioma::Current();@@ -1330,6 +1346,7 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int) {limites::Start(); // janelas não cruzam a barra de menus nem o Dockif (!soDock) sombras::Start();HideTaskbars();+ if (!shell::nativo) SetWinEventHook(EVENT_OBJECT_SHOW, EVENT_OBJECT_SHOW, nullptr, OnBarraWindows, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);SecondaryTaskbarsOff(); // barra do Windows nos outros monitores: desligada enquanto o Shell rodashell::ApplyWorkArea();diff --git a/src/shell/menubar.cpp b/src/shell/menubar.cppindex 2190f8b..40819a2 100644--- a/src/shell/menubar.cpp+++ b/src/shell/menubar.cpp@@ -27,6 +27,7 @@ static const wchar_t* IconePC() { return shell::Setting(L"sobre_mac", L"pc") ==#include <thread>#include "../comum/idioma.h"+static void TiqueOcultar(); // ocultar a barra automaticamente (mais abaixo, fora do namespace)namespace {const float BAR_PT_SEQUOIA = 26; // altura da barra (telas sem entalhe; um pouco maior que os 24 pt do Mac, para telas grandes)@@ -52,7 +53,7 @@ HWND g_cur, g_openBar;HWND Cur() { return g_cur ? g_cur : g_bar; }#define g_s (g_state[Cur()].s)#define g_hits (g_state[Cur()].hits)-int g_open = -1; // índice em g_hits do item com menu aberto (na barra g_openBar)+int g_open = -1; // índice em g_hits do item com menu aberto (na barra g_openBar)int g_vaoE = 0, g_vaoD = 0; // barra embaixo: o trecho do Dock na linha dela (px da janela da barra); 0-0 = em cimaHWND g_fg; // janela do app ativo (fora as nossas)std::wstring g_appName = L"Finder";@@ -295,11 +296,16 @@ bool WifiName(std::wstring& ssid) {for (DWORD i = 0; i < list->dwNumberOfItems && !ok; i++) {auto& info = list->InterfaceInfo[i];if (info.isState != wlan_interface_state_connected) continue;+ // Conectado é o estado da placa. O nome da rede, desde o Windows 11 24H2, só sai com a permissão de+ // localização ligada (sem ela a consulta falha): antes isso virava "não conectado" (issue #40)+ ok = true;PWLAN_CONNECTION_ATTRIBUTES ca = nullptr; DWORD sz = 0;- if (WlanQueryInterface(h, &info.InterfaceGuid, wlan_intf_opcode_current_connection, nullptr, &sz, (PVOID*)&ca, nullptr) == ERROR_SUCCESS) {+ if (WlanQueryInterface(h, &info.InterfaceGuid, wlan_intf_opcode_current_connection, nullptr, &sz, (PVOID*)&ca, nullptr) == ERROR_SUCCESS && ca) {auto& s = ca->wlanAssociationAttributes.dot11Ssid;- ssid.assign(s.ucSSID, s.ucSSID + s.uSSIDLength);- ok = true;+ std::string a((const char*)s.ucSSID, s.uSSIDLength); // o nome vem em UTF-8+ int n = MultiByteToWideChar(CP_UTF8, 0, a.c_str(), (int)a.size(), nullptr, 0);+ ssid.resize(n);+ MultiByteToWideChar(CP_UTF8, 0, a.c_str(), (int)a.size(), ssid.data(), n);WlanFreeMemory(ca);}}@@ -1368,7 +1374,7 @@ void Click(D2D1_POINT_2F p, bool right) {}case K_SPOT: spotlight::Toggle(); break;case K_NET: {- std::wstring ssid = g_st.ssid;+ std::wstring ssid = g_st.ssid.empty() ? Tr(L"Conectado") : g_st.ssid; // sem a permissão de localização o nome não vembool wifi = g_st.wifiOn;ShowAt(hit, { I(wifi ? L"Wi-Fi: " + ssid : L"Ethernet", 0, true), Sep(), I(Tr(L"Ajustes de Rede…"), 1) }, [](int) { Open(L"ms-settings:network"); });break;@@ -1501,7 +1507,9 @@ LRESULT CALLBACK BarProc(HWND h, UINT m, WPARAM w, LPARAM l) {}case WM_BARDISPLAYS: menubar::Displays(); return 0;case WM_MOUSEACTIVATE: return MA_NOACTIVATE;- case WM_TIMER: RefreshStatus(); Assenta(); menubar::Update(); return 0;+ case WM_TIMER:+ if (w == 2) { TiqueOcultar(); return 0; }+ RefreshStatus(); Assenta(); menubar::Update(); return 0;case WM_BARSTATUS: PegaStatus(); menubar::Update(); return 0;case WM_SETTINGCHANGE: // Windows trocou entre claro e escuroif (l && !lstrcmpiW((LPCWSTR)l, L"ImmersiveColorSet")) { menubar::ApplyTheme(); dock::ApplyTheme(); }@@ -1545,8 +1553,53 @@ void menubar::ApplyTheme() {InvalidateRect(g_bar, nullptr, FALSE);for (HWND b : g_extras) { BarGlass(b); InvalidateRect(b, nullptr, FALSE); }}-static bool g_fsOn;-static HMONITOR g_fsMon;+static bool g_fsOn;+static HMONITOR g_fsMon;+// Ocultar e mostrar automaticamente (barra_ocultar=1, Ajustes > Central de Controle, como no Mac; issue #40): a barra não+// reserva o topo (as janelas maximizadas vão até em cima) e só aparece com o ponteiro encostado no topo da tela; some+// quando ele sai dela (e não há menu dela aberto). Com a barra na linha do Dock não vale.+static bool g_revelada;+static bool Ocultar() { return shell::Setting(L"barra_ocultar", L"0") == L"1" && !menubar::Embaixo(); }+static bool Escondida(HWND b, HMONITOR hm) {+ if (g_fsOn && (!g_fsMon || g_fsMon == hm)) return true;+ return Ocultar() && !g_revelada;+}+static void Revela(bool on) {+ if (on == g_revelada) return;+ g_revelada = on;+ std::vector<HWND> all{ g_bar };+ all.insert(all.end(), g_extras.begin(), g_extras.end());+ auto alheias = shell::AlheiasNoTopo();+ for (HWND b : all) {+ bool hide = Escondida(b, MonitorFromWindow(b, MONITOR_DEFAULTTONEAREST));+ if (hide == !IsWindowVisible(b)) continue;+ ShowWindow(b, hide ? SW_HIDE : SW_SHOWNOACTIVATE);+ if (!hide) SetWindowPos(b, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);+ }+ shell::DevolveAlheias(alheias);+}+// ponteiro no topo de um monitor com barra por ~120 ms: mostra; fora dela (com folga) por ~400 ms: esconde+static void TiqueOcultar() {+ if (!Ocultar()) { Revela(true); return; }+ POINT pt; if (!GetCursorPos(&pt)) return;+ HMONITOR hm = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);+ MONITORINFO mi{ sizeof(mi) }; if (!GetMonitorInfoW(hm, &mi)) return;+ bool temBarra = (mi.dwFlags & MONITORINFOF_PRIMARY) || !g_extras.empty();+ static DWORD noTopo, fora;+ DWORD agora = GetTickCount();+ bool botao = GetAsyncKeyState(VK_LBUTTON) < 0 || GetAsyncKeyState(VK_RBUTTON) < 0;+ if (!g_revelada) {+ bool topo = temBarra && pt.y <= mi.rcMonitor.top + 1 && !botao && !(g_fsOn && (!g_fsMon || g_fsMon == hm));+ if (!topo) { noTopo = 0; return; }+ if (!noTopo) noTopo = agora;+ if (agora - noTopo >= 120) { noTopo = 0; fora = 0; Revela(true); }+ return;+ }+ bool perto = pt.y <= mi.rcMonitor.top + menubar::HeightOn(hm) + 12 || g_open >= 0 || ctxmenu::IsOpen();+ if (perto) { fora = 0; return; }+ if (!fora) fora = agora;+ if (agora - fora >= 400) { fora = 0; Revela(false); }+}void menubar::SetFullscreen(bool on, HMONITOR mon) {if (!g_bar) return;g_fsOn = on; g_fsMon = mon;@@ -1555,7 +1608,7 @@ void menubar::SetFullscreen(bool on, HMONITOR mon) {auto alheias = shell::AlheiasNoTopo(); // as "sempre por cima" de outros apps (issue #33) voltam por cima no fimstruct Fim { std::vector<HWND>& a; ~Fim() { shell::DevolveAlheias(a); } } fim{ alheias };for (HWND b : all) {- bool hide = on && (!mon || MonitorFromWindow(b, MONITOR_DEFAULTTONEAREST) == mon); // só a barra do monitor em tela cheia+ bool hide = (on && (!mon || MonitorFromWindow(b, MONITOR_DEFAULTTONEAREST) == mon)) || (Ocultar() && !g_revelada); // só a barra do monitor em tela cheiaif (hide == !IsWindowVisible(b)) continue;ShowWindow(b, hide ? SW_HIDE : SW_SHOWNOACTIVATE);if (!hide) SetWindowPos(b, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);@@ -1574,6 +1627,7 @@ int menubar::ReservedOn(HMONITOR mon) {MONITORINFO mi{ sizeof(mi) };bool prim = GetMonitorInfoW(mon, &mi) && (mi.dwFlags & MONITORINFOF_PRIMARY);if (menubar::Embaixo()) return 0; // o topo de todos os monitores volta para as janelas+ if (Ocultar()) return 0; // ocultar automaticamente: o topo é das janelas, a barra aparece por cimaif (prim) return Height();return AllMonitors() ? HeightOn(mon) : 0;}@@ -1587,7 +1641,7 @@ bool menubar::Embaixo() {// cima até o Dock encolher. Folga de 30 pt entre entrar e sair, para não ficar pulando.static bool cabia = true;RECT v; MONITORINFO mi{ sizeof(mi) };- POINT pt; GetCursorPos(&pt);+ POINT pt; GetCursorPos(&pt);if (dock::Vidro(&v) && !PtInRect(&v, pt) && GetMonitorInfoW(prim, &mi)) { // ampliado pelo ponteiro: não contafloat sc = GetDpiForWindow(dock::Hwnd()) / 96.f;float esq = (v.left - mi.rcMonitor.left) / sc, dir = (mi.rcMonitor.right - v.right) / sc;@@ -1647,9 +1701,15 @@ void menubar::Displays() {}for (size_t i = 0; i < g_extras.size(); i++) {const RECT& r = others[i].r;- bool hide = g_fsOn && (!g_fsMon || g_fsMon == others[i].hm);+ bool hide = Escondida(g_extras[i], others[i].hm);SetWindowPos(g_extras[i], HWND_TOPMOST, r.left, r.top, r.right - r.left, HeightOn(others[i].hm),- SWP_NOACTIVATE | (hide ? 0 : SWP_SHOWWINDOW));+ SWP_NOACTIVATE | (hide ? SWP_HIDEWINDOW : SWP_SHOWWINDOW));+ }+ if (Ocultar()) { g_revelada = false; if (IsWindowVisible(g_bar)) ShowWindow(g_bar, SW_HIDE); for (HWND b : g_extras) ShowWindow(b, SW_HIDE); SetTimer(g_bar, 2, 50, nullptr); }+ else {+ KillTimer(g_bar, 2);+ g_revelada = false;+ if (!IsWindowVisible(g_bar) && !Escondida(g_bar, prim.hm)) ShowWindow(g_bar, SW_SHOWNOACTIVATE);}static size_t lastN = (size_t)-1;if (lastN != g_extras.size()) { lastN = g_extras.size(); Log(L"barra de menus: %zu monitor(es) a mais", lastN); }diff --git a/src/shell/revelar.cpp b/src/shell/revelar.cppindex 60e4476..e3a41aa 100644--- a/src/shell/revelar.cpp+++ b/src/shell/revelar.cpp@@ -68,6 +68,7 @@ void Worker() {PeekMessageW(&msg, nullptr, 0, 0, PM_NOREMOVE); // cria a fila antes de o gancho postarwhile (GetMessageW(&msg, nullptr, 0, 0) > 0) {POINT pt{ (short)LOWORD(msg.lParam), (short)HIWORD(msg.lParam) };+ if (msg.message == WM_RV_DOWN || msg.message == WM_RV_UP) ilha::BotaoMouse(msg.message == WM_RV_DOWN, pt);if (msg.message == WM_RV_DOWN) {if (notificacoes::IsOpen()) { // diagnóstico: onde o clique cai com a Central aberta (clique que "não chegava")HWND at = WindowFromPoint(pt); wchar_t c[64] = {}; if (at) GetClassNameW(GetAncestor(at, GA_ROOT), c, 64);diff --git a/src/shell/shell.h b/src/shell/shell.hindex 6d45563..13120e4 100644--- a/src/shell/shell.h+++ b/src/shell/shell.h@@ -458,6 +458,7 @@ bool On();bool Notificacao(const std::wstring& app, const std::wstring& title, const std::wstring& body,std::function<void(ID2D1DeviceContext*, ID2D1SolidColorBrush*, D2D1_RECT_F)> icon, std::function<void()> click);bool Volume(float level, bool mute); // teclas de volume: true = a ilha mostrou (sem o aviso de volume)+void BotaoMouse(bool down, POINT pt); // gancho do mouse: botão esquerdo apertado/solto (arrastar arquivo até a Ilha desligada)void Brilho(int pct); // o brilho da tela mudou (qualquer thread): aviso de brilho, como o de volumevoid CapsLock(); // a tecla Caps Lock foi apertada (gancho de teclado do main.cpp)void PrivacidadeMudou(); // a bandeja mudou: relê o ícone de privacidade do Windows (tray::PrivacyBits)diff --git a/src/shell/spotlight.cpp b/src/shell/spotlight.cppindex dede0dc..cccb2c6 100644--- a/src/shell/spotlight.cpp+++ b/src/shell/spotlight.cpp@@ -2546,7 +2546,7 @@ void AppsMenu(HWND h, LPARAM l) {std::vector<ctxmenu::Item> items;items.push_back(mi(Tr(g_edit ? L"Concluir Edição" : L"Editar Apps"), 1, !g_edit && !CanArrange()));items.push_back(mi(Tr(L"Organizar por Nome"), 2, shell::Setting(L"apps_ordem", L"").empty()));- bool semSis = shell::Setting(L"launchpad_sem_sistema", L"0") == L"1";+ bool semSis = shell::Setting(L"launchpad_sem_sistema", L"1") == L"1";ctxmenu::Item sys = mi(Tr(L"Ocultar Apps do Sistema"), 3); // Painel de Controle, Mapa de Caracteres, Ferramentas do Windows...sys.checked = semSis;items.push_back(sys);