[GH-ISSUE #1225] [Bug] S2G hangs in loop with various exceptions #3288

Open
opened 2026-03-01 19:09:35 +03:00 by kerem · 0 comments
Owner

Originally created by @Hefaistos68 on GitHub (Sep 11, 2023).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1225

Originally assigned to: @NickeManarin on GitHub.

Describe the bug
Set recording to "window" (chrome.exe), user interaction. Then start recording, switch to the previously selected chrome window, press F11, S2G error pops -> see sequence of error messages as screenshots. Anyway, the only way to get rid of S2G is killing it. I suspect that on exception it doesnt stop listening for user interactions, thus creating new exceptions with every key or mouse click.

   at System.Threading.Tasks.Task.Dispose(Boolean disposing)
   at System.Threading.Tasks.Task.Dispose()
   at ScreenToGif.Capture.BaseCapture.DisposeInternal() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Capture\BaseCapture.cs:line 175
   at ScreenToGif.Capture.BaseCapture.DisposeAsync() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Capture\BaseCapture.cs:line 184
   at ScreenToGif.Windows.NewRecorder.PrepareCapture(Boolean isNew) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\NewRecorder.xaml.cs:line 1394
   at ScreenToGif.Windows.NewRecorder.Snap() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\NewRecorder.xaml.cs:line 1166

another one:

   at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
   at System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters parameters)
   at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Window.Show()
   at System.Windows.Window.ShowDialog()
   at ScreenToGif.Windows.Other.ErrorDialog.Ok(String title, String instruction, String observation, Exception exception, Icons icon) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\Other\ErrorDialog.xaml.cs:line 95
   at ScreenToGif.Windows.NewRecorder.Snap() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\NewRecorder.xaml.cs:line 1174
   at ScreenToGif.Windows.NewRecorder.KeyHookTarget(Object sender, CustomKeyEventArgs e) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\NewRecorder.xaml.cs:line 563
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Screenshots as they appear in order
image
image
image
image
(well, at least it completed successfully)

Desktop (please complete the following information):

  • OS: Edition Windows 10 Enterprise
    Version 20H2
    OS build 19042.2965
    Experience Windows Feature Experience Pack 1000.19041.1000.0
  • Version 2.38.1
Originally created by @Hefaistos68 on GitHub (Sep 11, 2023). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1225 Originally assigned to: @NickeManarin on GitHub. **Describe the bug** Set recording to "window" (chrome.exe), user interaction. Then start recording, switch to the previously selected chrome window, press F11, S2G error pops -> see sequence of error messages as screenshots. Anyway, the only way to get rid of S2G is killing it. I suspect that on exception it doesnt stop listening for user interactions, thus creating new exceptions with every key or mouse click. ``` at System.Threading.Tasks.Task.Dispose(Boolean disposing) at System.Threading.Tasks.Task.Dispose() at ScreenToGif.Capture.BaseCapture.DisposeInternal() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Capture\BaseCapture.cs:line 175 at ScreenToGif.Capture.BaseCapture.DisposeAsync() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Capture\BaseCapture.cs:line 184 at ScreenToGif.Windows.NewRecorder.PrepareCapture(Boolean isNew) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\NewRecorder.xaml.cs:line 1394 at ScreenToGif.Windows.NewRecorder.Snap() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\NewRecorder.xaml.cs:line 1166 ``` another one: ``` at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks) at System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters parameters) at System.Windows.Window.CreateSourceWindow(Boolean duringShow) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.Show() at System.Windows.Window.ShowDialog() at ScreenToGif.Windows.Other.ErrorDialog.Ok(String title, String instruction, String observation, Exception exception, Icons icon) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\Other\ErrorDialog.xaml.cs:line 95 at ScreenToGif.Windows.NewRecorder.Snap() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\NewRecorder.xaml.cs:line 1174 at ScreenToGif.Windows.NewRecorder.KeyHookTarget(Object sender, CustomKeyEventArgs e) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\NewRecorder.xaml.cs:line 563 at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) ``` **Screenshots as they appear in order** ![image](https://github.com/NickeManarin/ScreenToGif/assets/8855055/528ff2c7-5a74-4863-831a-e01e16220499) ![image](https://github.com/NickeManarin/ScreenToGif/assets/8855055/74d8fb34-c845-4a8a-abda-c9611e1684bc) ![image](https://github.com/NickeManarin/ScreenToGif/assets/8855055/218d155f-7a8c-4990-aa2b-8bf52e71ab32) ![image](https://github.com/NickeManarin/ScreenToGif/assets/8855055/394f396c-979c-4e2f-ab92-739ac3dbdf80) (well, at least it completed successfully) **Desktop (please complete the following information):** - OS: Edition Windows 10 Enterprise Version 20H2 OS build 19042.2965 Experience Windows Feature Experience Pack 1000.19041.1000.0 - Version 2.38.1
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#3288
No description provided.