WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
43.96k stars 1.92k forks source link

impr: Stop rubber banding while resizing on macOS #1690

Closed mentlerd closed 4 months ago

mentlerd commented 4 months ago

Problem description

On macOS glfwSetWindowSizeCallback is invoked early during window resizing, rendering a frame in that callback leads to wonky results as the new framebuffer is swapped before the OS has the chance to actually resize the window:

https://github.com/WerWolv/ImHex/assets/1068675/46336419-3fc2-4aa1-b16f-68b0c00e3584

Implementation description

Window contents are redrawn only from glfwSetWindowRefreshCallback during resizing, fixing the issue:

https://github.com/WerWolv/ImHex/assets/1068675/3acc5d4a-b2a5-42f0-9015-5e7172a027cf

WerWolv commented 4 months ago

God damn I tried everything to get rid of that and decided that it must be Apple's composer just doing that with OpenGL canvases. Thank you!