fix(gpu): present to the title's window, not a pseudoconsole's 0x0 window

title_window() took the first visible top-level window of the process.
Started under a pseudoconsole (Windows Terminal, or a parent that has
one), the process also owns a visible PseudoConsoleWindow of 0x0 pixels;
when that one was above the title's window in z-order, the swap chain was
made for it and the title's window stayed white.

The title's window is now the one our window procedure hook marked
(victory.wndproc); without one, the first visible window with a client
area. The choice is a pure function with unit tests.

(cherry picked from commit 6cd5231aedd2e2636a1cd2b849c8ce3000369a36)
This commit is contained in:
JRamos1993 authored and trustno1-coder committed 2026-11-27 17:51:23 -08:00
1 parent 74d6f2408b
commit 3f054e4677
2 files changed
+80 -7

No files matched your search

+3 -1
View File
@@ -94,7 +94,9 @@ pub extern "system" fn UnregisterAppConstrainedChangeNotification(registration:
constrained().retain(|&(id, ..)| id != registration);
}
/// The window procedure a title window had before ours.
/// The window procedure a title window had before ours. `victory_gpu`'s
/// `title_window` looks for this property by its name too, to know the
/// title's window from the others of the process.
const TITLE_PROC: PCWSTR = w!("victory.wndproc");
/// Fullscreen, the English keyboard and the mouse capture are asked for