Skip to content

Commit

Permalink
Use EtoInvoker instead of SyncContextInvoker
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Dec 8, 2023
1 parent 7870de3 commit fdcec85
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 40 deletions.
2 changes: 0 additions & 2 deletions NAPS2.Lib.Gtk/EtoForms/Ui/GtkDesktopForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public GtkDesktopForm(

protected override void OnLoad(EventArgs e)
{
// TODO: What's the best place to initialize this? It needs to happen from the UI event loop.
Invoker.Current = new SyncContextInvoker(SynchronizationContext.Current!);
base.OnLoad(e);
var listView = (GtkListView<UiImage>) _listView;
listView.NativeControl.StyleContext.AddClass("desktop-listview");
Expand Down
7 changes: 0 additions & 7 deletions NAPS2.Lib.Mac/EtoForms/Ui/MacDesktopForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ public MacDesktopForm(
_thumbnailController.Oversample = 2.0;
}

protected override void OnLoad(EventArgs e)
{
// TODO: What's the best place to initialize this? It needs to happen from the UI event loop.
Invoker.Current = new SyncContextInvoker(SynchronizationContext.Current!);
base.OnLoad(e);
}

protected override void UpdateTitle(ScanProfile? defaultProfile)
{
Title = UiStrings.Naps2;
Expand Down
2 changes: 1 addition & 1 deletion NAPS2.Lib/EtoForms/EtoPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ public virtual void InitializePlatform()

public virtual void RunApplication(Application application, Form mainForm)
{
Invoker.Current = new EtoInvoker(application);
application.Run(mainForm);
}

public virtual void RunApplication(Application application)
{
// TODO: Can we use EtoInvoker more generally and get rid of some of the platform-specific stuff?
Invoker.Current = new EtoInvoker(application);
application.Run();
}
Expand Down
30 changes: 0 additions & 30 deletions NAPS2.Sdk/Threading/SyncContextInvoker.cs

This file was deleted.

0 comments on commit fdcec85

Please sign in to comment.