Codeusa / Borderless-Gaming

Play your favorite games in a borderless window; no more time consuming alt-tabs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Only works for the first 5 minutes after launch

Wrascon opened this issue · comments

This program freezes after 5 minutes and goes into an unclickable window that has to be closed through the task manager. It turns out that it only works for the first 5 minutes after launch. I bought it on steam at the release, hoping that there would be fewer errors, but they still haunt me. This program runs as administrator every time I start my computer and should run all the time until I launch one of my pre-configured games. As soon as this does not happen, I check the program and each time I notice that the window does not respond to clicks, and the tray icon brings up a menu, but it also cannot be clicked. Accordingly, the window does not stretch to full screen, and the procedure for restarting it turns into finding the BorderlessGaming.exe process and starting it again so that everything works as expected, but only for the first time until the next error. Or rather, there is no error, the window simply dies and becomes inactive, it does not stretch the game and that's it. Finally, do something about it.
image
image

I can also reproduce

There is no discernable trigger to this, turning off automatic processing doesn't help, hiding processes that wont ever be maximised doesn't help. The only fix is to kill BG then restart it.

I've had this issue persist from retail Win10 x64 through to Win11 Fast Insider x64

I've been having a similar issue. I've started debugging it, and managed to trigger it under debug mode. It appears to be triggered when a process exits.

ProcessDetails.WindowHandle.get() is stuck waiting for a result from GetMainWindowForProcess on line 58 that never happens.

I suspect it is racing with ProcessHasExited. The process hasn't quite exited yet, but by the time it tries to get the window handle (to get the window title) the process is gone.

Here's the stack I caught.

[Managed to Native Transition]	
 	mscorlib.dll!System.Threading.Monitor.Wait(object obj, int millisecondsTimeout, bool exitContext)	Unknown
 	mscorlib.dll!System.Threading.Monitor.Wait(object obj, int millisecondsTimeout)	Unknown
 	mscorlib.dll!System.Threading.ManualResetEventSlim.Wait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.Tasks.Task.SpinThenBlockingWait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Threading.Tasks.Task.InternalWait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken)	Unknown
 	mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task)	Unknown
 	mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter<System.IntPtr>.GetResult()	Unknown
 	BorderlessGaming.Logic.dll!BorderlessGaming.Logic.Models.ProcessDetails.WindowHandle.get() Line 58	C#
>	BorderlessGaming.Logic.dll!BorderlessGaming.Logic.Models.ProcessDetails.ProcessDetails(System.Diagnostics.Process p, System.IntPtr hWnd) Line 32	C#
 	BorderlessGaming.Logic.dll!BorderlessGaming.Logic.Windows.ForegroundManager.WinEventProc(System.IntPtr hWinEventHook, uint eventType, System.IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime) Line 35	C#
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData)	Unknown
 	System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context)	Unknown
 	System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context)	Unknown
 	System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm)	Unknown
 	BorderlessGaming.exe!BorderlessGaming.Program.Main() Line 31	C#

I'm guessing this is related to "Slow Window Detection", also mentioned here #577

commented

This will be fixed in 10.0