Gdk Monitor Dimensions Mismatch in Landscape Orientation
As I was working on developing an application, I came across an issue with the scaling when the Librem 5 is in landscape orientation. A short example from my application is here
gdk_window = gtk_window.get_window()
display = gdk_window.get_display()
monitor = display.get_monitor_at_window(gdk_window)
geometry = monitor.get_geometry()
max_width_px = geometry.width
max_height_px = geometry.height
max_width_mm = monitor.get_width_mm()
max_height_mm = monitor.get_height_mm()
Print(f"Pixel dims: {max_width_px}, {max_height_px}")
Print(f"mm dims: {max_width_mm}, {max_height_mm}"
If I have the phone in portrait mode and start the app, I get
Pixel dims: 360, 720
mm dims: 65, 130
If I have the phone in landscape mode and start the app, I get
Pixel dims: 720, 360
mm dims: 65, 130
The issue is that the physical (mm) dimensions do not change when the orientation changes. I raised this in the community/librem-5-apps Matrix room, where Alexander Mikhaylenko has been quite helpful. He suggested that I file an issue under phoc
, as in his testing, it seems to work as expected in gnome-shell
.
I don't know if it is potentially related to Librem5/phoc#192