Behavior relating to hovering is more solid

This commit is contained in:
Sasha Koshka 2023-08-12 12:15:34 -04:00
parent e126c01055
commit 00629a863d
2 changed files with 3 additions and 7 deletions

View File

@ -315,14 +315,14 @@ func (window *window) handleMotionNotify (
for _, child := range window.drags { for _, child := range window.drags {
if child == nil { continue } if child == nil { continue }
child.handleMouseMove() child.handleMouseMove()
window.hover(child)
handled = true handled = true
} }
underneath := window.boxUnder(image.Pt(x, y))
window.hover(underneath)
if !handled { if !handled {
underneath := window.boxUnder(image.Pt(x, y))
underneath.handleMouseMove() underneath.handleMouseMove()
window.hover(underneath)
} }
} }

View File

@ -119,13 +119,9 @@ func (window *window) focus (box anyBox) {
window.focused = box window.focused = box
if previous != nil { if previous != nil {
// FIXME why are we invalidating draw here
window.invalidateDraw(previous)
previous.handleFocusLeave() previous.handleFocusLeave()
} }
if box != nil && box.canBeFocused() { if box != nil && box.canBeFocused() {
// FIXME why are we invalidating draw here
window.invalidateDraw(box)
box.handleFocusEnter() box.handleFocusEnter()
} }
} }