fix(ffi): avoid infinite loop in HandleClipboardEvents when not on Windows (#846)

When running on non-Windows, HandleClipboardEvents will create an
infinite loop consuming 100% CPU.
Now, we call HandleClipboardEvents only when on Windows.
This commit is contained in:
Miha Markič 2025-06-28 17:51:57 +02:00 committed by GitHub
parent 76a2a0b47b
commit 4260537c90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -112,7 +112,10 @@ public partial class MainWindow : Window
this._activeStage = ActiveStage.New(res);
this._framed = framed;
ReadPduAndProcessActiveStage();
HandleClipboardEvents();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
HandleClipboardEvents();
}
});
}