fix(windows): restore Flutter view visibility after FancyZones placement (#16397)

* fix(windows): restore Flutter view visibility after FancyZones placement

Signed-off-by: 21pages <sunboeasy@gmail.com>

* fix(windows): avoid stale resize targets during Flutter refresh

* fix(windows): update multi-window dependency for FancyZones

---------

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2026-09-30 23:30:33 +08:00
committed by GitHub
parent a7f2260203
commit 9d3ae7acd2
3 changed files with 11 additions and 8 deletions
+2 -2
View File
@@ -339,8 +339,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "8b774a66671cbb9bcb2631af6ac28f9bdd469ce3"
resolved-ref: "8b774a66671cbb9bcb2631af6ac28f9bdd469ce3"
ref: "cddc2e64f8fefce4f80db87b20bcda2dd019bed6"
resolved-ref: "cddc2e64f8fefce4f80db87b20bcda2dd019bed6"
url: "https://github.com/rustdesk-org/rustdesk_desktop_multi_window"
source: git
version: "0.1.0"
+1 -1
View File
@@ -58,7 +58,7 @@ dependencies:
desktop_multi_window:
git:
url: https://github.com/rustdesk-org/rustdesk_desktop_multi_window
ref: 8b774a66671cbb9bcb2631af6ac28f9bdd469ce3
ref: cddc2e64f8fefce4f80db87b20bcda2dd019bed6
freezed_annotation: ^2.0.3
flutter_custom_cursor:
git:
+8 -5
View File
@@ -59,19 +59,22 @@ constexpr UINT kForceRedrawMaxTries = 25;
// per call (each nudge re-enters the 100ms resize wait).
constexpr UINT kForceRedrawCheapTries = 2;
// Re-enters the embedder's OnWindowSizeChanged by nudging the Flutter child
// window by 1px and back: this resets the resize target and resends the window
// metrics. Same as BaseFlutterWindow::ForceChildRefresh() on the
// rustdesk_desktop_multi_window side.
// A nonzero intermediate width can time out before Flutter resizes its surface.
// Restoring the old width then leaves that intermediate resize pending. Zero
// width resends metrics without creating a new resize target, as in the plugin.
void ForceChildRefresh(HWND child) {
if (!child) {
return;
}
// FancyZones can queue a hide before the Flutter view is reparented.
if ((GetWindowLongPtr(child, GWL_STYLE) & WS_VISIBLE) == 0) {
ShowWindow(child, SW_SHOWNA);
}
RECT rect;
GetWindowRect(child, &rect);
LONG width = rect.right - rect.left;
LONG height = rect.bottom - rect.top;
SetWindowPos(child, nullptr, 0, 0, width + 1, height,
SetWindowPos(child, nullptr, 0, 0, 0, height,
SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED);
SetWindowPos(child, nullptr, 0, 0, width, height,
SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED);