Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

User Image
Sp3EdeR
4 discussion posts
Hello, DisplayFusion devs!

I was using a custom scripted function with a "public static async void Run(IntPtr windowHandle)" function. This function's behaviour was broken when updating to DisplayFusion v11. I had an "await" call to a TaskCompletionSource Task, but the async function no longer continues after the await call.
I converted my code to manually waiting for the task and not using async functions. Waiting for the TaskCompletionSource works fine.

Testing code below (the message is never displayed).

Code

using System;
using System.Diagnostics;
using System.Threading.Tasks;

public static class DisplayFusionFunction
{
    static Task<int> Test()
    {
        var tcs = new TaskCompletionSource<int>();
    
        var process = new Process {
            StartInfo = {
                FileName = "timeout",
                Arguments = "1"
            },
            EnableRaisingEvents = true
        };
    
        process.Exited += (sender, args) => {
            tcs.SetResult(process.ExitCode);
            process.Dispose();
        };
    
        try
        {
            process.Start();
        }
        catch
        {
            return Task.FromResult(-1);
        }
    
        return tcs.Task;
    }
    
    public static async void Run(IntPtr windowHandle)
    {
        await Test();
        System.Windows.Forms.MessageBox.Show("Successfully completed!");
    }
}
Dec 14, 2024  • #1
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
Thank you for reporting this issue, sorry to hear that it's happening with the new version. We have identified the issue and it's been fixed for the next release. We will follow-up once we have the release ready to go. Thanks!
Dec 16, 2024  • #2
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
We've released a new version that should fix this up, please let me know if you run into any issues after updating.

Thanks!
Dec 20, 2024  • #3
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(1)  Login to Vote(-)