Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/Avalonia.X11/X11Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,15 @@ private void OnEvent(ref XEvent ev)
else if (ev.type == XEventName.MotionNotify)
MouseEvent(RawPointerEventType.Move, ref ev, ev.MotionEvent.state);
else if (ev.type == XEventName.LeaveNotify)
MouseEvent(RawPointerEventType.LeaveWindow, ref ev, ev.CrossingEvent.state);
{
if (IsHandledLeaveEnterDetail(ev.CrossingEvent.detail))
{
MouseEvent(RawPointerEventType.LeaveWindow, ref ev, ev.CrossingEvent.state);
}
}
else if (ev.type == XEventName.EnterNotify)
{
if (ev.CrossingEvent.detail is
NotifyDetail.NotifyNonlinear or
NotifyDetail.NotifyNonlinearVirtual or
NotifyDetail.NotifyVirtual)
if (IsHandledLeaveEnterDetail(ev.CrossingEvent.detail))
{
MouseEvent(RawPointerEventType.Move, ref ev, ev.CrossingEvent.state);
}
Expand Down Expand Up @@ -758,6 +760,13 @@ NotifyDetail.NotifyNonlinearVirtual or
}
}

private static bool IsHandledLeaveEnterDetail(NotifyDetail detail)
=> detail is
NotifyDetail.NotifyNonlinear or
NotifyDetail.NotifyNonlinearVirtual or
NotifyDetail.NotifyVirtual or
NotifyDetail.NotifyAncestor;

private void HandleActivation(bool active)
{
if (active)
Expand Down
3 changes: 2 additions & 1 deletion src/Avalonia.X11/XI2Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ private void OnEnterLeaveEvent(IXI2Client client, ref XIEnterLeaveEvent ev)
var detail = ev.detail;
if (detail != XiEnterLeaveDetail.XINotifyNonlinearVirtual &&
detail != XiEnterLeaveDetail.XINotifyNonlinear &&
detail != XiEnterLeaveDetail.XINotifyVirtual)
detail != XiEnterLeaveDetail.XINotifyVirtual &&
detail != XiEnterLeaveDetail.XINotifyAncestor)
return;

var buttons = ParsedDeviceEvent.ParseButtonState(ev.buttons.MaskLen, ev.buttons.Mask);
Expand Down