From cf456972fa5df09ef32f43469d4c23c59d518e05 Mon Sep 17 00:00:00 2001 From: Roy Date: Sun, 14 May 2023 15:37:22 +0300 Subject: Adjustment for Twine X4 and FSE Remote Desktop. --- .../RemoteDesktop/DefaultRemoteDesktopService.cs | 26 ++++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteDesktop/DefaultRemoteDesktopService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteDesktop/DefaultRemoteDesktopService.cs index 411fd5252..51c78e0f0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteDesktop/DefaultRemoteDesktopService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteDesktop/DefaultRemoteDesktopService.cs @@ -14,6 +14,7 @@ using Tango.Core.Threading; using Tango.Integration.ExternalBridge; using Tango.Logging; using Tango.PPC.Common.Application; +using Tango.PPC.Common.Build; using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Common.OS; using Tango.PPC.Common.Printing; @@ -46,6 +47,7 @@ namespace Tango.PPC.Common.RemoteDesktop private bool _isMouseDown; private bool _ensureMouseDown; private ActionTimer _resetTimer; + private IBuildProvider _buildProvider; /// /// Gets or sets a value indicating whether this is enabled. @@ -79,11 +81,12 @@ namespace Tango.PPC.Common.RemoteDesktop /// The application manager. /// The external bridge. /// The os manager. - public DefaultRemoteDesktopService(IPPCApplicationManager applicationManager, IPPCExternalBridgeService externalBridge, IOperationSystemManager osManager, IPrintingManager printingManager) + public DefaultRemoteDesktopService(IPPCApplicationManager applicationManager, IPPCExternalBridgeService externalBridge, IOperationSystemManager osManager, IPrintingManager printingManager, IBuildProvider buildProvider) { _osManager = osManager; _appManager = applicationManager; _printingManager = printingManager; + _buildProvider = buildProvider; _jsonSettings = new JsonSerializerSettings() { @@ -110,10 +113,19 @@ namespace Tango.PPC.Common.RemoteDesktop private void ApplicationManager_ApplicationReady(object sender, EventArgs e) { - - var mainWindow = System.Windows.Application.Current.MainWindow; + if (_buildProvider.IsEureka) + { + _engine.CaptureRegion = new CaptureRegion() + { + Left = (int)mainWindow.Left, + Top = 0, + Width = 1920, + Height = 1080 + }; + } + if (mainWindow.WindowStyle != System.Windows.WindowStyle.None) { mainWindow.LocationChanged += (_, __) => @@ -325,7 +337,7 @@ namespace Tango.PPC.Common.RemoteDesktop MouseController.MouseEvent(flag); - _resetTimer.ResetReplace(() => + _resetTimer.ResetReplace(() => { _printingManager.PreventPrintingByRemoteDesktop = false; Debug.WriteLine("ALLOW PRINT"); @@ -468,7 +480,7 @@ namespace Tango.PPC.Common.RemoteDesktop } else { - _engine.EnableComparer = true; + _engine.EnableComparer = !_buildProvider.IsEureka; foreach (var client in _clients.ToList().Where(x => !x.InitialPacketSent)) { @@ -490,13 +502,13 @@ namespace Tango.PPC.Common.RemoteDesktop } } - if (e.Frame.DifferenceCount > 0) + if (e.Frame.DifferenceCount > 0 || _buildProvider.IsEureka) { RemoteDesktopPacket packet = null; Point mousePosition = new Point(System.Windows.Forms.Cursor.Position.X, System.Windows.Forms.Cursor.Position.Y); - if (!e.Frame.DifferenceAvailable) + if (!e.Frame.DifferenceAvailable || _buildProvider.IsEureka) { packet = new RemoteDesktopPacket() { -- cgit v1.3.1