From 00629a863d16817d699133306d51e953a0d64533 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sat, 12 Aug 2023 12:15:34 -0400 Subject: [PATCH] Behavior relating to hovering is more solid --- event.go | 6 +++--- system.go | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/event.go b/event.go index 26df879..d83bdd6 100644 --- a/event.go +++ b/event.go @@ -315,14 +315,14 @@ func (window *window) handleMotionNotify ( for _, child := range window.drags { if child == nil { continue } child.handleMouseMove() - window.hover(child) handled = true } + underneath := window.boxUnder(image.Pt(x, y)) + window.hover(underneath) + if !handled { - underneath := window.boxUnder(image.Pt(x, y)) underneath.handleMouseMove() - window.hover(underneath) } } diff --git a/system.go b/system.go index 3eea89c..2c7c57f 100644 --- a/system.go +++ b/system.go @@ -119,13 +119,9 @@ func (window *window) focus (box anyBox) { window.focused = box if previous != nil { - // FIXME why are we invalidating draw here - window.invalidateDraw(previous) previous.handleFocusLeave() } if box != nil && box.canBeFocused() { - // FIXME why are we invalidating draw here - window.invalidateDraw(box) box.handleFocusEnter() } }