Window resizing causes flickering and strange results on Windows #21
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See video: https://cdn.discordapp.com/attachments/1126271320364167299/1131356073949921310/20230719_174430.mp4
I am away from my PC now but can get the specs later if necessary...
The reason for the view popping out of the window are all very silly:
I can fix the buffer resizing and the window repositionning stuff, but I have bumped onto another problem with this hack:
glViewport()that are set wrt the surface's window, which is now of different dimensions/positions than the user-specified surface frame.Besides, we're not really using the ability to set the surface's frame! I did use it in the jam prototype to restrict the area where the wasm guest can draw, ie to separate the "chrome" from the app's client area. There's not really a chrome in this version (there might be in the launcher version).
So, maybe for now I can just entirely remove the ability to set surfaces' frames, and always make them the size of the window's content rect (and thus auto-resize).
autoresizeMaskof sublayers.glViewport().Later if we need to separate the orca "chrome" from the app's area, we could always come up with a way to expose true child windows (that don't need to be transparent), and have the app's surface be created for a child window instead of the main window.
We could also try to avoid the whole hack of top-level transparent windows and instead do the surface compositing ourselves, but this requires some level of interop between the different surfaces (e.g. being able to write to a texture using a GLES backend and read from it using a desktop GL or D3D backend, without doing a GPU<->CPU roundtrip).
Fixed in
23f0d75e20. As discussed above, surfaces are now autoresized to the window contents dimensions (meaning we can't manually set their frame inside the window). This simplifies the handling of surfaces on Windows a bit.There's still some caveats with resizing though (see #24), but at least the flickering and jumping around should be fixed.