diff --git a/ArduinoAgent/ArduinoAgent.csproj b/ArduinoAgent/ArduinoAgent.csproj index 22a5fc9..30cb112 100644 --- a/ArduinoAgent/ArduinoAgent.csproj +++ b/ArduinoAgent/ArduinoAgent.csproj @@ -10,9 +10,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.ArduinoAgent x64 - 3.4.4.1008 - 3.4.4.1008 - 3.4.4.1008 + 3.4.4.1011 + 3.4.4.1011 + 3.4.4.1011 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/Orchestration/Orchestration.csproj b/Orchestration/Orchestration.csproj index 7bca2ea..1ae0f32 100644 --- a/Orchestration/Orchestration.csproj +++ b/Orchestration/Orchestration.csproj @@ -10,9 +10,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Orchestration x64 - 3.4.4.1008 - 3.4.4.1008 - 3.4.4.1008 + 3.4.4.1011 + 3.4.4.1011 + 3.4.4.1011 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/Orchestration/PanelConfigurationOrchestrator.cs b/Orchestration/PanelConfigurationOrchestrator.cs index 33445aa..faecbd2 100644 --- a/Orchestration/PanelConfigurationOrchestrator.cs +++ b/Orchestration/PanelConfigurationOrchestrator.cs @@ -11,6 +11,7 @@ namespace MSFSPopoutPanelManager.Orchestration { public class PanelConfigurationOrchestrator : ObservableObject { + private static WindowProcess _simulatorProcess; private static PInvoke.WinEventProc _winEvent; // keep this as static to prevent garbage collect or the app will crash private static IntPtr _winEventHook; private Rectangle _lastWindowRectangle; @@ -37,6 +38,8 @@ namespace MSFSPopoutPanelManager.Orchestration public void StartConfiguration() { + _simulatorProcess = WindowProcessManager.GetSimulatorProcess(); + HookWinEvent(); TouchEventManager.ActiveProfile = ProfileData.ActiveProfile; @@ -206,10 +209,10 @@ namespace MSFSPopoutPanelManager.Orchestration return; // Setup panel config event hooks - if (!ActiveProfile.RealSimGearGTN750Gen1Override) - _winEventHook = PInvoke.SetWinEventHook(PInvokeConstant.EVENT_SYSTEM_MOVESIZEEND, PInvokeConstant.EVENT_OBJECT_LOCATIONCHANGE, IntPtr.Zero, _winEvent, 0, 0, PInvokeConstant.WINEVENT_OUTOFCONTEXT); - else + if (ActiveProfile.RealSimGearGTN750Gen1Override && AppSettingData.AppSetting.TouchScreenSettings.RealSimGearGTN750Gen1Override) _winEventHook = PInvoke.SetWinEventHook(PInvokeConstant.EVENT_SYSTEM_CAPTURESTART, PInvokeConstant.EVENT_OBJECT_LOCATIONCHANGE, IntPtr.Zero, _winEvent, 0, 0, PInvokeConstant.WINEVENT_OUTOFCONTEXT); + else + _winEventHook = PInvoke.SetWinEventHook(PInvokeConstant.EVENT_SYSTEM_MOVESIZEEND, PInvokeConstant.EVENT_OBJECT_LOCATIONCHANGE, IntPtr.Zero, _winEvent, 0, 0, PInvokeConstant.WINEVENT_OUTOFCONTEXT); } private void UnhookWinEvent() @@ -376,14 +379,14 @@ namespace MSFSPopoutPanelManager.Orchestration if (prevWinEventClickLock == _winEventClickLock && AppSettingData.AppSetting.TouchScreenSettings.RefocusGameWindow) { - Task.Run(() => RefocusMsfs(panelConfig.PanelHandle, prevWinEventClickLock)); + Task.Run(() => RefocusMsfs(prevWinEventClickLock)); } } } } } - private void RefocusMsfs(IntPtr panelConfigHandle, int prevWinEventClickLock) + private void RefocusMsfs(int prevWinEventClickLock) { Thread.Sleep(AppSettingData.AppSetting.TouchScreenSettings.RefocusGameWindowDelay); @@ -391,8 +394,9 @@ namespace MSFSPopoutPanelManager.Orchestration { if (!_isHookMouseDown) { - var rectangle = WindowActionManager.GetWindowRect(panelConfigHandle); - PInvoke.SetCursorPos(rectangle.X - 5, rectangle.Y + 5); + var rectangle = WindowActionManager.GetWindowRect(_simulatorProcess.Handle); + var clientRectangle = WindowActionManager.GetClientRect(_simulatorProcess.Handle); + PInvoke.SetCursorPos(rectangle.X + clientRectangle.Width / 2, rectangle.Y + clientRectangle.Height / 2); } } } diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 7f2459a..3dc2a2e 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Shared x64 - 3.4.4.1008 - 3.4.4.1008 - 3.4.4.1008 + 3.4.4.1011 + 3.4.4.1011 + 3.4.4.1011 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/SimconnectAgent/SimconnectAgent.csproj b/SimconnectAgent/SimconnectAgent.csproj index d878c3b..bcdf05a 100644 --- a/SimconnectAgent/SimconnectAgent.csproj +++ b/SimconnectAgent/SimconnectAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.SimConnectAgent x64 - 3.4.4.1008 - 3.4.4.1008 - 3.4.4.1008 + 3.4.4.1011 + 3.4.4.1011 + 3.4.4.1011 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/TouchPanelAgent/TouchPanelAgent.csproj b/TouchPanelAgent/TouchPanelAgent.csproj index ec5a539..64de13a 100644 --- a/TouchPanelAgent/TouchPanelAgent.csproj +++ b/TouchPanelAgent/TouchPanelAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.TouchPanelAgent x64 - 3.4.4.1008 - 3.4.4.1008 - 3.4.4.1008 + 3.4.4.1011 + 3.4.4.1011 + 3.4.4.1011 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/UserDataAgent/UserDataAgent.csproj b/UserDataAgent/UserDataAgent.csproj index bed69a1..39e1e7c 100644 --- a/UserDataAgent/UserDataAgent.csproj +++ b/UserDataAgent/UserDataAgent.csproj @@ -10,9 +10,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.UserDataAgent x64 - 3.4.4.1008 - 3.4.4.1008 - 3.4.4.1008 + 3.4.4.1011 + 3.4.4.1011 + 3.4.4.1011 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/VERSION.md b/VERSION.md index 8ffe4dd..26cbbfc 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,6 +1,9 @@ # Version History
+## Version 3.4.4.1011 +* Hot fix: Reverted to previous implementation of touch setting's mouse cursor automatic refocus to center of MSFS game screen instead to the upper left corner of the pop out panel where it is being touched. + ## Version 3.4.4 * Updated pop out panels separation reliability on all monitor resolutions during panel pop out process. A new algorithm had been implemented to improve Pop Out Panel Manager accuracy when it tries to click on panel's "magnifying glass" icon to separate panels. diff --git a/WebServer/WebServer.csproj b/WebServer/WebServer.csproj index 7bdc62c..49cf187 100644 --- a/WebServer/WebServer.csproj +++ b/WebServer/WebServer.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.WebServer x64 - 3.4.4.1008 - 3.4.4.1008 - 3.4.4.1008 + 3.4.4.1011 + 3.4.4.1011 + 3.4.4.1011 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/WindowsAgent/TouchEventManager.cs b/WindowsAgent/TouchEventManager.cs index 172ea08..b75e699 100644 --- a/WindowsAgent/TouchEventManager.cs +++ b/WindowsAgent/TouchEventManager.cs @@ -160,8 +160,9 @@ namespace MSFSPopoutPanelManager.WindowsAgent if (currentRefocusIndex == _refocusedTaskIndex) { - var rectangle = WindowActionManager.GetWindowRect(panelConfig.PanelHandle); - PInvoke.SetCursorPos(rectangle.X - 5, rectangle.Y + 5); + var rectangle = WindowActionManager.GetWindowRect(_simulatorProcess.Handle); + var clientRectangle = WindowActionManager.GetClientRect(_simulatorProcess.Handle); + PInvoke.SetCursorPos(rectangle.X + clientRectangle.Width / 2, rectangle.Y + clientRectangle.Height / 2); } } }); diff --git a/WindowsAgent/WindowProcessManager.cs b/WindowsAgent/WindowProcessManager.cs index b2ccfcc..14d73be 100644 --- a/WindowsAgent/WindowProcessManager.cs +++ b/WindowsAgent/WindowProcessManager.cs @@ -9,8 +9,8 @@ namespace MSFSPopoutPanelManager.WindowsAgent { var systemAssemblyVersion = System.Reflection.Assembly.GetEntryAssembly().GetName().Version; var appVersion = $"{systemAssemblyVersion.Major}.{systemAssemblyVersion.Minor}.{systemAssemblyVersion.Build}"; - //if (systemAssemblyVersion.Revision > 0) - // appVersion += "." + systemAssemblyVersion.Revision.ToString("D4"); + if (systemAssemblyVersion.Revision > 0) + appVersion += "." + systemAssemblyVersion.Revision.ToString("D4"); return appVersion; } diff --git a/WindowsAgent/WindowsAgent.csproj b/WindowsAgent/WindowsAgent.csproj index 8bba36e..552bef1 100644 --- a/WindowsAgent/WindowsAgent.csproj +++ b/WindowsAgent/WindowsAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.WindowsAgent x64 - 3.4.4.1008 - 3.4.4.1008 - 3.4.4.1008 + 3.4.4.1011 + 3.4.4.1011 + 3.4.4.1011 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/WpfApp/UserControlPanelSelection.xaml b/WpfApp/UserControlPanelSelection.xaml index 6103cad..f14b552 100644 --- a/WpfApp/UserControlPanelSelection.xaml +++ b/WpfApp/UserControlPanelSelection.xaml @@ -79,7 +79,7 @@ - +