Skip to content

Commit

Permalink
fix: Avoid processing GTK events before dispatching
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Feb 8, 2023
1 parent 6e30245 commit 293c310
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/Uno.UI.Runtime.Skia.Gtk/GtkHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void Run()

_window.DeleteEvent += WindowClosing;

Windows.UI.Core.CoreDispatcher.DispatchOverride = DispatchNative;
Windows.UI.Core.CoreDispatcher.DispatchOverride = DispatchNativeSingle;
Windows.UI.Core.CoreDispatcher.HasThreadAccessOverride = () => _isDispatcherThread;

_window.WindowStateEvent += OnWindowStateChanged;
Expand Down Expand Up @@ -158,16 +158,6 @@ private bool InitializeGtk()
}
}

void DispatchNative(System.Action d)
{
if (Gtk.Application.EventsPending())
{
Gtk.Application.RunIteration(false);
}

DispatchNativeSingle(d);
}

private void DispatchNativeSingle(System.Action d)
=> GLib.Idle.Add(delegate
{
Expand Down

0 comments on commit 293c310

Please sign in to comment.