
Custom DPI: Firefox window height is shorter on window open
The bug exists since Firefox version 131.0 circa, when some things related to DPI had been changed, which I was able to guess because, without touching anything, the size/zoom of the content of the websites were slightly different (bigger). Experiencing this in both Windows and Xfce.
Steps to reproduce:
- Have a custom DPI settings in your operating system.
- Open a new Firefox window.
- Note how the Firefox window height is shorter, so yo can see about 20 pixels of your desktop background. Manually resizing the window and restarting the browser has no effect: the correct height is not remembered.
I've reported this one year ago in the tracker, but no one has yet done anything about it: https://bugzilla.mozilla.org/show_bug.cgi?id=1925284
Am I the only person in the world using Firefox with a custom DPI setting in the OS? I find this hard to believe. Yet I'm experiencing this bug since one years ago. I can't stand using a different browser, but having to resize the window every time is so annoying...
Wšykne wótegrona (4)
In the bug, you wrote:
> Try on Windows 11 with a DPI of "120", same steps.
I don't see a way to set DPI directly, just scaling.
Are you setting the display to 120dpi by setting scaling to 125% using the Scale selector in Display settings? (Math: 1.25 x Windows default 96dpi = 120dpi)
That is a common default scaling for Full HD panels on Windows laptops, so if this setting causes the problem, I would expect a lot of people to be affected.
Or are you setting "Custom Scaling" to 120%, which would yield 115.2dpi?
It was custom scaling, yes. However, I've booted up Windows again, and I cannot reproduce the bug anymore. When I said that this happened on Windows, too, it was probably another issue. I can still see a 1 or 2 pixel gap both at the top and at the bottom, but if you do a web search with "windows 1 pixel gap" there are a lot of results. That was probably what was going on.
On Linux Xfce, instead, I can reproduce it consistently (the gap is way bigger, and only at the bottom) by using any DPI setting less than 120. On Xfce it's in: Settings -> Appearance -> Custom DPI setting and you can set any number there. By setting it to 120 I was able to work around the bug. It's a bit too big of a value for me, though, I don't like it. So I will keep trying other values. Do you know if in this Xfce setting it's a percentage or the actual DPI value? If I understand correctly, I have to calculate the value making sure that it is a whole number (no decimals)?
Regardless, this is still a bug, since it didn't happen in older Firefox versions.
Wót SamXubuntu
(I don't know anything about Xfce.)
It's certainly possible there was a change in Firefox that affects window dimensions. If you have time to run the Mozregression tool, you can help triangulate on the specific patch that did it: https://mozilla.github.io/mozregression/
jscher2000 - Support Volunteer said
Mozregression tool
Thanks but as you can see in the bug report I've already done that, but sadly they weren't able to find the cause.