lbonn / rofi

Rofi: A window switcher, run dialog and dmenu replacement - fork with wayland support
Other
927 stars 36 forks source link

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

Closed ghost closed 1 year ago

ghost commented 2 years ago

Rofi version (rofi -v)

1.7.3 (davatorium/rofi) 1.7.2-29-g50b85ba9 (next) (lbonn/rofi)

Configuration

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

Launch command

rofi --help

Step to reproduce

prerequisites:

steps:

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

[posted this on the wrong issue tracker before, at https://github.com/davatorium/rofi/issues/1590 - sorry for that]

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

lbonn commented 1 year ago

The monitor layout section does not appear in rofi wayland. It's unclear what is the impact of this, so I'll close for now.