A new style desktop shell for Windows 11: menu bar, Dock, Finder, Spotlight, Control Center and Liquid Glass, in native C++.
Rust
Fix issues #300 #297 #283 #276 #281 #292 #302 #208
Eternity0706285c26ed1a28d6
diff --git a/docs/registro-mudancas.txt b/docs/registro-mudancas.txtindex b1ee80f..a5bda72 100644--- a/docs/registro-mudancas.txt+++ b/docs/registro-mudancas.txt@@ -2146,3 +2146,21 @@ Compilado (tudo), instalado, Shell e reserva do Finder reiniciados às 23:07 semWidgets e app Tempo convertem na hora de mostrar (comum/temperatura.h, comum/src/temperatura.rs).Compilado (build.cmd, build.cmd janelas, cargo check). Não testado ao vivo.DESFAZER: reverter os commits (main e claude/rust-port-teste-23da8b) e compilar de novo.++[2026-11-29 21:30] Build-60 (rodada de issues e PRs; C++ em main, Rust em claude/rust-port-teste-23da8b)+ - PRs mesclados aqui (não no GitHub ainda): #285 (brilho dos nomes da mesa fora da thread da interface; #278/#298),+ #293 (pecofence_compat=1), #294 (Finder: ordem por letra da unidade, #210), #289 (Finder nasce na área útil),+ #290 (Dock abre o Finder com só janelas do Explorador), #291 (widget largo alinhado à grade), #277 (vietnamita).+ - #300: Terminal colava duas vezes com Ctrl+V (o 0x16 do WM_CHAR ia ao PSReadLine); o WM_CHAR de um Ctrl+letra+ já tratado não vai mais ao shell.+ - #297: Mostrar Mesa (canto ativo / Win+D) devolve a janela que estava na frente para a frente depois de restaurar.+ - #283: tema Mac OS X (Leopard): a fonte padrão do Shell, dos apps, do menu de contexto, das dicas e do Finder é a+ Lucida Sans Unicode (vale ao abrir o Shell/app de novo).+ - #276: vidro real com papel de parede animado: o ritmo das montagens só do papel de parede se ajusta ao tempo da+ montagem (33 ms a 1 s); log "vidro real: papel de parede animado em ritmo lento/normal".+ - #281: PeaZip (peazip.exe, pea.exe) fora da barra do Mac.+ - #292: a busca dos Ajustes procura também os títulos, rótulos, descrições e opções de cada painel.+ - #302: Finder > Ajustes: "Enter Abre o Item (F2 Renomeia)" (opcoes.txt enterAbre=1).+ - #208: Finder: arquivos soltos sobre um .exe/.bat/.cmd/.lnk/.ps1/... abrem nele (alvo de soltar do Windows).+ Compilado (build.cmd). Não testado ao vivo.+ DESFAZER: reverter os commits (main e claude/rust-port-teste-23da8b) e compilar de novo.diff --git a/src/ajustes/main.cpp b/src/ajustes/main.cppindex 48f55b2..85cc91d 100644--- a/src/ajustes/main.cpp+++ b/src/ajustes/main.cpp@@ -636,6 +636,30 @@ void Go(int delta) {Invalidate();}+// Issue #292: a busca só olhava o nome do painel e umas palavras-chave; "gênio" não achava a opção do efeito. Agora+// cada painel é montado uma vez (na primeira busca) e entram no texto procurado os títulos dos grupos, os rótulos, as+// descrições e as opções de cada linha, no português do código e na língua do WacOS.+std::vector<std::wstring> g_sideTexto; // por item da barra lateral+std::vector<bool> g_sideFeito;+const std::wstring& TextoDoPainel(int i) {+ auto& items = SidebarItems();+ if (g_sideTexto.size() != items.size()) { g_sideTexto.assign(items.size(), std::wstring()); g_sideFeito.assign(items.size(), false); }+ std::wstring& t = g_sideTexto[i];+ if (!g_sideFeito[i]) { g_sideFeito[i] = true;+ t.clear();+ auto add = [&t](const std::wstring& s) { if (s.empty()) return; t += L' '; t += s; const wchar_t* tr = Tr(s.c_str()); if (s != tr) { t += L' '; t += tr; } };+ try {+ aj::Page pg = items[i].build();+ for (auto& g : pg.groups) {+ add(g.title); add(g.subtitle);+ for (auto& r : g.rows) { add(r.label); add(r.detail); add(r.button); for (auto& o : r.options) add(o); }+ }+ } catch (...) {}+ for (auto& ch : t) ch = towlower(ch);+ }+ return t;+}+void UpdateSideVisible() {g_sideVisible.clear();auto& items = SidebarItems();@@ -644,7 +668,7 @@ void UpdateSideVisible() {for (int i = 0; i < (int)items.size(); i++) {if (items[i].id == L"conta") continue; // é o cabeçalho da conta, no topoif (!q.empty()) {- std::wstring hay = items[i].name + L" " + Tr(items[i].name) + L" " + items[i].keywords;+ std::wstring hay = items[i].name + L" " + Tr(items[i].name) + L" " + items[i].keywords + TextoDoPainel(i);for (auto& ch : hay) ch = towlower(ch);if (hay.find(q) == std::wstring::npos) continue;}diff --git a/src/comum/app2d.h b/src/comum/app2d.hindex 9d8506f..4508921 100644--- a/src/comum/app2d.h+++ b/src/comum/app2d.h@@ -56,7 +56,8 @@ inline bool Init() {D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &d2d);DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), (IUnknown**)&dw);if (!d2d || !dw) return false;- family = HasFont(L"SF Pro Text") ? L"SF Pro Text" : HasFont(L"Inter") ? L"Inter" : L"Segoe UI";+ // issue #283: no tema Mac OS X (Leopard) o texto é em Lucida, não a SF do macOS novo+ family = semaforo::Leopard() && HasFont(L"Lucida Sans Unicode") ? L"Lucida Sans Unicode" : HasFont(L"SF Pro Text") ? L"SF Pro Text" : HasFont(L"Inter") ? L"Inter" : L"Segoe UI";return true;}diff --git a/src/comum/dica.h b/src/comum/dica.hindex 4c062d2..83e5dc6 100644--- a/src/comum/dica.h+++ b/src/comum/dica.h@@ -8,6 +8,7 @@#include <windows.h>#include "fonte_cjk.h" // a reserva para coreano, japonês e chinês#include <d2d1.h>+#include "semaforo.h"#include <dwrite.h>#include <string>#include <algorithm>@@ -38,7 +39,7 @@ inline IDWriteTextFormat* Fonte() {const wchar_t* fam = L"Segoe UI";IDWriteFontCollection* c = nullptr;if (SUCCEEDED(dw->GetSystemFontCollection(&c)) && c) {- for (const wchar_t* f : { L"SF Pro Text", L"Inter" }) { UINT32 i; BOOL ex = FALSE; c->FindFamilyName(f, &i, &ex); if (ex) { fam = f; break; } }+ for (const wchar_t* f : { semaforo::Leopard() ? L"Lucida Sans Unicode" : L"SF Pro Text", L"SF Pro Text", L"Inter" }) { UINT32 i; BOOL ex = FALSE; c->FindFamilyName(f, &i, &ex); if (ex) { fam = f; break; } }c->Release();}cjk::Format(dw, fam, nullptr, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 11.5f, L"", &tf);diff --git a/src/comum/idioma_de.inc b/src/comum/idioma_de.incindex c813596..fcc6c20 100644--- a/src/comum/idioma_de.inc+++ b/src/comum/idioma_de.inc@@ -1801,3 +1801,5 @@{ L"Ligue a edição do WacOS reescrita em Rust em Ajustes do Sistema > Experimental > BETA-TEST. Ela ainda está em teste e dá para voltar para esta edição a qualquer momento.", L"Schalte die in Rust neu geschriebene Edition von WacOS unter Systemeinstellungen > Experimentell > BETA-TEST ein. Sie ist noch im Test, und du kannst jederzeit zu dieser Edition zurückwechseln." },{ L"Abrir Ajustes", L"Einstellungen öffnen" },{ L"Agora não", L"Nicht jetzt" },+{ L"Letra da Unidade", L"Laufwerksbuchstabe" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Eingabetaste öffnet Objekte (F2 benennt um)" },diff --git a/src/comum/idioma_en.inc b/src/comum/idioma_en.incindex 90b571c..20c7459 100644--- a/src/comum/idioma_en.inc+++ b/src/comum/idioma_en.inc@@ -1815,3 +1815,4 @@{ L"sem conexão", L"no connection" },{ L"Espaço", L"Space" },{ L"Letra da Unidade", L"Drive Letter" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Return Opens Items (F2 Renames)" },diff --git a/src/comum/idioma_es.inc b/src/comum/idioma_es.incindex cc81e4f..16a3d59 100644--- a/src/comum/idioma_es.inc+++ b/src/comum/idioma_es.inc@@ -1801,3 +1801,5 @@{ L"Ligue a edição do WacOS reescrita em Rust em Ajustes do Sistema > Experimental > BETA-TEST. Ela ainda está em teste e dá para voltar para esta edição a qualquer momento.", L"Activa la edición de WacOS reescrita en Rust en Ajustes del Sistema > Experimental > BETA-TEST. Todavía está en pruebas y puedes volver a esta edición en cualquier momento." },{ L"Abrir Ajustes", L"Abrir Ajustes" },{ L"Agora não", L"Ahora no" },+{ L"Letra da Unidade", L"Letra de unidad" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Intro abre los ítems (F2 cambia el nombre)" },diff --git a/src/comum/idioma_fr.inc b/src/comum/idioma_fr.incindex caa9b1c..f8ba613 100644--- a/src/comum/idioma_fr.inc+++ b/src/comum/idioma_fr.inc@@ -1801,3 +1801,5 @@{ L"Ligue a edição do WacOS reescrita em Rust em Ajustes do Sistema > Experimental > BETA-TEST. Ela ainda está em teste e dá para voltar para esta edição a qualquer momento.", L"Activez l’édition de WacOS réécrite en Rust dans Réglages Système > Expérimental > BETA-TEST. Elle est encore en test et vous pouvez revenir à cette édition à tout moment." },{ L"Abrir Ajustes", L"Ouvrir les Réglages" },{ L"Agora não", L"Plus tard" },+{ L"Letra da Unidade", L"Lettre de lecteur" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Entrée ouvre les éléments (F2 renomme)" },diff --git a/src/comum/idioma_it.inc b/src/comum/idioma_it.incindex ab962fb..04b0e81 100644--- a/src/comum/idioma_it.inc+++ b/src/comum/idioma_it.inc@@ -1801,3 +1801,5 @@{ L"Ligue a edição do WacOS reescrita em Rust em Ajustes do Sistema > Experimental > BETA-TEST. Ela ainda está em teste e dá para voltar para esta edição a qualquer momento.", L"Attiva l’edizione di WacOS riscritta in Rust in Impostazioni di Sistema > Sperimentale > BETA-TEST. È ancora in test e puoi tornare a questa edizione in qualsiasi momento." },{ L"Abrir Ajustes", L"Apri Impostazioni" },{ L"Agora não", L"Non ora" },+{ L"Letra da Unidade", L"Lettera di unità" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Invio apre gli elementi (F2 rinomina)" },diff --git a/src/comum/idioma_ja.inc b/src/comum/idioma_ja.incindex 68e8a66..c94bc3c 100644--- a/src/comum/idioma_ja.inc+++ b/src/comum/idioma_ja.inc@@ -1801,3 +1801,5 @@{ L"Ligue a edição do WacOS reescrita em Rust em Ajustes do Sistema > Experimental > BETA-TEST. Ela ainda está em teste e dá para voltar para esta edição a qualquer momento.", L"Rust で書き直した WacOS は、システム設定 > 実験的機能 > BETA-TEST でオンにできます。まだテスト中で、いつでもこの版に戻せます。" },{ L"Abrir Ajustes", L"設定を開く" },{ L"Agora não", L"後で" },+{ L"Letra da Unidade", L"ドライブ文字" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Return キーで項目を開く(F2 で名前変更)" },diff --git a/src/comum/idioma_ko.inc b/src/comum/idioma_ko.incindex 455ff85..2627cf9 100644--- a/src/comum/idioma_ko.inc+++ b/src/comum/idioma_ko.inc@@ -1801,3 +1801,5 @@{ L"Ligue a edição do WacOS reescrita em Rust em Ajustes do Sistema > Experimental > BETA-TEST. Ela ainda está em teste e dá para voltar para esta edição a qualquer momento.", L"시스템 설정 > 실험적 기능 > BETA-TEST에서 Rust로 다시 작성한 WacOS 에디션을 켜십시오. 아직 테스트 중이며 언제든지 이 에디션으로 돌아올 수 있습니다." },{ L"Abrir Ajustes", L"설정 열기" },{ L"Agora não", L"나중에" },+{ L"Letra da Unidade", L"드라이브 문자" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Return 키로 항목 열기(F2로 이름 변경)" },diff --git a/src/comum/idioma_pl.inc b/src/comum/idioma_pl.incindex d18814a..0e344b0 100644--- a/src/comum/idioma_pl.inc+++ b/src/comum/idioma_pl.inc@@ -1801,3 +1801,5 @@{ L"Ligue a edição do WacOS reescrita em Rust em Ajustes do Sistema > Experimental > BETA-TEST. Ela ainda está em teste e dá para voltar para esta edição a qualquer momento.", L"Włącz wersję WacOS przepisaną w Rust w Ustawieniach systemowych > Eksperymentalne > BETA-TEST. Jest wciąż testowana i w każdej chwili możesz wrócić do tej wersji." },{ L"Abrir Ajustes", L"Otwórz Ustawienia" },{ L"Agora não", L"Nie teraz" },+{ L"Letra da Unidade", L"Litera dysku" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Enter otwiera elementy (F2 zmienia nazwę)" },diff --git a/src/comum/idioma_ru.inc b/src/comum/idioma_ru.incindex 55cfd66..42e052a 100644--- a/src/comum/idioma_ru.inc+++ b/src/comum/idioma_ru.inc@@ -1801,3 +1801,5 @@{ L"Ligue a edição do WacOS reescrita em Rust em Ajustes do Sistema > Experimental > BETA-TEST. Ela ainda está em teste e dá para voltar para esta edição a qualquer momento.", L"Включите версию WacOS, переписанную на Rust, в Системных настройках > Экспериментальное > BETA-TEST. Она ещё тестируется, и к этой версии можно вернуться в любой момент." },{ L"Abrir Ajustes", L"Открыть Настройки" },{ L"Agora não", L"Не сейчас" },+{ L"Letra da Unidade", L"Буква диска" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Enter открывает объекты (F2 — переименовать)" },diff --git a/src/comum/idioma_tr.inc b/src/comum/idioma_tr.incindex bb3f629..91ae471 100644--- a/src/comum/idioma_tr.inc+++ b/src/comum/idioma_tr.inc@@ -1801,3 +1801,5 @@{ L"Ligue a edição do WacOS reescrita em Rust em Ajustes do Sistema > Experimental > BETA-TEST. Ela ainda está em teste e dá para voltar para esta edição a qualquer momento.", L"Rust ile yeniden yazılan WacOS sürümünü Sistem Ayarları > Deneysel > BETA-TEST bölümünden açın. Hâlâ test aşamasındadır ve istediğiniz zaman bu sürüme geri dönebilirsiniz." },{ L"Abrir Ajustes", L"Ayarları Aç" },{ L"Agora não", L"Şimdi Değil" },+{ L"Letra da Unidade", L"Sürücü harfi" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Enter öğeleri açar (F2 yeniden adlandırır)" },diff --git a/src/comum/idioma_vi.inc b/src/comum/idioma_vi.incindex 49a4cfa..3345470 100644--- a/src/comum/idioma_vi.inc+++ b/src/comum/idioma_vi.inc@@ -2037,3 +2037,5 @@{ L"Perth", L"Perth" },{ L"Brisbane", L"Brisbane" },{ L"Social", L"Mạng xã hội" },+{ L"Letra da Unidade", L"Ký tự ổ đĩa" },+{ L"Enter Abre o Item (F2 Renomeia)", L"Enter mở mục (F2 đổi tên)" },diff --git a/src/comum/idioma_zh.inc b/src/comum/idioma_zh.incindex 1623e72..eead2e0 100644--- a/src/comum/idioma_zh.inc+++ b/src/comum/idioma_zh.inc@@ -2039,3 +2039,5 @@{ L"Social", L"社交" },{ L"Fundo de vidro", L"玻璃背景" },{ L"Deixa a ilha com transparência em vidro (Liquid Glass ou fosco), como o Dock e os outros módulos.", L"让灵动岛使用和程序坞等模块一致的半透明玻璃效果(Liquid Glass 或磨砂)。" },+{ L"Letra da Unidade", L"驱动器号" },+{ L"Enter Abre o Item (F2 Renomeia)", L"按 Return 键打开项目(F2 重新命名)" },diff --git a/src/finder/drop.cpp b/src/finder/drop.cppindex 98f465d..a66b489 100644--- a/src/finder/drop.cpp+++ b/src/finder/drop.cpp@@ -107,7 +107,7 @@ public:STDMETHODIMP DragOver(DWORD keys, POINTL pt, DWORD* eff) override {DWORD allowed = *eff;DropSpot s = SpotAt(pt);- bool overFolder = s.kind == DropSpot::FOLDER && (s.item >= 0 || s.row >= 0) && !s.path.empty();+ bool overFolder = s.kind == DropSpot::FOLDER && (s.item >= 0 || s.row >= 0) && !s.path.empty() && !s.programa; // programa: não abre como pastaif (!overFolder) springPath_.clear();else if (s.path != springPath_) { springPath_ = s.path; springSince_ = GetTickCount(); }else if (GetTickCount() - springSince_ > 900) {diff --git a/src/finder/finder.h b/src/finder/finder.hindex 7d46c9a..289591d 100644--- a/src/finder/finder.h+++ b/src/finder/finder.h@@ -136,6 +136,7 @@ struct DropSpot {int item = -1; // item do conteúdo destacadoint row = -1; // linha da barra lateral destacadaint seg = -1; // trecho da barra de caminho destacado+ bool programa = false; // FOLDER sobre um programa (.exe, .bat...): ele abre com os arquivos (issue #208)};DropSpot DropSpotAt(POINT clientPx);void SetDropFeedback(const DropSpot& spot);diff --git a/src/finder/main.cpp b/src/finder/main.cppindex 0d750ac..afd26c7 100644--- a/src/finder/main.cpp+++ b/src/finder/main.cpp@@ -415,6 +415,7 @@ static bool g_pathBar = false; // barra de caminho embaixo: desligada, como no// Alt segurado revela a barra por um instante (Option no Mac, issue #152); SyncFooterH refaz a altura do rodapé.static bool g_altPath = false;static bool PathBarOn() { return g_pathBar || g_altPath; }+static bool g_enterAbre = false; // issue #302: Enter abre o item, F2 renomeia (como no Explorador); padrão: Enter renomeia, como no Macstatic void SyncFooterH() { Lay::FOOTER_H = Lay::STATUS_H + (PathBarOn() ? Lay::PATH_H : 0); }static void AltPathDown() {if (g_altPath || g_pathBar || g_renameIdx >= 0) return;@@ -1882,6 +1883,13 @@ DropSpot DropSpotAt(POINT px) {d.kind = DropSpot::FOLDER; d.path = g_items[i].path; d.item = i;return d;}+ // issue #208: arquivos soltos sobre um programa ou script abrem nele (como no Explorador): o alvo de soltar do+ // próprio Windows para o arquivo cuida disso (passa os caminhos como argumentos)+ if (i >= 0 && !g_items[i].sel) {+ const wchar_t* ext = PathFindExtensionW(g_items[i].path.c_str());+ for (const wchar_t* e : { L".exe", L".bat", L".cmd", L".com", L".lnk", L".ps1", L".vbs", L".js", L".py" })+ if (!_wcsicmp(ext, e)) { d.kind = DropSpot::FOLDER; d.path = g_items[i].path; d.item = i; d.programa = true; return d; }+ }if (!g_ownDrag && !g_folder.empty()) { d.kind = DropSpot::FOLDER; d.path = g_folder; } // na própria pasta de origem não faz nadareturn d;}@@ -5446,6 +5454,7 @@ static void SaveOptions() {if (g_sideWidthSet) fwprintf(f, L"larguraLateral=%g\n", Lay::SIDEBAR_W);if (ColLay::COL_W != 230) fwprintf(f, L"larguraColuna=%g\n", ColLay::COL_W);fwprintf(f, L"ocultos=%d\n", g_showHidden ? 1 : 0);+ fwprintf(f, L"enterAbre=%d\n", g_enterAbre ? 1 : 0);fwprintf(f, L"lateralNuvem=%d\nlateralLocais=%d\nlateralEtiquetas=%d\n", g_sideCloud, g_sideDrives, g_sideTags);if (g_groupDl >= 0) fwprintf(f, L"grupoDownloads=%d\n", g_groupDl);if (g_hwnd && !g_reserva && !g_pick.on && IsWindowVisible(g_hwnd)) {@@ -5486,6 +5495,7 @@ static void LoadOptions() {else if (k == L"lateralLocais") g_sideDrives = v != 0;else if (k == L"lateralEtiquetas") g_sideTags = v != 0;else if (k == L"barraCaminho") { g_pathBar = v != 0; SyncFooterH(); }+ else if (k == L"enterAbre") g_enterAbre = v != 0;else if (k == L"larguraColuna") ColLay::COL_W = std::clamp((float)v, ColLay::COL_MIN, ColLay::COL_MAX);else if (k == L"larguraLateral") { Lay::SIDEBAR_W = std::clamp((float)v, Lay::SIDEBAR_MIN, Lay::SIDEBAR_MAX); g_sideWidthSet = true; }else if (k == L"listaGrande") g_listLarge = v != 0;@@ -6289,6 +6299,7 @@ static bool HandleKey(UINT vk) {if ((alt && vk == VK_RIGHT) || (ctrl && vk == VK_OEM_6)) { GoForward(); return true; }if ((vk == VK_DELETE || (ctrl && vk == VK_BACK)) && g_tagView == VIEW_TRASH) { TrashVerb(SelectedPaths(), L"delete"); RefreshTagView(); return true; }if (vk == VK_DELETE || (ctrl && vk == VK_BACK)) { RunVerb("delete"); return true; }+ if (vk == VK_RETURN && g_enterAbre) { OpenSelection(); return true; } // issue #302: como no Exploradorif (vk == VK_RETURN || vk == VK_F2) { if (SelCount() == 1) StartRename(g_focus); return true; }if (vk == VK_SPACE && !ctrl && !alt) { QlToggle(); return true; }if (vk == VK_F5) { Reload(); return true; }@@ -7326,6 +7337,7 @@ static void FinderSettings() {items.push_back(sep);{ ctxmenu::Item c; c.label = Tr(L"Mostrar Arquivos Ocultos"); c.id = 50; c.checked = g_showHidden; c.shortcut = L"Ctrl+Shift+."; items.push_back(c); }{ ctxmenu::Item c; c.label = Tr(L"Mostrar Barra de Caminho"); c.id = 51; c.checked = g_pathBar; c.shortcut = L"Ctrl+Alt+P"; items.push_back(c); }+ { ctxmenu::Item c; c.label = Tr(L"Enter Abre o Item (F2 Renomeia)"); c.id = 52; c.checked = g_enterAbre; items.push_back(c); }RECT wr; GetWindowRect(g_hwnd, &wr);POINT pt{ wr.left + (wr.right - wr.left) / 2 - (LONG)(110 * g_scale), wr.top + (LONG)(60 * g_scale) };int id = ctxmenu::ShowItems(g_hwnd, pt, items);@@ -7356,6 +7368,9 @@ static void FinderSettings() {g_pathBar = !g_pathBar;SyncFooterH();SaveOptions();+ } else if (id == 52) {+ g_enterAbre = !g_enterAbre;+ SaveOptions();}Invalidate();}@@ -7412,7 +7427,8 @@ static void MakeBodyFormats() {static void CreateFormats() {// A fonte do macOS (SF Pro) é usada só se estiver instalada neste PC: a licença da Apple não// permite distribuí-la junto com o app. Sem ela, a Inter é a alternativa livre mais próxima.- std::wstring ui = PickFamily({ L"SF Pro Text", L"Inter", L"Segoe UI Variable Text", L"Segoe UI" });+ // issue #283: no tema Mac OS X (Leopard), Lucida (Grande no Mac; a Lucida Sans Unicode do Windows)+ std::wstring ui = PickFamily({ semaforo::Leopard() ? L"Lucida Sans Unicode" : L"SF Pro Text", L"SF Pro Text", L"Inter", L"Segoe UI Variable Text", L"Segoe UI" });g_uiFamily = ui;// Peso do corpo do texto. Com a SF Pro, Regular fica igual ao Mac (comparado com a referência);// a Inter Regular parece fina perto do macOS, então ela vai em Medium.diff --git a/src/menu/context_menu.cpp b/src/menu/context_menu.cppindex 83f0d58..a971359 100644--- a/src/menu/context_menu.cpp+++ b/src/menu/context_menu.cpp@@ -19,7 +19,8 @@#include <share.h>#include <cstdarg>#include <cmath>-#include "context_menu.h"+#include "context_menu.h"+#include "../comum/semaforo.h" // semaforo::Leopard(): a fonte do tema Mac OS X#include <d3d11.h>#include "../comum/gpu.h"#include <d2d1_1.h>@@ -1484,7 +1485,8 @@ static HRESULT InvokeCmd(HWND h, ShellMenu& sm, UINT cmd, POINT pt, const std::wstatic void PickFont() {IDWriteFontCollection* fc = nullptr;if (FAILED(g_dw->GetSystemFontCollection(&fc))) return;- for (const wchar_t* f : { L"SF Pro Text", L"Inter", L"Segoe UI Variable Text", L"Segoe UI" }) { // SF Pro só se instalada+ // issue #283: no tema Mac OS X (Leopard), Lucida (a do Windows: Lucida Sans Unicode), não a SF do macOS novo+ for (const wchar_t* f : { semaforo::Leopard() ? L"Lucida Sans Unicode" : L"SF Pro Text", L"SF Pro Text", L"Inter", L"Segoe UI Variable Text", L"Segoe UI" }) { // SF Pro só se instaladaUINT32 idx; BOOL exists = FALSE;fc->FindFamilyName(f, &idx, &exists);if (exists) { g_font = f; break; }diff --git a/src/shell/backdrop.cpp b/src/shell/backdrop.cppindex f4e0140..20f8814 100644--- a/src/shell/backdrop.cpp+++ b/src/shell/backdrop.cpp@@ -563,6 +563,12 @@ std::map<std::wstring, int> st_frameBy; // quadros por classe de j// mudando (Lively: ~58 quadros/s, o tempo todo) remonta o vidro a 30/s, não a 60: o vidro parado sobre um papel de// parede animado custava uma montagem a cada quadro da tela e roubava a fluidez das animaçõesstd::atomic<bool> st_nonDesk{ true };+// Issue #276: com um papel de parede animado (Wallpaper Engine) a placa de vídeo fica ocupada, e cada montagem do+// vidro real esperava por ela: 6 travadas de mais de 1 s em 4 min (até 5 s; medido por quem reportou). Quando só o+// papel de parede mudou, o ritmo se ajusta sozinho: a montagem demorou, a próxima espera mais (até 1 s); voltou a+// ser rápida, o ritmo sobe de novo até 30/s. Janela mexendo ou conteúdo de app atrás do vidro seguem a 60/s.+double g_papelGap = 33; // ms entre montagens quando só o papel de parede mudou+bool g_pollSoPapel = false; // a montagem pedida agora é só pelo papel de paredestd::mutex st_mx;void Dump();double CapturasMb(size_t& n); // memória de vídeo segura pelas capturas (2 quadros por janela)@@ -599,18 +605,19 @@ LRESULT CALLBACK MsgProc(HWND h, UINT m, WPARAM w, LPARAM l) {// (frameDirty, ver Poll)if (w == 1) frameDirty = true; else capDirty = true;static double last = 0;- bool soPapel = w == 1 && !capDirty && !st_nonDesk.load(); // só o papel de parede animado: 30 por segundo- double gap = soPapel ? 33.0 : 15.5;- if (anim::Now() - last >= gap) { last = anim::Now(); st_nonDesk = false; Poll(w != 1); }- else SetTimer(h, T_RG + 1, soPapel ? 33 : 16, nullptr); // cedo demais: monta no próximo tique (uma vez só)+ bool soPapel = w == 1 && !capDirty && !st_nonDesk.load(); // só o papel de parede animado: até 30 por segundo+ double gap = soPapel ? g_papelGap : 15.5;+ if (anim::Now() - last >= gap) { last = anim::Now(); g_pollSoPapel = soPapel; st_nonDesk = false; Poll(w != 1); }+ else SetTimer(h, T_RG + 1, soPapel ? (UINT)g_papelGap : 16, nullptr); // cedo demais: monta no próximo tique (uma vez só)return 0;}// o que ficou pendente; o temporizador só existe enquanto há algo (antes acordava 60 vezes/s sempre)if (m == WM_TIMER && w == T_RG + 1) {KillTimer(h, T_RG + 1);+ g_pollSoPapel = !capDirty && !st_nonDesk.load();st_nonDesk = false;Poll(false);- if (frameDirty || capDirty) SetTimer(h, T_RG + 1, 16, nullptr);+ if (frameDirty || capDirty) SetTimer(h, T_RG + 1, g_pollSoPapel && !capDirty ? (UINT)g_papelGap : 16, nullptr);return 0;}if (m == WM_TIMER && w == T_RG && g_busy) return 0;@@ -1238,7 +1245,8 @@ void Poll(bool refresh) {for (auto& a : GlassAreas()) if (!Inside(a, composed)) { capDirty = true; allDirty = true; break; }}bool go = capDirty.exchange(false);- if (!go && frameDirty && anim::Now() - lastFrameCompose >= 15) go = true;+ const bool soPapel = !go && g_pollSoPapel;+ if (!go && frameDirty && anim::Now() - lastFrameCompose >= (soPapel ? g_papelGap - 1 : 15)) go = true;if (!go) return;frameDirty = false;lastFrameCompose = anim::Now();@@ -1256,6 +1264,16 @@ void Poll(bool refresh) {double ms = anim::Now() - t0;st_msSoma += ms; st_msMax = std::max(st_msMax, ms);if (ms > 12 && slow++ < 20) Log(L"vidro real: montagem lenta, %.1f ms", ms);+ if (soPapel) { // issue #276: o ritmo do papel de parede animado segue o tempo da montagem+ double antes = g_papelGap;+ if (ms > 25) g_papelGap = std::min(1000.0, std::max(g_papelGap * 2, ms * 4));+ else if (ms < 10) g_papelGap = std::max(33.0, g_papelGap * 0.85);+ static DWORD ultimoLog = 0;+ if ((antes < 200) != (g_papelGap < 200) && GetTickCount() - ultimoLog > 60000) {+ ultimoLog = GetTickCount();+ Log(L"vidro real: papel de parede animado %ls (montagem %.0f ms, uma a cada %.0f ms)", g_papelGap >= 200 ? L"em ritmo lento" : L"em ritmo normal", ms, g_papelGap);+ }+ } else if (ms > 250) g_papelGap = std::max(g_papelGap, 250.0); // a placa está engasgada: o papel de parede espera}bool Init() {diff --git a/src/shell/janelas.cpp b/src/shell/janelas.cppindex 07bc539..186d5a7 100644--- a/src/shell/janelas.cpp+++ b/src/shell/janelas.cpp@@ -41,6 +41,8 @@ const wchar_t* EXCLUDED_EXE[] = {// VLC (issue #220): barra quebrada e o duplo clique não ia para a tela cheia com a janela pequena;// GeForce NOW (issues #195 e #197): os botões do Windows apareciam na barra e o jogo abria numa janela pequenaL"adobe premiere pro.exe", L"vlc.exe", L"geforcenow.exe",+ // PeaZip (issue #281, Lazarus/LCL): fechava com a barra do Mac; o usuário tinha de sair do WacOS para usar+ L"peazip.exe", L"pea.exe",L"explorer.exe", L"dwm.exe", L"shell.exe", L"arquivos.exe", L"ajustes.exe", L"monitoratividade.exe", L"terminal.exe", L"calculadora.exe", L"notas.exe",L"wacosshell.exe", L"wacosfinder.exe", L"wacossettings.exe", L"wacosactivitymonitor.exe", L"wacosterminal.exe", L"wacoscalculator.exe", L"wacosnotes.exe", L"wacoswindow32host.exe", L"searchhost.exe", L"startmenuexperiencehost.exe",L"snippingtool.exe", L"screenclippinghost.exe", // Ferramenta de Captura (gravação de tela parava: prints do Discord, 19/11/2026)diff --git a/src/shell/mesa.cpp b/src/shell/mesa.cppindex 62a0ff3..0fc5abc 100644--- a/src/shell/mesa.cpp+++ b/src/shell/mesa.cpp@@ -2072,6 +2072,7 @@ LRESULT CALLBACK CtlProc(HWND h, UINT m, WPARAM w, LPARAM l) {// Win+D sem o Explorador: minimiza as janelas dos apps; de novo, devolvestd::vector<HWND> g_shown;+HWND g_frenteAntes = nullptr; // a janela que estava na frente quando a mesa apareceu (issue #297)void ShowDesktopToggle() {// já voltaram por outro caminho (Dock, Alt+Tab)? Então este Win+D esconde de novo, em vez de "devolver" nadabool anyHidden = false;@@ -2082,8 +2083,25 @@ void ShowDesktopToggle() {// (SW_RESTORE: a maximizada volta maximizada; a de cima é a última, e fica com o foco)for (auto it = g_shown.rbegin(); it != g_shown.rend(); ++it) if (IsWindow(*it) && IsIconic(*it)) ShowWindowAsync(*it, SW_RESTORE);g_shown.clear();+ // issue #297: cada ShowWindowAsync roda na thread do próprio app, então a ordem de chegada não é garantida e uma+ // maximizada de outro app podia terminar na frente da janela pequena que estava ativa. Depois que todas+ // voltaram, a que estava na frente volta para a frente.+ if (HWND f = g_frenteAntes; f && IsWindow(f)) std::thread([f] {+ for (int i = 0; i < 10 && IsIconic(f); i++) Sleep(50);+ Sleep(150);+ if (IsWindow(f) && !IsIconic(f) && GetForegroundWindow() != f) {+ SetWindowPos(f, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_ASYNCWINDOWPOS);+ shell::TrazPraFrente(f);+ }+ }).detach();+ g_frenteAntes = nullptr;return;}+ { // a janela da frente (a dona, se for um diálogo): é ela que volta para a frente+ HWND f = GetForegroundWindow();+ f = f ? GetAncestor(f, GA_ROOTOWNER) : nullptr;+ g_frenteAntes = f && !apps::IsShellWindow(f) ? f : nullptr;+ }EnumWindows([](HWND h, LPARAM) -> BOOL {if (!IsWindowVisible(h) || IsIconic(h) || apps::IsShellWindow(h)) return TRUE;LONG ex = GetWindowLongW(h, GWL_EXSTYLE);diff --git a/src/shell/ui.cpp b/src/shell/ui.cppindex 5ed2bf7..374ff93 100644--- a/src/shell/ui.cpp+++ b/src/shell/ui.cpp@@ -6,6 +6,7 @@#include <shobjidl.h>#include <wincodec.h>#include "../comum/docicone.h"+#include "../comum/semaforo.h" // semaforo::Leopard(): a fonte do tema Mac OS X (issue #283)#include <d3d11_4.h>#include <dxgi1_2.h>#include <dcomp.h>@@ -34,7 +35,10 @@ static bool HasFamily(const wchar_t* name) {bool ui::Init() {if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &d2d))) return false;if (FAILED(DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), (IUnknown**)&dw))) return false;- for (auto f : { L"SF Pro Text", L"Inter", L"Segoe UI Variable Text", L"Segoe UI" }) if (HasFamily(f)) { family = f; break; }+ // issue #283: no tema Mac OS X (Leopard) todo o texto é em Lucida (Grande no Mac; a Lucida Sans Unicode do Windows+ // é o mesmo desenho), não a SF do macOS novo+ if (semaforo::Leopard() && HasFamily(L"Lucida Sans Unicode")) family = L"Lucida Sans Unicode";+ else for (auto f : { L"SF Pro Text", L"Inter", L"Segoe UI Variable Text", L"Segoe UI" }) if (HasFamily(f)) { family = f; break; }if (!HasFamily(L"Segoe Fluent Icons")) iconFamily = L"Segoe MDL2 Assets";Log(L"fonte: %ls, ícones: %ls", family.c_str(), iconFamily.c_str());// Fontes carregadas numa thread logo no começo: o DirectWrite abre o arquivo de cada fonte no primeiro textodiff --git a/src/terminal/main.cpp b/src/terminal/main.cppindex 3632a97..2c93854 100644--- a/src/terminal/main.cpp+++ b/src/terminal/main.cpp@@ -718,6 +718,7 @@ void ContextMenu(POINT screen) {}// ---- teclado: teclas especiais viram sequências VT; letras chegam pelo WM_CHAR+bool g_comeChar = false; // o próximo WM_CHAR é de um atalho Ctrl+letra que o Terminal já tratou (issue #300)bool SpecialKey(WPARAM vk) {bool ctrl = GetKeyState(VK_CONTROL) < 0, shift = GetKeyState(VK_SHIFT) < 0, alt = GetKeyState(VK_MENU) < 0;int mod = 1 + (shift ? 1 : 0) + (alt ? 2 : 0) + (ctrl ? 4 : 0);@@ -814,6 +815,9 @@ LRESULT CALLBACK WndProc(HWND h, UINT m, WPARAM w, LPARAM l) {case WM_TERM_EXIT: Log(L"shell terminou"); DestroyWindow(h); return 0; // como no Mac: fecha se o shell saiu bemcase WM_CHAR: {wchar_t c = (wchar_t)w;+ // issue #300: Ctrl+V já colou no WM_KEYDOWN; o 0x16 que o TranslateMessage manda depois chegava ao shell, e o+ // PSReadLine do PowerShell cola de novo com ele (o texto saía duas vezes). Vale para todo Ctrl+letra tratado.+ if (g_comeChar) { g_comeChar = false; if (c < 32) return 0; }if (GetKeyState(VK_CONTROL) < 0 && GetKeyState(VK_SHIFT) < 0 && c < 32) return 0; // atalhos já tratadosg_hasSel = false; g_view = 0;static wchar_t high;@@ -829,7 +833,11 @@ LRESULT CALLBACK WndProc(HWND h, UINT m, WPARAM w, LPARAM l) {case WM_SYSCHAR: { std::wstring s(1, (wchar_t)w); Send("\x1b" + Utf8(s)); return 0; } // Alt+teclacase WM_KEYDOWN: case WM_SYSKEYDOWN:if (w == VK_F4 && GetKeyState(VK_MENU) < 0) break;- if (SpecialKey(w)) { if (w != VK_PRIOR && w != VK_NEXT) { g_view = 0; } Invalidate(); return 0; }+ g_comeChar = false;+ if (SpecialKey(w)) {+ if (w >= 'A' && w <= 'Z' && GetKeyState(VK_CONTROL) < 0) g_comeChar = true; // o WM_CHAR desse atalho não vai ao shell+ if (w != VK_PRIOR && w != VK_NEXT) { g_view = 0; } Invalidate(); return 0;+ }break;case WM_MOUSEWHEEL: {int lines = GET_WHEEL_DELTA_WPARAM(w) / 120 * 3;