However when working with Pixel art games with indepednent resolution scaling and viewport manipulation (black bars) this added calculation makes things a little more complicated. Does anyone know if this is intended or a bug?
Ah great i’ll check this out, I had a look through monogame source and it seemed that hardware switch mostly only effected fullscreen state by finding closest resolution. I saw some suggestions it affects stretching of the back buffer so that could be where this title bar offset is getting messed up from.
Unfortunatly HardwareModeSwitch has no effect on this as i suspected as HardwareModeSwitch only rally effects the swapchain and fullscreen mode. This particular edge case is windowed mode at native resolution. What Monogame should do for windowed mode is force the back buffer too fit the clinet window size. For instance i could request 1920x1080 but the window with a boarder cannot accomidate that so it should force the back buffer to be 1920x1050 matching the window clinet size and keeping mouse in sync.
there are 2 options, monogame internally fixes the window to go above max, or force the back buffer to client rect .
But the best solution for right now is too manually check for this case and force the window to be borderless like so: