mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #160570: macOS: Broken window drawing on fullscreen window restoration
When Blender was opened with a fullscreen window, either by starting Blender with the `--window-fullscreen` CLI option or by using a startup.blender that was saved as fullscreen, window drawing would be slightly broken and drawn out of bound until framebuffer drawn size was refreshed. When using the macOS Stage Manager, the problem would be exacerbated with the drawn Metal framebuffer content not matching the window size, even after a size change refresh (as shown in #160570). The issue came from the GHOST macOS WindowCocoa ctor restoring the fullscreen TWindowState at the very end of the constructor *after* the metalLayer drawn size was computed, leading to various issue. Fixed by moving the fullscreen restoration logic between the drawing size computation/update logic and the view/layer setup, and (importantly) moving the makeKeyAndOrderFront window method call to the bottom of the function to ensure the window is only made key when fully setup. Pull Request: https://projects.blender.org/blender/blender/pulls/160923
This commit is contained in:
parent
effabfaae3
commit
2dd8b4c7c5
1 changed files with 5 additions and 5 deletions
|
|
@ -428,7 +428,9 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa,
|
|||
window_.contentView = view;
|
||||
window_.initialFirstResponder = view;
|
||||
|
||||
[window_ makeKeyAndOrderFront:nil];
|
||||
if (state == GHOST_kWindowStateFullScreen) {
|
||||
setState(GHOST_kWindowStateFullScreen);
|
||||
}
|
||||
|
||||
updateDrawingSize();
|
||||
|
||||
|
|
@ -463,11 +465,9 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa,
|
|||
window_.collectionBehavior = NSWindowCollectionBehaviorFullScreenPrimary;
|
||||
}
|
||||
|
||||
if (state == GHOST_kWindowStateFullScreen) {
|
||||
setState(GHOST_kWindowStateFullScreen);
|
||||
}
|
||||
|
||||
setNativePixelSize();
|
||||
|
||||
[window_ makeKeyAndOrderFront:nil];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue