antonioginer / switchres

Modeline generation engine for emulation
44 stars 12 forks source link

Linux: Fix SDL bug that causes graphics corruption #55

Open substring opened 4 years ago

substring commented 4 years ago

Fix SDL bug that causes graphics corruption when the new resolution is bigger than current desktop size. Probably linked to the initial size assigned at windows creation.

D0023R commented 4 years ago

The issue is related to the size of the screen buffer being less than the new resolution. SDL2 does not modify the screen size when a new mode is set. In SR with -modesetting, the screen is resized and it fixes the issue.

Linked to SDL2, the origin of the screen is not updated after SDL2 video init is performed. It can be patched to calculate origin when usable boundaries function is called. Nevertheless, it would be better if the X notify event is used to address any screen modification performed outside of SDL2 during execution.