A new style desktop shell for Windows 11: menu bar, Dock, Finder, Spotlight, Control Center and Liquid Glass, in native C++.
Rust
Issue #99 (from PR #109 by 404-Page-Found): Control Center icon sizes, Mission Control opens on a plain click, clock controls open the WacOS Clock
Eternity070628848439a4f4be
diff --git a/docs/registro-mudancas.txt b/docs/registro-mudancas.txtindex 2518a86..7c2a99d 100644--- a/docs/registro-mudancas.txt+++ b/docs/registro-mudancas.txt@@ -1926,3 +1926,14 @@ Compilado (tudo), instalado, Shell e reserva do Finder reiniciados às 23:07 semMúsicas, Vídeos, OneDrive, Público, AppData, Windows, Arquivos de Programas) nunca vai para a Lixeira pela Lixeira doDock nem pelo Delete da mesa; o que vai fica no shell.log. Não testado na tela.DESFAZER: reverter o commit e rodar build.cmd shell.+[2026-11-26 16:30] PRs do 404-Page-Found (a pedido do usuário, depois da revisão):+ - Merge: #120 (menu do app lido numa thread, #115), #121 (Soneca de Apps sem refazer a varredura de áudio, #116),+ #122 (Quick Look lê o texto fora da pintura, #117), #110 (pastas do usuário no lado direito do Dock, #108; soltar+ arquivos move para a pasta, agora sem mover pastas protegidas do #100), #107 (atualização automática opcional,+ #102) e #106 (sem cantos nem borda colorida em tela cheia, #101).+ - #109 (#99): só as 56 linhas de verdade, trazidas à mão (o PR convertia 3 arquivos inteiros para LF): tamanhos dos+ ícones da Central, Mission Control abre num clique simples, Alarme/Cronômetro/Temporizador abrem o Relógio do WacOS.+ - Fechados sem merge: #105 (reaparece a "linha" da moldura atrasada ao arrastar) e #118 (80 avisos do SonarCloud em+ 40 arquivos, só ruído).+ Compilado (tudo e as DLLs das janelas). Não testado na tela.+ DESFAZER: reverter os commits de merge e compilar.diff --git a/src/relogio/main.cpp b/src/relogio/main.cppindex 82cf254..8add67b 100644--- a/src/relogio/main.cpp+++ b/src/relogio/main.cpp@@ -20,6 +20,7 @@ namespace {float TB = 56; // macOS 27: 52 (barra unificada)const UINT WM_FIELDLOST = WM_APP + 77, WM_CITYFOUND = WM_APP + 8;int g_tab = 0; // 0 mundial, 1 alarmes, 2 cronômetro, 3 timer+UINT g_msgAba = 0; // outra instância pedindo uma aba (a Central de Controle abre o Relógio na aba do controle)IDWriteTextFormat *g_tfSeg, *g_tfBig, *g_tfBigR, *g_tfHuge, *g_tfRow, *g_tfSub, *g_tfBtn, *g_tfIcon, *g_tfMono;// ---- relógio mundial (fusos do Windows por cidade)@@ -618,6 +619,10 @@ void AlarmMenu(int k, POINT scr) {}LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {+ if (m == g_msgAba && g_msgAba) { // outra instância pediu uma aba (issue #99)+ if (w <= 3) { g_tab = (int)w; InvalidateRect(h, nullptr, FALSE); }+ return 0;+ }switch (m) {case WM_PAINT: { PAINTSTRUCT ps; ::BeginPaint(h, &ps); Paint(); ::EndPaint(h, &ps); return 0; }case WM_ERASEBKGND: return 1;@@ -681,10 +686,31 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {} // namespace-int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {+int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR cmd, int show) {+ // a aba pode vir na linha de comando, por nome: alarme, cronometro ou temporizador (issue #99)+ int aba = 0;+ if (cmd) {+ std::wstring a = cmd;+ for (auto& c : a) c = (wchar_t)towlower(c);+ auto tem = [&](const wchar_t* s) { return a.find(s) != std::wstring::npos; };+ if (tem(L"alarme")) aba = 1;+ else if (tem(L"cronometro") || tem(L"cronômetro")) aba = 2;+ else if (tem(L"temporizador") || tem(L"timer")) aba = 3;+ }+ g_msgAba = RegisterWindowMessageW(L"WacOSRelogioAba");+ HANDLE one = CreateMutexW(nullptr, TRUE, L"WacOSRelogioUmaJanela"); // uma janela só, como no Mac (e na Calculadora)+ if (GetLastError() == ERROR_ALREADY_EXISTS) { // já aberto: troca para a aba pedida e traz para a frente+ if (HWND w = FindWindowW(L"RelogioJanela", nullptr)) {+ PostMessageW(w, g_msgAba, aba, 0);+ if (IsIconic(w)) ShowWindow(w, SW_RESTORE);+ SetForegroundWindow(w);+ }+ return 0;+ }if (!Init()) return 1;g_file = DataPath(L"relogio.txt");Load();+ g_tab = aba;std::wstring disp = HasFont(L"SF Pro Display") ? L"SF Pro Display" : family;g_tfSeg = Fmt(12.5f, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);g_tfBig = Fmt(44, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_TEXT_ALIGNMENT_TRAILING, false, disp.c_str());diff --git a/src/shell/central.cpp b/src/shell/central.cppindex 794af72..e165a0d 100644--- a/src/shell/central.cpp+++ b/src/shell/central.cpp@@ -33,6 +33,7 @@#include "../comum/idioma.h"#include "../comum/nomes.h"#include <array>+#include <map>#include <intrin.h>#include "../comum/vidro.h"#include <bluetoothapis.h>@@ -59,7 +60,7 @@ ui::GpuSurface g_s;bool g_open, g_glass, g_menu;double g_openAt; // ms de anim::NowDWORD g_closedAt;-IDWriteTextFormat *g_tfBold, *g_tfSmall, *g_tfTile, *g_tfGlyph;+IDWriteTextFormat *g_tfBold, *g_tfSmall, *g_tfTile;// ---- estado (lido em threads; a janela só desenha)std::mutex g_mx;@@ -755,10 +756,20 @@ void Sym(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, const wchar_t* name,return;}if (simbolo::Draw(dc, name, r, br)) return;- float s = std::max(r.right - r.left, r.bottom - r.top) + 6;+ // sem o SVG: o glifo da Segoe Fluent no tamanho do quadro. Antes era um formato fixo de 14 pt: os controles sem+ // SVG (Alarme, Cronômetro, Terminal...) ficavam miúdos perto dos vizinhos com SVG (issue #99). Um formato por+ // tamanho, em cache (a Central redesenha bastante).+ float s = std::max(r.right - r.left, r.bottom - r.top);+ static std::map<int, IDWriteTextFormat*> fmts;+ IDWriteTextFormat*& tf = fmts[(int)std::lround(s * 2)]; // meio ponto de resolução basta+ if (!tf && (tf = ui::Format(s, DWRITE_FONT_WEIGHT_NORMAL, true, DWRITE_TEXT_ALIGNMENT_CENTER))) {+ tf->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER);+ tf->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP);+ }+ if (!tf) return;float cx = (r.left + r.right) / 2, cy = (r.top + r.bottom) / 2;wchar_t g = fallback;- dc->DrawTextW(&g, 1, g_tfGlyph, D2D1::RectF(cx - s / 2, cy - s / 2, cx + s / 2, cy + s / 2), br);+ dc->DrawTextW(&g, 1, tf, D2D1::RectF(cx - s / 2, cy - s / 2, cx + s / 2, cy + s / 2), br);}float PanelR() { return liquid::On() ? 26.f : liquid::Leopard() ? 6.f : RADIUS; } // Tahoe: painel bem mais redondo; Leopard: o canto do menu@@ -840,7 +851,7 @@ void Circle(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, const Pal& p, D2D1else if (liquid::On()) { // Tahoe ligado: círculo branco com o símbolo na cor do controlebr->SetColor(D2D1::ColorF(1, 1, 1, 0.97f));dc->FillEllipse(D2D1::Ellipse(c, r, r), br);- float s = r * 0.62f;+ float s = r * 0.45f; // o glifo ocupa ~45% do raio, como no Mac (era 0,62: grande demais, issue #99)Sym(dc, br, sym, fb, D2D1::RectF(c.x - s, c.y - s, c.x + s, c.y + s), onColor);return;} else {@@ -848,7 +859,7 @@ void Circle(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, const Pal& p, D2D1dc->FillEllipse(D2D1::Ellipse(c, r, r), br);if (liquid::On()) liquid::Rim(dc, D2D1::RectF(c.x - r, c.y - r, c.x + r, c.y + r), r, ui::Dark(), 0.6f);}- float s = r * 0.62f;+ float s = r * 0.45f; // idem (Sequoia e os círculos apagados do Tahoe)Sym(dc, br, sym, fb, D2D1::RectF(c.x - s, c.y - s, c.x + s, c.y + s), on ? D2D1::ColorF(1, 1, 1, 1) : p.offGlyph);}@@ -1949,7 +1960,11 @@ void RunExtra(const std::wstring& id) { // controle da galeria clicado (fora daelse if (id == L"spotlight") spotlight::Toggle();else if (id == L"lupa") open(L"magnify.exe");else if (id == L"teclado") open(L"osk.exe");- else if (id == L"alarme" || id == L"cronometro" || id == L"temporizador") open(L"ms-clock:");+ else if (id == L"alarme" || id == L"cronometro" || id == L"temporizador") { // o Relógio do WacOS, na aba do controle (issue #99)+ std::wstring exe = shell::dir + L"\\" EXE_CLOCK;+ if (GetFileAttributesW(exe.c_str()) != INVALID_FILE_ATTRIBUTES) open(exe, id.c_str());+ else open(L"ms-clock:"); // instalação antiga, sem o Relógio+ }else if (id == L"luznoturna") open(L"ms-settings:nightlight");else if (id == L"bateria") open(L"ms-settings:batterysaver");}@@ -2266,8 +2281,7 @@ bool central::Create(HINSTANCE hi) {g_tfBold = ui::Format(13, DWRITE_FONT_WEIGHT_SEMI_BOLD);g_tfSmall = ui::Format(11, DWRITE_FONT_WEIGHT_NORMAL);g_tfTile = ui::Format(11, DWRITE_FONT_WEIGHT_MEDIUM, false, DWRITE_TEXT_ALIGNMENT_CENTER);- g_tfGlyph = ui::Format(14, DWRITE_FONT_WEIGHT_NORMAL, true, DWRITE_TEXT_ALIGNMENT_CENTER);- for (auto* tf : { g_tfBold, g_tfSmall, g_tfGlyph }) if (tf) { tf->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); tf->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP); }+ for (auto* tf : { g_tfBold, g_tfSmall }) if (tf) { tf->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); tf->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP); }if (g_tfTile) g_tfTile->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);DWRITE_TRIMMING tr{ DWRITE_TRIMMING_GRANULARITY_CHARACTER, 0, 0 };for (auto* tf : { g_tfBold, g_tfSmall }) if (tf) { // texto que não cabe termina em "…" (como no Mac), não cortado no meiodiff --git a/src/shell/missioncontrol.cpp b/src/shell/missioncontrol.cppindex c857556..384202b 100644--- a/src/shell/missioncontrol.cpp+++ b/src/shell/missioncontrol.cpp@@ -59,6 +59,7 @@ IDWriteTextFormat *g_tfDesk, *g_tfTitle, *g_tfPlus;// Arrastar uma janela até uma Mesa da faixa de cima leva a janela para lá (como no Mac). A janela segue o// ponteiro e encolhe chegando perto da faixa; solta na Mesa, ela voa até a miniatura e some dali.int g_drag = -1; // janela pressionada+bool g_lDown; // o botão esquerdo desceu nesta janela (um "subir" vindo de fora não é clique, issue #99)bool g_dragging; // já mexeu (senão é um clique)D2D1_POINT_2F g_dragStart{}, g_dragGrab{}; // onde apertou; ponto da janela sob o ponteiro (0..1)D2D1_RECT_F g_dragBase{}; // tamanho da janela quando começou a arrastar (px)@@ -894,6 +895,7 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {}case WM_LBUTTONDOWN: {if (g_closing || g_compAnim) return 0;+ g_lDown = true;D2D1_POINT_2F p = Px(l);g_drag = HitWindow(p); g_dragging = false;if (g_drag >= 0) {@@ -953,6 +955,10 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {}case WM_LBUTTONUP: {if (g_closing) return 0;+ // o botão desceu em outra janela (ex.: o clique na Central de Controle que abriu o Mission Control): sem este+ // filtro, o "subir" caía aqui e fechava na hora — só funcionava segurando o clique (issue #99)+ if (!g_lDown) return 0;+ g_lDown = false;D2D1_POINT_2F p = Px(l);float sc = Sc();if (GetCapture() == h) ReleaseCapture();@@ -1138,7 +1144,7 @@ void missioncontrol::Toggle() {for (auto& w : g_wins) w.from = FrameF(w);g_barFrom = g_barTo = 0;Layout(0);- g_open = true; g_closing = false; g_hover = -1; g_pick = nullptr; g_hoverDesk = -1; g_hoverX = false;+ g_open = true; g_closing = false; g_hover = -1; g_pick = nullptr; g_hoverDesk = -1; g_hoverX = false; g_lDown = false;g_animAt = g_openAt = anim::Now();g_durMs = liquid::On() ? 300.f : std::min(550.f, anim::SpringDuration(RESPONSE, DAMPING) * 1000);g_compAnim = false;