internal/glfwwin: remove the call of RemovePropW

This is unnecessary, and doesn't work on Xbox.

Also DestroyWindow doesn't work on Xbox so skip this on Xbox.

Updates #2084
This commit is contained in:
Hajime Hoshi 2022-07-30 18:30:46 +09:00
parent a0546fc594
commit 95fb4370db
3 changed files with 8 additions and 22 deletions

View File

@ -821,7 +821,6 @@ var (
procRegisterRawInputDevices = user32.NewProc("RegisterRawInputDevices") procRegisterRawInputDevices = user32.NewProc("RegisterRawInputDevices")
procReleaseCapture = user32.NewProc("ReleaseCapture") procReleaseCapture = user32.NewProc("ReleaseCapture")
procReleaseDC = user32.NewProc("ReleaseDC") procReleaseDC = user32.NewProc("ReleaseDC")
procRemovePropW = user32.NewProc("RemovePropW")
procScreenToClient = user32.NewProc("ScreenToClient") procScreenToClient = user32.NewProc("ScreenToClient")
procSendMessageW = user32.NewProc("SendMessageW") procSendMessageW = user32.NewProc("SendMessageW")
procSetCapture = user32.NewProc("SetCapture") procSetCapture = user32.NewProc("SetCapture")
@ -1498,22 +1497,6 @@ func _ReleaseDC(hWnd windows.HWND, hDC _HDC) int32 {
return int32(r) return int32(r)
} }
func _RemovePropW(hWnd windows.HWND, str string) windows.Handle {
var lpString *uint16
if str != "" {
var err error
lpString, err = windows.UTF16PtrFromString(str)
if err != nil {
panic("glfwwin: str must not include a NUL character")
}
}
r, _, _ := procRemovePropW.Call(uintptr(hWnd), uintptr(unsafe.Pointer(lpString)))
runtime.KeepAlive(lpString)
return windows.Handle(r)
}
func _RtlVerifyVersionInfo(versionInfo *_OSVERSIONINFOEXW, typeMask uint32, conditionMask uint64) int32 { func _RtlVerifyVersionInfo(versionInfo *_OSVERSIONINFOEXW, typeMask uint32, conditionMask uint64) int32 {
var r uintptr var r uintptr
if unsafe.Sizeof(uintptr(0)) == unsafe.Sizeof(uint64(0)) { if unsafe.Sizeof(uintptr(0)) == unsafe.Sizeof(uint64(0)) {

View File

@ -295,8 +295,10 @@ func platformTerminate() error {
} }
if _glfw.win32.helperWindowHandle != 0 { if _glfw.win32.helperWindowHandle != 0 {
if err := _DestroyWindow(_glfw.win32.helperWindowHandle); err != nil { if !microsoftgdk.IsXbox() {
return err if err := _DestroyWindow(_glfw.win32.helperWindowHandle); err != nil {
return err
}
} }
} }

View File

@ -1428,9 +1428,10 @@ func (w *Window) platformDestroyWindow() error {
} }
if w.win32.handle != 0 { if w.win32.handle != 0 {
_RemovePropW(w.win32.handle, "GLFW") if !microsoftgdk.IsXbox() {
if err := _DestroyWindow(w.win32.handle); err != nil { if err := _DestroyWindow(w.win32.handle); err != nil {
return err return err
}
} }
delete(handleToWindow, w.win32.handle) delete(handleToWindow, w.win32.handle)
w.win32.handle = 0 w.win32.handle = 0