From 1b06f3804147f19d5ffeddabbf445ca90f229f07 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 13 Nov 2020 18:07:35 +0100 Subject: [PATCH] Fixed display channel anounce race * The display resolution change message was prone to a race condition * Check for actual fullscreen state instead of settings * Assume 75dpi for display resolution to mm conversion (cherry picked from commit 13c8a60b7095c141321cd2d09f3e36466d54a748) --- client/X11/xf_disp.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/X11/xf_disp.c b/client/X11/xf_disp.c index a9d2ee8..6605303 100644 --- a/client/X11/xf_disp.c +++ b/client/X11/xf_disp.c @@ -113,11 +113,10 @@ static BOOL xf_disp_sendResize(xfDispContext* xfDisp) if (GetTickCount64() - xfDisp->lastSentDate < RESIZE_MIN_DELAY) return TRUE; - xfDisp->lastSentDate = GetTickCount64(); - if (!xf_disp_settings_changed(xfDisp)) return TRUE; + xfDisp->lastSentDate = GetTickCount64(); if (xfc->fullscreen && (settings->MonitorCount > 0)) { if (xf_disp_sendLayout(xfDisp->disp, settings->MonitorDefArray, settings->MonitorCount) != @@ -134,8 +133,8 @@ static BOOL xf_disp_sendResize(xfDispContext* xfDisp) layout.Orientation = settings->DesktopOrientation; layout.DesktopScaleFactor = settings->DesktopScaleFactor; layout.DeviceScaleFactor = settings->DeviceScaleFactor; - layout.PhysicalWidth = xfDisp->targetWidth; - layout.PhysicalHeight = xfDisp->targetHeight; + layout.PhysicalWidth = xfDisp->targetWidth / 75 * 25.4f; + layout.PhysicalHeight = xfDisp->targetHeight / 75 * 25.4f; if (IFCALLRESULT(CHANNEL_RC_OK, xfDisp->disp->SendMonitorLayout, xfDisp->disp, 1, &layout) != CHANNEL_RC_OK) @@ -197,7 +196,7 @@ static void xf_disp_OnActivated(void* context, ActivatedEventArgs* e) xfDisp->waitingResize = FALSE; - if (xfDisp->activated && !settings->Fullscreen) + if (xfDisp->activated && !xfc->fullscreen) { xf_disp_set_window_resizable(xfDisp); -- 2.7.4