Merge pull request #81339 from bruvzg/macos_fix_mvk_live_resize
[macOS] Fix live resize with the latest MoltenVK version.
This commit is contained in:
commit
07176632a6
@ -47,9 +47,11 @@
|
|||||||
|
|
||||||
@interface GodotContentLayerDelegate : NSObject <CALayerDelegate> {
|
@interface GodotContentLayerDelegate : NSObject <CALayerDelegate> {
|
||||||
DisplayServer::WindowID window_id;
|
DisplayServer::WindowID window_id;
|
||||||
|
bool need_redraw;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setWindowID:(DisplayServer::WindowID)wid;
|
- (void)setWindowID:(DisplayServer::WindowID)wid;
|
||||||
|
- (void)setNeedRedraw:(bool)redraw;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
- (id)init {
|
- (id)init {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
window_id = DisplayServer::INVALID_WINDOW_ID;
|
window_id = DisplayServer::INVALID_WINDOW_ID;
|
||||||
|
need_redraw = false;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,13 +48,18 @@
|
|||||||
window_id = wid;
|
window_id = wid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setNeedRedraw:(bool)redraw {
|
||||||
|
need_redraw = redraw;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)displayLayer:(CALayer *)layer {
|
- (void)displayLayer:(CALayer *)layer {
|
||||||
DisplayServerMacOS *ds = (DisplayServerMacOS *)DisplayServer::get_singleton();
|
DisplayServerMacOS *ds = (DisplayServerMacOS *)DisplayServer::get_singleton();
|
||||||
if (OS::get_singleton()->get_main_loop() && ds->get_is_resizing()) {
|
if (OS::get_singleton()->get_main_loop() && ds->get_is_resizing() && need_redraw) {
|
||||||
Main::force_redraw();
|
Main::force_redraw();
|
||||||
if (!Main::is_iterating()) { // Avoid cyclic loop.
|
if (!Main::is_iterating()) { // Avoid cyclic loop.
|
||||||
Main::iteration();
|
Main::iteration();
|
||||||
}
|
}
|
||||||
|
need_redraw = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,6 +99,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
[super setFrameSize:newSize];
|
[super setFrameSize:newSize];
|
||||||
|
[layer_delegate setNeedRedraw:true];
|
||||||
[self.layer setNeedsDisplay]; // Force "drawRect" call.
|
[self.layer setNeedsDisplay]; // Force "drawRect" call.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user