mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-22 02:19:44 +00:00
Redraw the windows frame from WM_SIZE and keep its style
The refresh callback is triggered by WM_PAINT, but windows does not send it while a border is dragged: the window class has neither CS_HREDRAW nor CS_VREDRAW and nothing invalidates the client area. Only WM_SIZE arrives, so nothing was drawn during such a resize. The frame is drawn from WM_SIZE now, after forwarding the message to GLFW so that the new size is already in. WM_NCHITTEST re-applies the style bits the engine frame needs and which GLFW drops on every window mode change, taking the drag area with them. Every frame setup logs whether the subclass had to be installed again, so a lost window procedure is visible in the log. The live resize switch is honoured by the GLFW backend as well: with it off the frame from the message loop is skipped and the window keeps showing what the system stretches.
This commit is contained in:
parent
4f9b125e17
commit
4d1b4a1638
5 changed files with 100 additions and 25 deletions
|
|
@ -73,14 +73,12 @@ function on_open()
|
|||
"display.compact-window-bar.tooltip"
|
||||
)
|
||||
end
|
||||
-- live rendering only has the cached frame as its alternative, which is
|
||||
-- what the native wayland backend does
|
||||
if app.get_window_backend() == "wayland" then
|
||||
create_checkbox(
|
||||
"display.live-resize", "Live Window Resize",
|
||||
"display.live-resize.tooltip"
|
||||
)
|
||||
end
|
||||
-- every backend has an alternative to redrawing during a resize: the
|
||||
-- cached frame on wayland, the frame the system stretches elsewhere
|
||||
create_checkbox(
|
||||
"display.live-resize", "Live Window Resize",
|
||||
"display.live-resize.tooltip"
|
||||
)
|
||||
|
||||
create_checkbox("camera.shaking", "Camera Shaking")
|
||||
create_checkbox("camera.inertia", "Camera Inertia")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue