@@ -605,13 +605,15 @@ private void OnEvent(ref XEvent ev)
605605 else if ( ev . type == XEventName . MotionNotify )
606606 MouseEvent ( RawPointerEventType . Move , ref ev , ev . MotionEvent . state ) ;
607607 else if ( ev . type == XEventName . LeaveNotify )
608- MouseEvent ( RawPointerEventType . LeaveWindow , ref ev , ev . CrossingEvent . state ) ;
608+ {
609+ if ( IsHandledLeaveEnterDetail ( ev . CrossingEvent . detail ) )
610+ {
611+ MouseEvent ( RawPointerEventType . LeaveWindow , ref ev , ev . CrossingEvent . state ) ;
612+ }
613+ }
609614 else if ( ev . type == XEventName . EnterNotify )
610615 {
611- if ( ev . CrossingEvent . detail is
612- NotifyDetail . NotifyNonlinear or
613- NotifyDetail . NotifyNonlinearVirtual or
614- NotifyDetail . NotifyVirtual )
616+ if ( IsHandledLeaveEnterDetail ( ev . CrossingEvent . detail ) )
615617 {
616618 MouseEvent ( RawPointerEventType . Move , ref ev , ev . CrossingEvent . state ) ;
617619 }
@@ -758,6 +760,13 @@ NotifyDetail.NotifyNonlinearVirtual or
758760 }
759761 }
760762
763+ private static bool IsHandledLeaveEnterDetail ( NotifyDetail detail )
764+ => detail is
765+ NotifyDetail . NotifyNonlinear or
766+ NotifyDetail . NotifyNonlinearVirtual or
767+ NotifyDetail . NotifyVirtual or
768+ NotifyDetail . NotifyAncestor ;
769+
761770 private void HandleActivation ( bool active )
762771 {
763772 if ( active )
0 commit comments