Skip to content

Commit 4821fbe

Browse files
authored
Merge pull request #5765 from MartinZikmund/dev/mazi/ungrab
fix(Pointers): Ignore GTK ungrab mode for window leave notification
2 parents 0bd7986 + c2eb56a commit 4821fbe

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/Uno.UI.Runtime.Skia.Gtk/GtkCoreWindowExtension.cs

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Linq;
4-
using System.Text;
5-
using System.Threading;
6-
using System.Threading.Tasks;
73
using Gdk;
84
using Gtk;
95
using Uno.Extensions;
10-
using Uno.Foundation.Extensibility;
116
using Uno.Logging;
12-
using Uno.UI.Runtime.Skia;
137
using Uno.UI.Runtime.Skia.GTK.Extensions;
14-
using Windows.ApplicationModel;
158
using Windows.Devices.Input;
16-
using Windows.Foundation;
179
using Windows.System;
18-
using Windows.UI.Composition;
1910
using Windows.UI.Core;
2011
using Windows.UI.Input;
21-
using Exception = System.Exception;
2212
using static Windows.UI.Input.PointerUpdateKind;
13+
using Exception = System.Exception;
2314

2415
namespace Uno.UI.Runtime.Skia
2516
{
@@ -96,9 +87,16 @@ private void OnWindowLeaveEvent(object o, LeaveNotifyEventArgs args)
9687
{
9788
try
9889
{
99-
if (AsPointerArgs(args.Event) is { } ptArgs)
90+
// The Ungrab mode event is triggered after click
91+
// even when the pointer does not leave the window.
92+
// This may need to be removed when we implement
93+
// native pointer capture support properly.
94+
if (args.Event.Mode != CrossingMode.Ungrab)
10095
{
101-
_ownerEvents.RaisePointerExited(ptArgs);
96+
if (AsPointerArgs(args.Event) is { } ptArgs)
97+
{
98+
_ownerEvents.RaisePointerExited(ptArgs);
99+
}
102100
}
103101
}
104102
catch (Exception e)

0 commit comments

Comments
 (0)