Skip to content

Collapsed window prevents windows underneath it from gaining focus #55

Closed

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

  1. added this to the v0.3.1 milestone on Sep 26, 2026
  2. hajimehoshi commented on Sep 26, 2026

    @hajimehoshi
    Member

    Confirmed

  3. iamhuman-cheolheelee commented on Sep 26, 2026

    @iamhuman-cheolheelee

    Opened #56 for this.

  4. added a commit that references this issue on Sep 26, 2026
    4233e17
  5. hajimehoshi commented on Sep 26, 2026

    @hajimehoshi
    Member

    Try 4233e17202b25a4253d1205aeaa54395d8205c64 until I release v0.3.1 a few days later. Thanks,

  6. venning commented on Sep 26, 2026

    @venning
    Author

    Confirmed 4233e17202b25a4253d1205aeaa54395d8205c64 fixes the issue.

  7. added a commit that references this issue on Sep 26, 2026
    5b80bc7
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

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions