mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[GH-ISSUE #304] Client reports wrong screen size for multiple monitors #244
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#244
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mrwensveen on GitHub (May 9, 2019).
Original GitHub issue: https://github.com/debauchee/barrier/issues/304
Operating Systems
Server: Windows 10 Version 1809 (OS Build 17763.475)
Client: Windows 10 Version 1809 (OS Build 17763.437)
Barrier Version
2.2.0-Release-18ac0fe4
Steps to reproduce bug
Multiple monitors with different DPI settings. 1st monitor 1920x1080 125% DPI, 2nd monitor 1920x1200 100% (set as main display).
After connecting, the client reports a virtual screen size of 3456x1200.
Other info
It seems the issue is in
MSWindowsScreen::updateScreenShape(). Apparently, GetSystemMetrics reports wrong values for applications that are not DPI-aware.My screens are 1920x1200 and 1920x1080. And my debug log shows a virtual screen size of
[2019-05-09T11:20:18] DEBUG: screen shape: 0,0 3456x1200 (multi-monitor)1920 for the screen on 100% and 1536 for the screen on 125% (1536 * 1,25 = 1920).
See also: https://stackoverflow.com/questions/2630392/getsystemmetrics-returns-wrong-value-for-sm-cxscreen#2630531
Since I've not done anything with C++ for about 15 years, I'm a little afraid to make a patch / pull request. But testing with a simple C++ console application in VS2017, it appears the problem will be fixed when setting the DPI awareness to Per-monitor in the application manifest (this project has multiple, but I think it would be barrierc.exe.manifest).
3 different settings: Not DPI-aware, Per-monitor High DPI-aware, High DPI-aware.
@mrwensveen commented on GitHub (May 9, 2019):
I forgot to mention that the result of this, is that I can't move the mouse to the right edge of the right screen. It stops at about 3/4 of the screen (1536/1920 = 4/5, to be precise :) ). So I can't reach the systray icons and such.