https://bugs.kde.org/show_bug.cgi?id=510569
--- Comment #7 from Noah Davis <[email protected]> --- OK, so it seems that it's impossible to be sure when DPRs are correct on Wayland unless you already know which screens should have fractional DPRs (from a programmer's perspective). Here's the process on wayland: 1. Does the window have a QPlatformWindow (QWindow::handle)? If not and the screen for the window has a DPR that isn't 1, it's wrong, so you can expect a DevicePixelRatioChange event later. Be aware that you can get DevicePixelRatioChange events even when handle() == nullptr. 2. Is the window visible? If not and the true DPR is fractional, then expect a DevicePixelRatioChange event later. This means that for fractional DPRs, you should expect one or two DevicePixelRatioChange events and you can expect the DPR to be correct when handle() != nullptr && isVisible() == true. The problem is that checking for that condition doesn't work anymore when integer DPRs are used since the windows don't send DevicePixelRatioChange events unless the DPR actually changes. You have to know ahead of time which of the windows should have a fractional scale to know which kind of logic to use. I guess I could just use a 100ms QTimer and hope it's good enough, but that sucks since people already complain about how slow Spectacle is to launch and people complained about built-in workaround delays before. I did test 5ms and that seems to work, but that might just be because my PC is fast enough. I'd hate to have a situation where the user's PC is too slow even for a 100ms timer. -- You are receiving this mail because: You are watching all bug changes.
