refactor(new_editor): centralize win32 frame execution

This commit is contained in:
2026-04-22 14:37:25 +08:00
parent 4a42b757c7
commit b44f5ca9fc
10 changed files with 114 additions and 44 deletions

View File

@@ -400,6 +400,8 @@ bool EditorWindowChromeController::HandleResizePointerMove(
EditorWindow& window,
EditorContext& editorContext,
bool globalTabDragActive) {
(void)editorContext;
(void)globalTabDragActive;
if (!IsBorderlessResizeActive() ||
window.m_state->window.hwnd == nullptr) {
return false;
@@ -428,7 +430,7 @@ bool EditorWindowChromeController::HandleResizePointerMove(
static_cast<UINT>(width),
static_cast<UINT>(height));
window.ApplyWindowResize(static_cast<UINT>(width), static_cast<UINT>(height));
(void)window.RenderFrame(editorContext, globalTabDragActive);
window.RequestFrame(EditorWindowFrameRequestReason::BorderlessTransition);
SetWindowPos(
window.m_state->window.hwnd,
@@ -897,6 +899,8 @@ bool EditorWindowChromeController::ApplyPredictedWindowRectTransition(
EditorContext& editorContext,
bool globalTabDragActive,
const RECT& targetRect) {
(void)editorContext;
(void)globalTabDragActive;
if (window.m_state->window.hwnd == nullptr) {
return false;
}
@@ -909,7 +913,6 @@ bool EditorWindowChromeController::ApplyPredictedWindowRectTransition(
SetPredictedClientPixelSize(static_cast<UINT>(width), static_cast<UINT>(height));
window.ApplyWindowResize(static_cast<UINT>(width), static_cast<UINT>(height));
(void)window.RenderFrame(editorContext, globalTabDragActive);
SetWindowPos(
window.m_state->window.hwnd,
nullptr,
@@ -918,6 +921,7 @@ bool EditorWindowChromeController::ApplyPredictedWindowRectTransition(
width,
height,
SWP_NOZORDER | SWP_NOACTIVATE);
window.RequestFrame(EditorWindowFrameRequestReason::BorderlessTransition);
window.InvalidateHostWindow();
return true;
}