Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix randr dpi with reported 1mm size displays #1931

Closed
wants to merge 1 commit into from

Conversation

Chiheisen
Copy link

@Chiheisen Chiheisen commented May 7, 2021

  • Tested on all platforms changed
  • Compilation warnings were addressed
  • cargo fmt has been run on this branch
  • cargo doc builds successfully
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

Some monitors have broken / wrong EDID like the Odyssey G9, which results in randr reporting them as size of 1mm x 1mm.
xrandr output: DP-2 connected primary 5120x1440+0+1440 (normal left inverted right x axis y axis) 1mm x 1mm

The current sanity check only looks for 0mm x 0mm, PR just extends the check to 0/1 instead of just 0.
There theoretically could be displays with a size of 1x1, but I'm not aware of such displays existing (/ being useful).

@maroider maroider added DS - x11 C - waiting on maintainer A maintainer must review this code B - bug Dang, that shouldn't have happened labels May 7, 2021
@kchibisov
Copy link
Member

Nah, it's not really a fix, they are not exactly 1x1 or 0x1, they could be 17x22mm(reported by nvidia drivers sometimes). Which also gives insane DPI. In general, I'd clamp all dpi values higher than 35 to 1(well 20 would be already enough, but 35 is better).

You can explain this number by picking some phone screen, e.g. 5 inches, and some insane resolution for it, like 8k/16k, than everything that is higher than that is likely garbage from the drivers.

@kchibisov
Copy link
Member

I was already doing that, but it faced some skepticism, though, it doesn't matter know

#1403

@kchibisov
Copy link
Member

Fixed upstream in b477486

@kchibisov kchibisov closed this Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened C - waiting on maintainer A maintainer must review this code DS - x11
Development

Successfully merging this pull request may close these issues.

3 participants