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

Rust source: NVIDIA Control Panel fix (in build-66)

Eternity070628a6c3191e906d
diff --git a/rust-teste/shell/src/principal.rs b/rust-teste/shell/src/principal.rs
index 12dbb8d..c079713 100644
--- a/rust-teste/shell/src/principal.rs
+++ b/rust-teste/shell/src/principal.rs
@@ -712,8 +712,44 @@ static PAINEL_NO_WIN: AtomicBool = AtomicBool::new(false);
/// pedido de 02/12/2026 ("remova o atalho do próprio Windows para abrir o Iniciar"): com a tecla Windows do WacOS, o
/// Iniciar/Pesquisa do Windows que vier à frente até 1,5 s depois de um Win sozinho é fechado na hora; se nem o
/// Launchpad nem o Spotlight abriu (o gancho não viu a tecla), a ação do Win é feita aqui
+/// pedido de 02/12/2026: no modo escuro de apps do Windows, o Painel de Controle NVIDIA marca o diálogo da lista "Select a
+/// Task" (filho #32770) como janela em camadas e nunca lhe dá opacidade, e ele sai todo preto. Dar opacidade total a esses
+/// filhos em camadas faz a lista aparecer (testado: SetLayeredWindowAttributes de fora funciona)
+unsafe fn conserta_nvidia(top: HWND) {
+ unsafe extern "system" fn filho(h: HWND, _: LPARAM) -> BOOL {
+ let ex = GetWindowLongW(h, GWL_EXSTYLE) as u32;
+ let st = GetWindowLongW(h, GWL_STYLE) as u32;
+ if ex & WS_EX_LAYERED.0 != 0 && st & WS_CHILD.0 != 0 {
+ let (mut k, mut a, mut f) = (COLORREF(0), 0u8, LAYERED_WINDOW_ATTRIBUTES_FLAGS(0));
+ if GetLayeredWindowAttributes(h, Some(&mut k), Some(&mut a), Some(&mut f)).is_err() || (f.0 & LWA_ALPHA.0 != 0 && a == 0) {
+ let _ = SetLayeredWindowAttributes(h, COLORREF(0), 255, LWA_ALPHA);
+ let _ = RedrawWindow(h, None, None, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN | RDW_FRAME);
+ }
+ }
+ TRUE
+ }
+ let _ = EnumChildWindows(top, Some(filho), LPARAM(0));
+}
unsafe extern "system" fn iniciar_evento(_: HWINEVENTHOOK, _ev: u32, h: HWND, obj: i32, _: i32, _: u32, _: u32) {
- if obj != 0 || h.0.is_null() || !FULL_HOOK.load(Ordering::Relaxed) {
+ if obj != 0 || h.0.is_null() {
+ return;
+ }
+ {
+ let mut pid = 0u32;
+ GetWindowThreadProcessId(h, Some(&mut pid));
+ if crate::apps::exe_of_pid(pid).to_lowercase().ends_with("nvcplui.exe") {
+ conserta_nvidia(h);
+ let hh = h.0 as isize;
+ std::thread::spawn(move || {
+ for _ in 0..3 {
+ std::thread::sleep(std::time::Duration::from_millis(700)); // a lista é criada um pouco depois
+ conserta_nvidia(HWND(hh as *mut _));
+ }
+ });
+ return;
+ }
+ }
+ if !FULL_HOOK.load(Ordering::Relaxed) {
return;
}
if GetTickCount().wrapping_sub(ULTIMO_WIN.load(Ordering::Relaxed)) > 1500 {