mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
Implement improvement upon eswartz' fix to properly handle programmatic window size changes on Mac OS X
Closes: #39
This commit is contained in:
commit
de65c02ef2
@ -798,16 +798,20 @@ set_properties_now(WindowProperties &properties) {
|
|||||||
int height = properties.get_y_size();
|
int height = properties.get_y_size();
|
||||||
|
|
||||||
if (!_properties.get_fullscreen()) {
|
if (!_properties.get_fullscreen()) {
|
||||||
_properties.set_size(width, height);
|
|
||||||
if (_window != nil) {
|
if (_window != nil) {
|
||||||
[_window setContentSize:NSMakeSize(width, height)];
|
[_window setContentSize:NSMakeSize(width, height)];
|
||||||
}
|
}
|
||||||
[_view setFrameSize:NSMakeSize(width, height)];
|
[_view setFrameSize:NSMakeSize(width, height)];
|
||||||
|
|
||||||
cocoadisplay_cat.debug()
|
if (cocoadisplay_cat.is_debug()) {
|
||||||
<< "Setting size to " << width << ", " << height << "\n";
|
cocoadisplay_cat.debug()
|
||||||
|
<< "Setting size to " << width << ", " << height << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
_context_needs_update = true;
|
// Cocoa doesn't send an event, and the other
|
||||||
|
// resize-window handlers will do nothing once the properties
|
||||||
|
// have been changed, so do this now
|
||||||
|
handle_resize_event();
|
||||||
properties.clear_size();
|
properties.clear_size();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -45,8 +45,10 @@
|
|||||||
- (void) drawRect:(NSRect)dirtyRect {
|
- (void) drawRect:(NSRect)dirtyRect {
|
||||||
// Do nothing. We draw from another thread.
|
// Do nothing. We draw from another thread.
|
||||||
|
|
||||||
cocoadisplay_cat.spam()
|
if (cocoadisplay_cat.is_spam()) {
|
||||||
<< "drawRect was called.\n";
|
cocoadisplay_cat.spam()
|
||||||
|
<< "drawRect was called.\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) finalize {
|
- (void) finalize {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user