From 13cc494a4882251ff4e97df3b494889309948976 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 13 Jun 2024 20:26:24 +0800 Subject: [PATCH] enhance: forbid `MoveWindow` being called while double tap action taking place (#177) --- src/Views/Blame.axaml.cs | 2 ++ src/Views/BranchCompare.axaml.cs | 2 ++ src/Views/FileHistories.axaml.cs | 2 ++ src/Views/Launcher.axaml.cs | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/Views/Blame.axaml.cs b/src/Views/Blame.axaml.cs index 8a6ffee9..d4c2da28 100644 --- a/src/Views/Blame.axaml.cs +++ b/src/Views/Blame.axaml.cs @@ -333,6 +333,8 @@ namespace SourceGit.Views private void MaximizeOrRestoreWindow(object sender, TappedEventArgs e) { + _pressedTitleBar = false; + if (WindowState == WindowState.Maximized) WindowState = WindowState.Normal; else diff --git a/src/Views/BranchCompare.axaml.cs b/src/Views/BranchCompare.axaml.cs index 9d506ef3..280cfc6a 100644 --- a/src/Views/BranchCompare.axaml.cs +++ b/src/Views/BranchCompare.axaml.cs @@ -13,6 +13,8 @@ namespace SourceGit.Views private void MaximizeOrRestoreWindow(object sender, TappedEventArgs e) { + _pressedTitleBar = false; + if (WindowState == WindowState.Maximized) WindowState = WindowState.Normal; else diff --git a/src/Views/FileHistories.axaml.cs b/src/Views/FileHistories.axaml.cs index 2c45ab9f..51570310 100644 --- a/src/Views/FileHistories.axaml.cs +++ b/src/Views/FileHistories.axaml.cs @@ -13,6 +13,8 @@ namespace SourceGit.Views private void MaximizeOrRestoreWindow(object sender, TappedEventArgs e) { + _pressedTitleBar = false; + if (WindowState == WindowState.Maximized) WindowState = WindowState.Normal; else diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index 60ac7d97..7cae36dc 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -161,6 +161,8 @@ namespace SourceGit.Views private void OnTitleBarDoubleTapped(object sender, TappedEventArgs e) { + _pressedTitleBar = false; + if (WindowState == WindowState.Maximized) WindowState = WindowState.Normal; else