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

[BUG] dpi calculation error on rotated displays (wayland) #1590

Closed
ghost opened this issue Feb 10, 2022 · 5 comments
Closed

[BUG] dpi calculation error on rotated displays (wayland) #1590

ghost opened this issue Feb 10, 2022 · 5 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 10, 2022

Rofi version (rofi -v)

1.7.3

Configuration

https://gist.github.com/qodo-io/36623f90c03ae96204b0d9d1748102e7

Launch command

rofi --help

Step to reproduce

prerequisites:

  • rotated wayland display (i.e.swaymsg output DP-1 transform 90)
    optional: physically rotate your display to get your neck into a healthy debugging position)

steps:

  • run rofi --help and identify the Monitor layout: section
  • optional: filter the output to see it immediatelty:
rofi --help | sed -r -e '/^\s*(ID:|name:|position:|size:|size:)/!d;s/^\s*/  /;s/  ID: ([0-9]*$)/\1:/;s/dpi:/\n  dpi:/;s/size: ([0-9]*),([0-9]*)/width: \1\n  height: \2/;s/position: ([0-9]*),([0-9]*)/x: \1\n  y: \2/'

Expected behavior

0:
  name: XWAYLAND15
  x: 3840
  y: 0
  width: 1440
  height: 2560
  size: 530mm,300mm  
  dpi: 123,123             # <-------- correct

correct dpi would be 123,123 in this example, as:

 ~   calc                                                                                                                                                                      
   precision: e^-8
   2560/(53/2.54)
   2560/(53/2.54):  122.68679246

Actual behavior

0:
  name: XWAYLAND15
  x: 3840
  y: 0
  width: 1440
  height: 2560
  size: 530mm,300mm  
  dpi: 69,217             # <-------- incorrect

dpi is 69,217, as width and height are flipped

 ~   calc                                                                                                                                                                      
   precision: e^-8
   1440/(53/2.54):  69.01132076
   2560/(30/2.54):  216.74666670

Additional information

probable root cause: the dpi calculation does not take wayland display rotation into account (sway example from CLI: swaymsg -t get_outputs | jq '.[]|.transform')

@ghost ghost added the bug label Feb 10, 2022
@DaveDavenport
Copy link
Collaborator

Did you read the guidelines? https://github.com/davatorium/rofi/blob/next/.github/CONTRIBUTING.md See the last line.
Please report this at the wayland port of rofi.

@ghost
Copy link
Author

ghost commented Feb 10, 2022

Oopsie. I thought I had :-/ sorry!

@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Feb 10, 2022

https://github.com/lbonn/rofi
It is pretty much in sync.

@ghost
Copy link
Author

ghost commented Feb 10, 2022

Thanks a lot. Also in general, thanks for rofi! :-)

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant