mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 10:42:42 +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 {
|
||||
helperWindowHandle windows.HWND
|
||||
deviceNotificationHandle _HDEVNOTIFY
|
||||
foregroundLockTimeout uint32
|
||||
acquiredMonitorCount int
|
||||
clipboardString string
|
||||
keycodes [512]Key
|
||||
|
@ -283,15 +283,8 @@ func isWindows10BuildOrGreaterWin32(build uint16) bool {
|
||||
}
|
||||
|
||||
func platformInit() error {
|
||||
// To make SetForegroundWindow work as we want, we need to fiddle
|
||||
// with the FOREGROUNDLOCKTIMEOUT system setting (we do this as early
|
||||
// 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
|
||||
}
|
||||
// Changing the foreground lock timeout was removed from the original code.
|
||||
// See https://github.com/glfw/glfw/commit/58b48a3a00d9c2a5ca10cc23069a71d8773cc7a4
|
||||
|
||||
createKeyTables()
|
||||
updateKeyNamesWin32()
|
||||
@ -338,12 +331,6 @@ func platformTerminate() error {
|
||||
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()
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user