From 5a7b1d1f97637637f1731e5250cd4c14f1c45829 Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Fri, 12 Jun 2026 01:35:27 +0200 Subject: [PATCH] Prevent display update during window resizing in TerminalProcess --- Processes/TerminalProcess.cs | 2 +- UI/GUI/Windows/Window.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Processes/TerminalProcess.cs b/Processes/TerminalProcess.cs index 45afa8e..b37074d 100644 --- a/Processes/TerminalProcess.cs +++ b/Processes/TerminalProcess.cs @@ -37,7 +37,7 @@ public class TerminalProcess() : Process("Terminal") internal override void Tick() { - if (window.Size != lastSize) + if (window.Size != lastSize && !window.IsResizing) { lastSize = window.Size; UpdateDisplay(); diff --git a/UI/GUI/Windows/Window.cs b/UI/GUI/Windows/Window.cs index a8e124a..9f32e0c 100644 --- a/UI/GUI/Windows/Window.cs +++ b/UI/GUI/Windows/Window.cs @@ -58,6 +58,9 @@ public sealed class Window(string title, int processId, int id, IRenderSource re /// Gets whether the window is currently being dragged. public bool IsDragging => currentInteraction == InteractionMode.Drag; + /// Gets whether the window is currently being resized. + public bool IsResizing => currentInteraction is InteractionMode.ResizeTop or InteractionMode.ResizeBottom or InteractionMode.ResizeLeft or InteractionMode.ResizeRight or InteractionMode.ResizeTopLeft or InteractionMode.ResizeTopRight or InteractionMode.ResizeBottomLeft or InteractionMode.ResizeBottomRight; + private readonly Lock uiElementsLock = new(); private readonly Dictionary uiElements = [];