Changing resolution with XRRSetCrtcConfig enables panning

When I change crtc config to lower resolution, then nvidia driver automatically enables panning. It is really messy, because for fullscreen game you can move the window outside of your display.

It affects all SDL2-based games that don’t grab pointer and it behaves similar with SDL2+vidmode.

I think that it’s a bug in the nvidia driver, because in xrandr protocol for RRSetCrtcConfig function it’s said:
“Disabled panning axes remain disabled”.

I can make a workaround and first turn off crtc, then change screen resolution so that it’s the same as crtc and then turn on crtc in wanted mode. Or I can grab pointer so that it won’t move outside of the window…

Personally I’m trying to fix this in STK:
and I will probably just grab pointer if panning is enabled.

It happens for me on nvidia GTX 1050 with 396.24 drivers. And it was happening for me with 390.xx too.

If you need, then I can prepare a simple application for testing, record a video how it looks etc.

In case you’re using kde, try disabling kscreen2 and see if it is still panning.