From 3c472ffe90bf5c496411c6d37ae832d9181c4ec9 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 14 Jun 2021 21:48:37 +0200 Subject: [PATCH] Revert "tdf#142832: a blind fix - calculate rectangle size properly" This reverts commit 57d122258437c0a14b303a8d961aa5e8f6f67f57. Reason for revert: As mentioned in https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowrect, > In conformance with conventions for the RECT structure, the bottom- > right coordinates of the returned rectangle are exclusive. In other > words, the pixel at (right, bottom) lies immediately outside the > rectangle. So it was incorrect change. Change-Id: I2b29871a5d9b944ce2f9119edb2e87c53d9ae298 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117212 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- vcl/win/app/salinfo.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vcl/win/app/salinfo.cxx b/vcl/win/app/salinfo.cxx index 547e54ce54f6..2787797a6ce5 100644 --- a/vcl/win/app/salinfo.cxx +++ b/vcl/win/app/salinfo.cxx @@ -65,8 +65,10 @@ bool WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_I if( it != m_aDeviceNameToMonitor.end() ) { DisplayMonitor& rMon( m_aMonitors[ it->second ] ); - rMon.m_aArea = tools::Rectangle(aInfo.rcMonitor.left, aInfo.rcMonitor.top, - aInfo.rcMonitor.right, aInfo.rcMonitor.bottom); + rMon.m_aArea = tools::Rectangle( Point( aInfo.rcMonitor.left, + aInfo.rcMonitor.top ), + Size( aInfo.rcMonitor.right - aInfo.rcMonitor.left, + aInfo.rcMonitor.bottom - aInfo.rcMonitor.top ) ); if( (aInfo.dwFlags & MONITORINFOF_PRIMARY) != 0 ) m_nPrimary = it->second; }