Merge branch 'release/1.10.x'

This commit is contained in:
rdb 2024-09-16 13:54:22 +02:00
commit f5401b19fa
5 changed files with 32 additions and 27 deletions

View File

@ -185,7 +185,7 @@ is_open() const {
*/
bool PipeStreamBuf::
eof_pipe() const {
return (_pipe == nullptr) && feof(_pipe);
return (_pipe == nullptr) || feof(_pipe);
}
/**

View File

@ -728,13 +728,12 @@ set_properties_now(WindowProperties &properties) {
// here.
if (!properties.has_undecorated() && !_properties.get_undecorated() &&
[_window respondsToSelector:@selector(setStyleMask:)]) {
if (properties.get_fixed_size()) {
[_window setStyleMask:NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask ];
} else {
[_window setStyleMask:NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask ];
NSUInteger style = ([_window styleMask] & NSFullScreenWindowMask);
style |= NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask;
if (!properties.get_fixed_size()) {
style |= NSResizableWindowMask;
}
[_window setStyleMask:style];
[_window makeFirstResponder:_view];
// Resize event fired by makeFirstResponder has an invalid backing scale factor
// The actual size must be reset afterward
@ -749,16 +748,14 @@ set_properties_now(WindowProperties &properties) {
_properties.set_undecorated(properties.get_undecorated());
if (!_properties.get_fullscreen()) {
if (properties.get_undecorated()) {
[_window setStyleMask: NSBorderlessWindowMask];
} else if (_properties.get_fixed_size()) {
// Fixed size windows should not show the resize button.
[_window setStyleMask: NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask ];
} else {
[_window setStyleMask: NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask ];
NSUInteger style = ([_window styleMask] & NSFullScreenWindowMask);
if (!properties.get_undecorated()) {
style |= NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask;
if (!properties.get_fixed_size()) {
style |= NSResizableWindowMask;
}
}
[_window setStyleMask:style];
[_window makeFirstResponder:_view];
// Resize event fired by makeFirstResponder has an invalid backing scale factor
// The actual size must be reset afterward
@ -1176,10 +1173,16 @@ do_switch_fullscreen(CGDisplayModeRef mode) {
}
if (_window != nil) {
// Exit macOS' own fullscreen mode, since our own fullscreen mode
// doesn't work properly with it.
if ([_window styleMask] & NSFullScreenWindowMask) {
[_window toggleFullScreen:nil];
}
// For some reason, setting the style mask makes it give up its
// first-responder status.
if ([_window respondsToSelector:@selector(setStyleMask:)]) {
[_window setStyleMask:NSBorderlessWindowMask];
[_window setStyleMask:([_window styleMask] & NSFullScreenWindowMask)];
}
[_window makeFirstResponder:_view];
[_window setLevel:CGShieldingWindowLevel()];

View File

@ -16,11 +16,11 @@
@implementation CocoaPandaApp
- (void) sendEvent: (NSEvent *) event {
// This is a hack that allows us to receive cmd-key-up events correctly.
// Also prevent it from eating the inserthelp key.
if (([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask))
||([event type] == NSKeyDown && [event keyCode] == 0x72)) {
// This is a hack that allows us to receive cmd-key-up events correctly, as
// well as key-up events during a full-screen transition.
// Also prevent it from eating the insert/help key.
if ([event type] == NSKeyUp ||
([event type] == NSKeyDown && [event keyCode] == 0x72)) {
[[self keyWindow] sendEvent: event];
} else {
[super sendEvent: event];

View File

@ -451,9 +451,11 @@ recompute_geom_node(const WorkingNodePath &np, LMatrix4 &rel_mat,
int num_geoms = node->get_num_geoms();
for (int i = 0; i < num_geoms; i++) {
PT(Geom) geom = node->modify_geom(i);
distort_cat.debug()
<< " " << *node << " got geom " << geom
<< ", cache_ref = " << geom->get_cache_ref_count() << "\n";
if (distort_cat.is_debug()) {
distort_cat.debug()
<< " " << *node << " got geom " << geom
<< ", cache_ref = " << geom->get_cache_ref_count() << "\n";
}
geom->test_ref_count_integrity();
recompute_geom(geom, rel_mat);
}

View File

@ -70,7 +70,7 @@ FLOATNAME(LOrientation)(const FLOATNAME(LMatrix4) &m) {
*/
INLINE_LINMATH FLOATNAME(LOrientation) FLOATNAME(LOrientation)::
operator * (const FLOATNAME(LRotation) &other) const {
return multiply((FLOATNAME(LOrientation) &)other);
return multiply((const FLOATNAME(LOrientation) &)other);
}
/**
@ -80,5 +80,5 @@ operator * (const FLOATNAME(LRotation) &other) const {
INLINE_LINMATH FLOATNAME(LOrientation) FLOATNAME(LOrientation)::
operator * (const FLOATNAME(LQuaternion) &other) const {
nassert_raise("LOrientation * LQuaternion is undefined; use LOrientation * LRotation or LQuaternion * LQuaternion");
return multiply((FLOATNAME(LOrientation) &)other);
return multiply((const FLOATNAME(LOrientation) &)other);
}