Skip to content

Collapsed window prevents windows underneath it from gaining focus #55

Description

@venning

If you have a window that is on top of another window and then use the title bar to collapse it, the windows underneath it cannot gain focus to "move to the top" of the stack. Meaning, you can't interact with their elements nor can you interact with their title bars to move them.

Once you move the collapsed window to the side and click on an "underneath" window once, it is now on top of the stack and can be interacted with and moved.


Reproducible example:

package main

import (
	"fmt"
	"image"

	"github.com/ebitengine/debugui"
	"github.com/hajimehoshi/ebiten/v2"
)

var count int

type Game struct {
	debugui debugui.DebugUI
}

func (g *Game) Update() error {
	_, err := g.debugui.Update(func(ctx *debugui.Context) error {
		ctx.Window("Bottom", image.Rect(50, 70, 260, 180), func(layout debugui.ContainerLayout) {
			ctx.Button(fmt.Sprintf("pushed %d times", count)).On(func() { count++ })
		})
		ctx.Window("Top", image.Rect(0, 0, 320, 240), func(layout debugui.ContainerLayout) {
			ctx.Text("first, collapse this window")
		})
		return nil
	})
	return err
}

func (g *Game) Draw(screen *ebiten.Image) {
	g.debugui.Draw(screen)
}

func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int) {
	return outsideWidth, outsideHeight
}

func main() {
	if err := ebiten.RunGame(&Game{}); err != nil {
		panic(err)
	}
}

Notes:

Ebitengine v2.10.3
DebugUI v0.3.0
Go go1.27.0 darwin/arm64
macOS 15.8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions