Skip to content

System.InvalidOperationException: Cannot re-show a closed window. #477

@Tony763

Description

@Tony763

Is there an existing issue for this?

  • I have searched the existing issues.

What happened?

Builded 00b622a for OpenSUSE Tumbleweed 20260410-0 Gnome 50 Wayland

UI opens, but when selecting Region> Region error emerge. Same goes for other functions.

What did you expect?

Select region to capture

Version

Building from Source

Relevant log output

Region > Region:
System.InvalidOperationException: Cannot re-show a closed window.
   at Avalonia.Controls.Window.EnsureStateBeforeShow() + 0x33
   at Avalonia.Controls.Window.ShowCore[TResult](Window, Boolean) + 0x89
   at Avalonia.Controls.Window.IsVisibleChanged(AvaloniaPropertyChangedEventArgs) + 0x4d
   at Avalonia.Controls.Window.OnPropertyChanged(AvaloniaPropertyChangedEventArgs) + 0x21
   at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1, Optional`1, BindingValue`1, BindingPriority, Boolean) + 0x83
   at Avalonia.PropertyStore.EffectiveValue`1.NotifyValueChanged(ValueStore, StyledProperty`1, T) + 0x80
   at Avalonia.PropertyStore.ValueStore.SetLocalValue[T](StyledProperty`1, T) + 0xb1
   at Avalonia.PropertyStore.ValueStore.SetValue[T](StyledProperty`1, T, BindingPriority) + 0x68
   at SnapX.Avalonia.Views.RegionSelectorWindow.<OnOpened>d__20.MoveNext() + 0x7e
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__124_0(Object state) + 0x17
   at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore() + 0x3c

Region > Monitor:
[23:11:15 INF] Selecting: Monitor
[23:11:15 INF] Executing: Monitor
[23:11:15 INF] GetCursorPosition returned Point [ X=6422, Y=1418 ]
Request path: /org/freedesktop/portal/desktop/request/1_243/t
Got t{ }
[23:11:15 ERR] System.Collections.Generic.KeyNotFoundException: The given key 'uri' was not present in the dictionary.
   at SnapX.Core.SharpCapture.Linux.LinuxCapture.<TakeScreenshotWithPortal>d__1.MoveNext() + 0x694
--- End of stack trace from previous location ---
   at SnapX.Core.SharpCapture.Linux.LinuxCapture.<CaptureFullscreen>d__0.MoveNext() + 0x13c
[23:11:15 ERR] System.Exception: XGetImage failed for area 16384x3456 at 0,0.
   at SnapX.Core.Utils.Native.LinuxAPI.CaptureAreaInternal(IntPtr, IntPtr, Int32, Int32, Int32, Int32) + 0x254
   at SnapX.Core.Utils.Native.LinuxAPI.TakeFullscreenScreenshot() + 0x1d8
   at SnapX.Core.SharpCapture.Linux.LinuxCapture.<CaptureFullscreen>d__0.MoveNext() + 0x1a7
[23:11:15 ERR] [LinuxCapture] Fullscreen capture returned null.

Region > Fullscreen:
[23:12:33 INF] LanguageSelector_SelectionChanged triggered
[23:12:33 INF] RunOCRAsync triggered
[23:12:43 INF] Selecting: Fullscreen
[23:12:43 INF] Executing: Fullscreen
Request path: /org/freedesktop/portal/desktop/request/1_244/t
Got t{ }
[23:12:43 ERR] System.Collections.Generic.KeyNotFoundException: The given key 'uri' was not present in the dictionary.
   at SnapX.Core.SharpCapture.Linux.LinuxCapture.<TakeScreenshotWithPortal>d__1.MoveNext() + 0x694
--- End of stack trace from previous location ---
   at SnapX.Core.SharpCapture.Linux.LinuxCapture.<CaptureFullscreen>d__0.MoveNext() + 0x13c
[23:12:43 ERR] System.Exception: XGetImage failed for area 16384x3456 at 0,0.
   at SnapX.Core.Utils.Native.LinuxAPI.CaptureAreaInternal(IntPtr, IntPtr, Int32, Int32, Int32, Int32) + 0x254
   at SnapX.Core.Utils.Native.LinuxAPI.TakeFullscreenScreenshot() + 0x1d8
   at SnapX.Core.SharpCapture.Linux.LinuxCapture.<CaptureFullscreen>d__0.MoveNext() + 0x1a7

Logs do not have PII

  • There is no personally identifiable information in my logs.

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions