Thanks for the clear reproduction. The project and the screen recording made it easy to see exactly what's happening 🙂
The short version: Visible is working as designed here, but you've found a real gap in the Window API.
Window.Visible answers the question "is this window shown or hidden?" - it's affected by Show(), Hide() and Close(). Minimising a window doesn't hide it: it's still open and shown from the app's point of view, it's just parked in the Dock. So after you minimise Window2, w.Visible correctly returns True. This matches Xojo, where a minimised window also reports Visible = True and you'd read the window's Minimised property instead.
That's the gap: Objo's Window already has read-only IsMaximised and IsFullScreen properties alongside the Minimise() / Restore() methods, but there's currently no way to ask "is this window minimised right now?" - which is why Visible was the only thing available to try.
I've logged a feature request to add a read-only IsMinimised property that reports True only while the window is in the minimised state, so your button will become:
If w.IsMinimised Then
MessageBox("Window2 is minimised")
End If
Until that ships, there's unfortunately no reliable way to detect the minimised state from code - Visible only turns False after w.Hide() or w.Close().
https://feedback.objo.dev/feature/1587