Fix rendering errors caused by dragging the window across monitors with different DPI scaling. #7757
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I create a window using the docking branch and enable the following settings, some rendering issues occur when dragging between monitors with different DPI scaling.
I found that dragging in NoDecoration mode relies on using glfwSetWindowPos, and the window triggers a resize when crossing monitors. However, the resize triggered by glfwSetWindowPos occurs immediately in the current frame, which means some operations depending on PlatformRequestResize might have already completed. Additionally, the PlatformRequestResize flag is cleared at the end of the frame. Therefore, we need to consider delaying the resize triggered by glfwSetWindowPos to the next frame to ensure that operations related to PlatformRequestResize are fully executed.
I only handled the related issue in GLFW, but other backends might have similar problems. Perhaps other window events could also have similar issues (triggered in the current frame but not fully processed before being cleared).
The related issues:
#7689 #6444