However, this causes requiring an extra click to trigger if the image is in another window (including across 2 sides of split layout). Other clickable widgets do not behave this way. Replacing IsWindowFocused by IsWindowHovered should fix this issue.
What happend?
For the onClick function to trigger, the current check requires the window to be in focus: https://github.com/AllenDang/giu/blob/cdbcd33dbed76caf1b0d105804cdde4ccd4c5fee/ImageWidgets.go#L88-L129
However, this causes requiring an extra click to trigger if the image is in another window (including across 2 sides of split layout). Other clickable widgets do not behave this way. Replacing IsWindowFocused by IsWindowHovered should fix this issue.
Code example
```golang package main import ( "runtime" "github.com/AllenDang/giu" ) var split1 float32 = 200 var split2 float32 = 200 var texture = giu.ReflectiveBoundTexture{} func loop() { giu.Window("A").Size(500, 500).Layout(giu.SplitLayout(giu.DirectionHorizontal, &split1, giu.Layout{ texture.ToImageWidget().OnClick(func() { fmt.Println("clicked A1 Image") }), }, giu.Layout{ texture.ToImageWidget().OnClick(func() { fmt.Println("clicked A2 Image") }), })) giu.Window("B").Size(500, 500).Layout(giu.SplitLayout(giu.DirectionHorizontal, &split1, giu.Layout{ texture.ToImageWidget().OnClick(func() { fmt.Println("clicked B1 Image") }), }, giu.Layout{ texture.ToImageWidget().OnClick(func() { fmt.Println("clicked B2 Image") }), })) } func main() { runtime.LockOSThread() wnd := giu.NewMasterWindow("test", 800, 800, 0) wnd.Run(loop) } ```main.go
To Reproduce
Version
master
OS
Windows 10