Skip to content

Commit 1697254

Browse files
committed
[GDI] ReleaseDC
1 parent 607e4f5 commit 1697254

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

dlls/user32/extras.hexa

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,24 @@ fun setCapture(stub SizeOfPointer) SizeOfPointer {
556556
fun releaseDC(hWnd HWnd, hdc HDc) Int32 {
557557
// TODO Release device context
558558
tofitaDebugLog("ReleaseDC called with hWnd %8 hdc %8".utf16(), hWnd as! UInt64, hdc as! UInt64)
559+
560+
var window = handleToWindow(hWnd)
561+
if window == null {
562+
return 0
563+
}
564+
565+
while window.parent != null {
566+
window = window.parent
567+
}
568+
569+
// Force refresh
570+
// TODO probably detect if someone was drawing on the DC
571+
let dc = window.dc
572+
let fb = dc.fb.ref
573+
// TODO Let syscall payload be different type, not `fb`'s user-space type
574+
njraaSwapWindowFramebuffer(fb)
575+
576+
return 1
559577
}
560578

561579
@dllExport('ReleaseCapture')

0 commit comments

Comments
 (0)