From a2b730e5ebfd378610e8f179ce89a9a7077828c2 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 25 Aug 2026 22:30:00 +0300 Subject: [PATCH 1/8] Fix inconsistent `Time.GameTime` when entering play mode GameWindow entering effect does not reset properly sometimes when play mode is entered due to game time getting reset after the `OnPlayBegin` event. --- Source/Editor/States/PlayingState.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Editor/States/PlayingState.cs b/Source/Editor/States/PlayingState.cs index 51dfd3677..a81487e43 100644 --- a/Source/Editor/States/PlayingState.cs +++ b/Source/Editor/States/PlayingState.cs @@ -159,11 +159,11 @@ namespace FlaxEditor.States SceneDuplicated?.Invoke(); RestoreSelection(); + Time.Synchronize(true); + Editor.OnPlayBegin(); IsPlayModeStarting = false; Profiler.EndEvent(); - - Time.Synchronize(true); } private void SetupEditorEnvOptions() From a56903d3ade19924d5ff407a1883213f88dfd321 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 25 Aug 2026 22:33:39 +0300 Subject: [PATCH 2/8] Fix client-side decorations in borderless editor game window on launch --- .../GUI/Docking/FloatWindowDockPanel.cs | 42 +++++++++++++------ Source/Editor/Windows/GameWindow.cs | 7 ++++ 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs b/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs index b47d76bdd..788631daa 100644 --- a/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs +++ b/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs @@ -65,6 +65,31 @@ namespace FlaxEditor.GUI.Docking /// public bool IsDragging { get; internal set; } + /// + /// Shows client-side window decorations around this panel. + /// + public bool ShowDecorations + { + get; + set + { + if (value == field) + return; + field = value; + if (value) + { + var decorations = Parent.AddChild(new FloatWindowDecorations(this)); + decorations.SetAnchorPreset(AnchorPresets.HorizontalStretchTop, false); + } + else + { + var decorations = Parent.GetChild(); + if (decorations != null) + decorations.Dispose(); + } + } + } = false; + /// /// Initializes a new instance of the class. /// @@ -82,11 +107,7 @@ namespace FlaxEditor.GUI.Docking _window.Window.Closing += OnClosing; _window.Window.LeftButtonHit += OnLeftButtonHit; - if (Utilities.Utils.UseCustomWindowDecorations()) - { - var decorations = Parent.AddChild(new FloatWindowDecorations(this)); - decorations.SetAnchorPreset(AnchorPresets.HorizontalStretchTop, false); - } + ShowDecorations = Utilities.Utils.UseCustomWindowDecorations(); } /// @@ -94,13 +115,10 @@ namespace FlaxEditor.GUI.Docking { base.PerformLayoutBeforeChildren(); - var decorations = Parent.GetChild(); - if (decorations != null) - { - // Apply offset for the title bar - foreach (var child in Children) - child.Bounds = child.Bounds with { Y = decorations.Height, Height = Parent.Height - decorations.Height }; - } + // Apply offset for the title bar + var decorationsHeight = Parent.GetChild()?.Height ?? 0; + foreach (var child in Children) + child.Bounds = child.Bounds with { Y = decorationsHeight, Height = Parent.Height - decorationsHeight }; } /// diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index 8c3793627..9419fbb51 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Xml; using FlaxEditor.Gizmo; using FlaxEditor.GUI.ContextMenu; +using FlaxEditor.GUI.Docking; using FlaxEditor.GUI.Input; using FlaxEditor.Modules; using FlaxEditor.Options; @@ -331,6 +332,9 @@ namespace FlaxEditor.Windows { IsFloating = true; var rootWindow = RootWindow; + var floatWin = rootWindow.GetChild(); + if (floatWin != null && floatWin.ShowDecorations) + floatWin.ShowDecorations = false; var monitorBounds = Platform.GetMonitorBounds(rootWindow.RootWindow.Window.ClientPosition); rootWindow.Window.Position = monitorBounds.Location; rootWindow.Window.SetBorderless(true); @@ -338,6 +342,9 @@ namespace FlaxEditor.Windows } else { + var floatWin = RootWindow.GetChild(); + if (floatWin != null && !floatWin.ShowDecorations && Utilities.Utils.UseCustomWindowDecorations()) + floatWin.ShowDecorations = true; IsFloating = false; } } From 101c15c677ef964a40a4285515036a8b5f6659b8 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 25 Aug 2026 22:35:29 +0300 Subject: [PATCH 3/8] Prevent refloating editor game window when window was floating before --- Source/Editor/GUI/Docking/DockWindow.cs | 2 +- Source/Editor/Windows/GameWindow.cs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Editor/GUI/Docking/DockWindow.cs b/Source/Editor/GUI/Docking/DockWindow.cs index 8cde79ce8..d6b86c833 100644 --- a/Source/Editor/GUI/Docking/DockWindow.cs +++ b/Source/Editor/GUI/Docking/DockWindow.cs @@ -488,7 +488,7 @@ namespace FlaxEditor.GUI.Docking base.Focus(); SelectTab(false); - BringToFront(); + _dockedTo?.RootWindow?.Focus(); } /// diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index 9419fbb51..f4c95cd17 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -310,9 +310,11 @@ namespace FlaxEditor.Windows // Restore if (rootWindow != null) rootWindow.Restore(); - if (_maximizeRestoreDockTo != null && _maximizeRestoreDockTo.IsDisposing) - _maximizeRestoreDockTo = null; - Show(_maximizeRestoreDockState, _maximizeRestoreDockTo); + var dockTo = _maximizeRestoreDockTo; + if (dockTo != null && dockTo.IsDisposing) + dockTo = null; + if (_dockedTo != dockTo) + Show(_maximizeRestoreDockState, dockTo); } } } From d21edc12cbce9ad22cbcdf55969bf1849537c509 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 25 Aug 2026 23:39:03 +0300 Subject: [PATCH 4/8] Fix restoring editor game window from maximized state to split panels --- Source/Editor/Windows/GameWindow.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index f4c95cd17..df9743534 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -133,6 +133,8 @@ namespace FlaxEditor.Windows private float _gameStartTime; private GUI.Docking.DockState _maximizeRestoreDockState; private GUI.Docking.DockPanel _maximizeRestoreDockTo; + private GUI.Docking.DockPanel _maximizeRestoreDockToParent; + private float _maximizeRestoreSplitterValue; private CursorLockMode _cursorLockMode = CursorLockMode.None; // Viewport scaling variables @@ -296,7 +298,8 @@ namespace FlaxEditor.Windows if (value) { _maximizeRestoreDockTo = _dockedTo; - _maximizeRestoreDockState = _dockedTo.TryGetDockState(out _); + _maximizeRestoreDockToParent = _dockedTo.ParentDockPanel; + _maximizeRestoreDockState = _dockedTo.TryGetDockState(out _maximizeRestoreSplitterValue); if (_maximizeRestoreDockState != GUI.Docking.DockState.Float) { var monitorBounds = Platform.GetMonitorBounds(PointToScreen(Size * 0.5f)); @@ -312,9 +315,9 @@ namespace FlaxEditor.Windows rootWindow.Restore(); var dockTo = _maximizeRestoreDockTo; if (dockTo != null && dockTo.IsDisposing) - dockTo = null; + dockTo = _maximizeRestoreDockToParent; if (_dockedTo != dockTo) - Show(_maximizeRestoreDockState, dockTo); + Show(_maximizeRestoreDockState, dockTo, splitterValue: _maximizeRestoreSplitterValue); } } } From 17df377737a2065ce2963db958bcfcb94d10a7a3 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 25 Aug 2026 23:43:14 +0300 Subject: [PATCH 5/8] Fix restoring editor game window from maximized state to dock panels --- Source/Editor/Windows/GameWindow.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index df9743534..e0c56b18b 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -300,6 +300,8 @@ namespace FlaxEditor.Windows _maximizeRestoreDockTo = _dockedTo; _maximizeRestoreDockToParent = _dockedTo.ParentDockPanel; _maximizeRestoreDockState = _dockedTo.TryGetDockState(out _maximizeRestoreSplitterValue); + if (_dockedTo.Tabs.Count > 1) + _maximizeRestoreDockState = DockState.DockFill; if (_maximizeRestoreDockState != GUI.Docking.DockState.Float) { var monitorBounds = Platform.GetMonitorBounds(PointToScreen(Size * 0.5f)); From 28d5a6d0de1af884683297071522833ae3e75f37 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Wed, 26 Aug 2026 00:33:49 +0300 Subject: [PATCH 6/8] Fix `DockWindow.IsDocked` to ignore single tab floating window as docked --- Source/Editor/GUI/Docking/DockWindow.cs | 2 +- Source/Editor/Windows/GameWindow.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Editor/GUI/Docking/DockWindow.cs b/Source/Editor/GUI/Docking/DockWindow.cs index d6b86c833..a6c98a1f6 100644 --- a/Source/Editor/GUI/Docking/DockWindow.cs +++ b/Source/Editor/GUI/Docking/DockWindow.cs @@ -50,7 +50,7 @@ namespace FlaxEditor.GUI.Docking /// /// Gets a value indicating whether this window is docked. /// - public bool IsDocked => _dockedTo != null; + public bool IsDocked => _dockedTo != null && _dockedTo.TabsCount > 1; /// /// Gets a value indicating whether this window is selected. diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index e0c56b18b..d351147cb 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -913,7 +913,7 @@ namespace FlaxEditor.Windows /// public void FocusGameViewport() { - if (!IsDocked) + if (ParentDockPanel == null) { ShowFloating(); } @@ -1018,7 +1018,7 @@ namespace FlaxEditor.Windows Screen.CursorVisible = true; Screen.CursorLock = CursorLockMode.None; - if (Editor.IsPlayMode && IsDocked && IsSelected && RootWindow.FocusedControl == null) + if (Editor.IsPlayMode && ParentDockPanel != null && IsSelected && RootWindow.FocusedControl == null) { // Game UI cleared focus so regain it to maintain UI navigation just like game window does FlaxEngine.Scripting.InvokeOnUpdate(Focus); From 582af19cb20b48b2b975048753da93bbb881cd0a Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Wed, 26 Aug 2026 20:11:03 +0300 Subject: [PATCH 7/8] Fix compilation --- Source/Editor/GUI/Docking/FloatWindowDockPanel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs b/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs index 788631daa..4c7fb19b7 100644 --- a/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs +++ b/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs @@ -70,7 +70,7 @@ namespace FlaxEditor.GUI.Docking /// public bool ShowDecorations { - get; + get => field; set { if (value == field) @@ -88,7 +88,7 @@ namespace FlaxEditor.GUI.Docking decorations.Dispose(); } } - } = false; + } /// /// Initializes a new instance of the class. From b7b357014f43079ff80d36b5d736c72207500b36 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 29 Aug 2026 23:14:24 +0200 Subject: [PATCH 8/8] Comply with .net 8 for now --- Source/Editor/GUI/Docking/FloatWindowDockPanel.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs b/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs index 4c7fb19b7..1ba732d84 100644 --- a/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs +++ b/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs @@ -49,6 +49,7 @@ namespace FlaxEditor.GUI.Docking private MasterDockPanel _masterPanel; private WindowRootControl _window; + private bool _showDecorations; /// /// Gets the master panel. @@ -70,12 +71,12 @@ namespace FlaxEditor.GUI.Docking /// public bool ShowDecorations { - get => field; + get => _showDecorations; set { - if (value == field) + if (value == _showDecorations) return; - field = value; + _showDecorations = value; if (value) { var decorations = Parent.AddChild(new FloatWindowDecorations(this));