I mainly use Linux so I don't know, but one of my work laptops have windows on it and it freaks out every time I connect it to a 4k monitor.
At least in linux I can use triggers and xrandr [1] to manage it even if it's not pretty, never figured out how to do it automatically in windows.
Edit: I am using KDE/Qt apps for 99% of my gui stuff. Gnome etc might be worse.
[1] http://wok.oblomov.eu/tecnologia/mixed-dpi-x11/#therandrway
This works today out-of-the-box in Wayland as long as the applications are Wayland native (e.g.: not being run through XWayland).
HiDPI is also in the works for XWayland, but it looks complicated and still a few months out.
At least that's how it was for me when I used a high dpi display (160 dpi) 2 yrs ago. (I switched back to 90dpi at some point, so they might have improved it by now)
I briefly tried out Gnome and KDE, with the former "meh" (no fractional scaling, scaling glitches when dragging between displays) and the latter garbage (couldn't find scaling settings at all, so nothing is readable on the laptop display).
Widows is between "okay" and "nice" (somewhat fractional scaling, glitches between displays, some wrong scalings, but it's rare).
I haven't tried macOS yet, but expect it to be flawless, like or slightly better than the experience on Wayfire.
My wife got a 4K desktop screen for her FHD laptop a few months ago and it made us switch her system to Plasma's Wayland session. Mixed DPI works fine, also dynamically (i.e. dock/undock).
MacOS handles it very well, moving a window from a high-DPI display to a low-DPI display works perfectly.
I'm not sure about how Windows handles mixed-DPI, but it handles DPI changes mostly OK. I only access my Windows machines via RDP, so sometimes they get a high-DPI display and sometimes they get a low-DPI one. Apart from one program (there are per-program settings available in Windows to help fix scaling issues) everything seems to handle it fine.
This distinction doesn’t exist on macOS for the most part, even “foreign” UI libraries will appear the correct size when changing screens.
I believe that on Wayland the apps are told the scaling factors of the monitors that they are on (or the compositor can scale them if they don't want to switch resolution or are across multiple monitors).
AFAIK apps can't work around this very easily (if at all).