mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-28 03:32:45 +01:00
internal/glfwwin: remove changing the foreground lock timeout
See 58b48a3a00
Updates #2084
This commit is contained in:
parent
55657e72ae
commit
ffc9a0876a
@ -281,7 +281,6 @@ type library struct {
|
|||||||
win32 struct {
|
win32 struct {
|
||||||
helperWindowHandle windows.HWND
|
helperWindowHandle windows.HWND
|
||||||
deviceNotificationHandle _HDEVNOTIFY
|
deviceNotificationHandle _HDEVNOTIFY
|
||||||
foregroundLockTimeout uint32
|
|
||||||
acquiredMonitorCount int
|
acquiredMonitorCount int
|
||||||
clipboardString string
|
clipboardString string
|
||||||
keycodes [512]Key
|
keycodes [512]Key
|
||||||
|
@ -283,15 +283,8 @@ func isWindows10BuildOrGreaterWin32(build uint16) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func platformInit() error {
|
func platformInit() error {
|
||||||
// To make SetForegroundWindow work as we want, we need to fiddle
|
// Changing the foreground lock timeout was removed from the original code.
|
||||||
// with the FOREGROUNDLOCKTIMEOUT system setting (we do this as early
|
// See https://github.com/glfw/glfw/commit/58b48a3a00d9c2a5ca10cc23069a71d8773cc7a4
|
||||||
// as possible in the hope of still being the foreground process)
|
|
||||||
if err := _SystemParametersInfoW(_SPI_GETFOREGROUNDLOCKTIMEOUT, 0, uintptr(unsafe.Pointer(&_glfw.win32.foregroundLockTimeout)), 0); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := _SystemParametersInfoW(_SPI_SETFOREGROUNDLOCKTIMEOUT, 0, 0, _SPIF_SENDCHANGE); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
createKeyTables()
|
createKeyTables()
|
||||||
updateKeyNamesWin32()
|
updateKeyNamesWin32()
|
||||||
@ -338,12 +331,6 @@ func platformTerminate() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore previous foreground lock timeout system setting
|
|
||||||
if err := _SystemParametersInfoW(_SPI_SETFOREGROUNDLOCKTIMEOUT, 0, uintptr(_glfw.win32.foregroundLockTimeout), _SPIF_SENDCHANGE); err != nil && !errors.Is(err, windows.ERROR_ACCESS_DENIED) {
|
|
||||||
// Access-denied can happen on WSL.
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
terminateWGL()
|
terminateWGL()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user