mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-09-26 20:11:28 +08:00
internal/ui: bug fix: initialize passthrough attrib after window creation
Closes #3222
This commit is contained in:
@@ -1136,14 +1136,6 @@ func (u *UserInterface) initOnMainThread(options *RunOptions) error {
|
||||
return err
|
||||
}
|
||||
|
||||
mousePassthrough := glfw.False
|
||||
if u.isInitWindowMousePassthrough() {
|
||||
mousePassthrough = glfw.True
|
||||
}
|
||||
if err := glfw.WindowHint(glfw.MousePassthrough, mousePassthrough); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Set the window visible explicitly or the application freezes on Wayland (#974).
|
||||
if os.Getenv("WAYLAND_DISPLAY") != "" {
|
||||
if err := glfw.WindowHint(glfw.Visible, glfw.True); err != nil {
|
||||
@@ -1155,6 +1147,16 @@ func (u *UserInterface) initOnMainThread(options *RunOptions) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// glfw.WindowHint(glfw.MousePassthrough, ...) doesn't work on some Linux machine (#3222).
|
||||
// Set this attribute after creating a window.
|
||||
mousePassthrough := glfw.False
|
||||
if u.isInitWindowMousePassthrough() {
|
||||
mousePassthrough = glfw.True
|
||||
}
|
||||
if err := u.window.SetAttrib(glfw.MousePassthrough, mousePassthrough); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Maximizing a window requires a proper size and position. Call Maximize here (#1117).
|
||||
if u.isInitWindowMaximized() {
|
||||
if err := u.window.Maximize(); err != nil {
|
||||
|
Reference in New Issue
Block a user