mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-13 22:47:26 +01:00
internal/ui: bug fix: InitUnfocused option didn't work
Updates #2924 Closes #3099
This commit is contained in:
parent
99ffe09b63
commit
e90f99bd4a
@ -81,6 +81,8 @@ type userInterfaceImpl struct {
|
|||||||
initWindowMaximized bool
|
initWindowMaximized bool
|
||||||
initWindowMousePassthrough bool
|
initWindowMousePassthrough bool
|
||||||
|
|
||||||
|
initUnfocused bool
|
||||||
|
|
||||||
// bufferOnceSwapped must be accessed from the main thread.
|
// bufferOnceSwapped must be accessed from the main thread.
|
||||||
bufferOnceSwapped bool
|
bufferOnceSwapped bool
|
||||||
updateOnceCalled bool
|
updateOnceCalled bool
|
||||||
@ -1120,6 +1122,7 @@ func (u *UserInterface) initOnMainThread(options *RunOptions) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u.initUnfocused = options.InitUnfocused
|
||||||
focused := glfw.True
|
focused := glfw.True
|
||||||
if options.InitUnfocused {
|
if options.InitUnfocused {
|
||||||
focused = glfw.False
|
focused = glfw.False
|
||||||
@ -1325,9 +1328,11 @@ func (u *UserInterface) update() (float64, float64, error) {
|
|||||||
if err = u.window.Show(); err != nil {
|
if err = u.window.Show(); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if !u.initUnfocused {
|
||||||
if err = u.window.Focus(); err != nil {
|
if err = u.window.Focus(); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" || runtime.GOOS == "windows" {
|
if runtime.GOOS == "darwin" || runtime.GOOS == "windows" {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user