|
|
@@ -15,6 +15,7 @@ public static class Win32Window
|
|
|
public static async Task Fullscreen(Window window, MainViewModel vm, bool saveSettings = true)
|
|
|
{
|
|
|
IsChangingWindowState = true;
|
|
|
+
|
|
|
// Save window size, so that restoring it will return to the same size and position
|
|
|
WindowResizing.SaveSize(window);
|
|
|
|
|
|
@@ -45,7 +46,8 @@ public static class Win32Window
|
|
|
// Fixes https://github.com/Ruben2776/PicView/issues/226
|
|
|
await WindowFunctions.ResizeAndFixRenderingError(vm);
|
|
|
|
|
|
- IsChangingWindowState = false;
|
|
|
+ Dispatcher.UIThread.Post(() => IsChangingWindowState = false, DispatcherPriority.Background);
|
|
|
+
|
|
|
|
|
|
if (saveSettings)
|
|
|
{
|
|
|
@@ -80,7 +82,8 @@ public static class Win32Window
|
|
|
vm.MainWindow.IsFullscreen.Value = false;
|
|
|
vm.MainWindow.CanResize.Value = false;
|
|
|
|
|
|
- IsChangingWindowState = false;
|
|
|
+ Dispatcher.UIThread.Post(() => IsChangingWindowState = false, DispatcherPriority.Background);
|
|
|
+
|
|
|
if (saveSettings)
|
|
|
{
|
|
|
await SaveSettingsAsync().ConfigureAwait(false);
|
|
|
@@ -130,7 +133,8 @@ public static class Win32Window
|
|
|
|
|
|
await WindowResizing.SetSizeAsync(vm);
|
|
|
|
|
|
- IsChangingWindowState = false;
|
|
|
+ Dispatcher.UIThread.Post(() => IsChangingWindowState = false, DispatcherPriority.Background);
|
|
|
+
|
|
|
|
|
|
if (saveSettings)
|
|
|
{
|