Dpi unaware placement bug (#2121)

Fix for bug when placing dpi unaware window such as Notepad++ in left of right part of monitor. In that application gap of about 7px was left or right.
This fixes only single-monitor scenario
It skips correction for dpi unaware window that leaves a gap
This commit is contained in:
PrzemyslawTusinski
2020-04-15 12:34:11 +02:00
committed by GitHub
parent 87fb6fc3d1
commit 2077cd4864
3 changed files with 17 additions and 7 deletions

View File

@@ -38,6 +38,11 @@ std::vector<MonitorInfo> MonitorInfo::GetMonitors(bool include_toolbar)
return monitors;
}
int MonitorInfo::GetMonitorsCount()
{
return GetMonitors(true).size();
}
static BOOL CALLBACK get_primary_display_enum_cb(HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM data)
{
MONITORINFOEX monitor_info;

View File

@@ -32,6 +32,7 @@ struct MonitorInfo : ScreenSize
// Returns monitor rects ordered from left to right
static std::vector<MonitorInfo> GetMonitors(bool include_toolbar);
static int GetMonitorsCount();
// Return primary display
static MonitorInfo GetPrimaryMonitor();
// Return monitor on which hwnd window is displayed