shiny: windriver: close client windows
After receiving a close request from the window manager,
DestroyWindow must be called to actually close the window.
This is done by DefWindowProc.
Fixes golang/go#25587
Change-Id: I05c95046ce4572fec0cba67eba2d313f318e36ba
Reviewed-on: https://go-review.googlesource.com/115515
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/shiny/driver/internal/win32/win32.go b/shiny/driver/internal/win32/win32.go
index 5836073..3fc939b 100644
--- a/shiny/driver/internal/win32/win32.go
+++ b/shiny/driver/internal/win32/win32.go
@@ -170,8 +170,11 @@
}
func sendClose(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr) {
+ // TODO(ktye): DefWindowProc calls DestroyWindow by default.
+ // To intercept destruction of the window, return 0 and call
+ // DestroyWindow when appropriate.
LifecycleEvent(hwnd, lifecycle.StageDead)
- return 0
+ return _DefWindowProc(hwnd, uMsg, wParam, lParam)
}
func sendMouseEvent(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr) {