Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit fc75efc

Browse files
committed
Merge remote-tracking branch 'upstream/release-9.6.2' into merge-release-9.6.2-04.05.2021
2 parents 622f4b1 + 2affde0 commit fc75efc

File tree

9 files changed

+53
-62
lines changed

9 files changed

+53
-62
lines changed

config/mac.gypi

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
'STRIP_INSTALLED_PRODUCT': 'NO',
3131
'CLANG_LINK_OBJC_RUNTIME': 'NO',
3232
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
33-
'CLANG_CXX_LIBRARY': 'libc++'
33+
'CLANG_CXX_LIBRARY': 'libc++'
3434
},
3535

3636
'target_defaults':
@@ -47,6 +47,7 @@
4747
'debug_info_suffix': '.dSYM',
4848

4949
'silence_warnings': 0,
50+
'travis': '<!(echo ${TRAVIS})',
5051
},
5152

5253
'target_conditions':
@@ -70,6 +71,21 @@
7071
],
7172
},
7273
],
74+
[
75+
'travis == ""',
76+
{
77+
'xcode_settings':
78+
{
79+
'OTHER_LDFLAGS':
80+
[
81+
'-Wl,-platform_version',
82+
'-Wl,macos',
83+
'-Wl,10.9',
84+
'-Wl,10.9',
85+
],
86+
},
87+
},
88+
],
7389
[
7490
# Non-bundle loadable module should have a .dylib suffix
7591
# and be linked as libraries, not bundles

docs/notes/bugfix-23154.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix engine lockup when restoring window after maximizing on Macos Big Sur

docs/notes/bugfix-23172.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix 100% CPU usage when the player control is set to load an unplayable media file on Macos Big Sur

docs/notes/bugfix-23173.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix rectangle border inset too much when printing on Windows or to PDF

docs/notes/bugfix-23176.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ensure externals are not blocked by hardened runtime

engine/src/customprinter.cpp

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,15 @@ bool MCCustomMetaContext::candomark(MCMark *p_mark)
357357
MCUnreachableReturn(false);
358358
}
359359

360+
MCRectangle MCCustomPrinterInsetRectangle(const MCRectangle &p_rect, uint32_t p_inset)
361+
{
362+
/* TODO - fix half pixels lost when insetting by odd integers */
363+
return MCRectangleMake(p_rect.x + p_inset / 2,
364+
p_rect.y + p_inset / 2,
365+
MCMax(0, (int32_t)p_rect.width - p_inset),
366+
MCMax(0, (int32_t)p_rect.height - p_inset));
367+
}
368+
360369
void MCCustomMetaContext::domark(MCMark *p_mark)
361370
{
362371
// If an error has occurred, we do nothing.
@@ -399,16 +408,7 @@ void MCCustomMetaContext::domark(MCMark *p_mark)
399408
break;
400409
case MARK_TYPE_RECTANGLE:
401410
{
402-
// MM-2014-04-23: [[ Bug 11884 ]] Inset the bounds. Since MCPath only accepts ints, if the inset value is uneven,
403-
// round up to the nearest even value, keeping behaviour as close to that of the graphics context as possible.
404-
// SN-2014-10-17: [[ Bug 13351 ]] Only round up existing inset
405-
if (p_mark -> rectangle . inset && (p_mark -> rectangle . inset % 2))
406-
p_mark -> rectangle . inset ++;
407-
// SN-2014-10-17: [[ Bug 13351 ]] Be careful not to underflow the bounds
408-
p_mark -> rectangle . bounds = MCRectangleMake(p_mark -> rectangle . bounds . x + p_mark -> rectangle . inset / 2,
409-
p_mark -> rectangle . bounds . y + p_mark -> rectangle . inset / 2,
410-
MCMin(p_mark -> rectangle . bounds . width, p_mark -> rectangle . bounds . width - p_mark -> rectangle . inset),
411-
MCMin(p_mark -> rectangle . bounds . height, p_mark -> rectangle . bounds . height - p_mark -> rectangle . inset));
411+
p_mark -> rectangle . bounds = MCCustomPrinterInsetRectangle(p_mark -> rectangle . bounds, p_mark -> rectangle . inset);
412412

413413
MCPath *t_path;
414414
if (p_mark -> stroke != nil && p_mark -> rectangle . bounds . height == 1)
@@ -428,16 +428,7 @@ void MCCustomMetaContext::domark(MCMark *p_mark)
428428
break;
429429
case MARK_TYPE_ROUND_RECTANGLE:
430430
{
431-
// MM-2014-04-23: [[ Bug 11884 ]] Inset the bounds. Since MCPath only accepts ints, if the inset value is uneven,
432-
// round up to the nearest even value, keeping behaviour as close to that of the graphics context as possible.
433-
// SN-2014-10-17: [[ Bug 13351 ]] Only round up existing inset
434-
if (p_mark -> round_rectangle . inset % 2)
435-
p_mark -> round_rectangle . inset ++;
436-
// SN-2014-10-17: [[ Bug 13351 ]] Be careful not to underflow the bounds
437-
p_mark -> round_rectangle . bounds = MCRectangleMake(p_mark -> round_rectangle . bounds . x + p_mark -> round_rectangle . inset / 2,
438-
p_mark -> round_rectangle . bounds . y + p_mark -> round_rectangle . inset / 2,
439-
MCMin(p_mark -> round_rectangle . bounds . width, p_mark -> round_rectangle . bounds . width - p_mark -> round_rectangle . inset),
440-
MCMin(p_mark -> round_rectangle . bounds . height, p_mark -> round_rectangle . bounds . height - p_mark -> round_rectangle . inset));
431+
p_mark -> round_rectangle . bounds = MCCustomPrinterInsetRectangle(p_mark -> round_rectangle . bounds, p_mark -> round_rectangle . inset);
441432

442433
MCPath *t_path;
443434
t_path = MCPath::create_rounded_rectangle(p_mark -> round_rectangle . bounds, p_mark -> round_rectangle . radius / 2, p_mark -> stroke != nil);
@@ -452,16 +443,7 @@ void MCCustomMetaContext::domark(MCMark *p_mark)
452443
break;
453444
case MARK_TYPE_ARC:
454445
{
455-
// MM-2014-04-23: [[ Bug 11884 ]] Inset the bounds. Since MCPath only accepts ints, if the inset value is uneven,
456-
// round up to the nearest even value, keeping behaviour as close to that of the graphics context as possible.
457-
// SN-2014-10-17: [[ Bug 13351 ]] Only round up existing inset
458-
if (p_mark -> arc . inset % 2)
459-
p_mark -> arc . inset ++;
460-
// SN-2014-10-17: [[ Bug 13351 ]] Be careful not to underflow the bounds
461-
p_mark -> arc . bounds = MCRectangleMake(p_mark -> arc . bounds . x + p_mark -> arc . inset / 2,
462-
p_mark -> arc . bounds . y + p_mark -> arc . inset / 2,
463-
MCMin(p_mark -> arc . bounds . width, p_mark -> arc . bounds . width - p_mark -> arc . inset),
464-
MCMin(p_mark -> arc . bounds . height, p_mark -> arc . bounds . height - p_mark -> arc . inset));
446+
p_mark -> arc . bounds = MCCustomPrinterInsetRectangle(p_mark -> arc . bounds, p_mark -> arc . inset);
465447

466448
MCPath *t_path;
467449
if (p_mark -> arc . complete)

engine/src/mac-av-player.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,13 @@ - (void)setPlayer:(AVPlayer *)player
818818
Unload();
819819
return;
820820
}
821+
822+
/* If there are no playable tracks then reset the player and exit */
823+
if (m_player.currentItem.asset.tracks.count == 0)
824+
{
825+
Unload();
826+
return;
827+
}
821828

822829
/* UNCHECKED */ MCAVPlayerSetupPanningFilter(m_player, &m_panning_filter);
823830

engine/src/mac-window.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2249,7 +2249,7 @@ void MCMacPlatformHandleDrawSync(NSWindow *window)
22492249
// we enter the runloop to trigger a redraw. This will cause drawRect to be invoked on our view
22502250
// which in turn will result in a redraw window callback being sent.
22512251
// The timeout value of 0.02ms is specified to avoid hitting the 60hz redraw limit.
2252-
if (!s_inside_focus_event && !s_showing_sheet && ![m_delegate inUserReshape])
2252+
if (MCMacPlatformIsEventCheckingEnabled() && !s_inside_focus_event)
22532253
{
22542254
// Since we remove all ApplicationDefined events from the queue we need to
22552255
// re-queue the events we're not interested in once the redraw has occured.

engine/src/w32printer.cpp

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,15 @@ bool MCGDIMetaContext::candomark(MCMark *mark)
534534
return mark -> type != MARK_TYPE_GROUP;
535535
}
536536

537+
inline MCRectangle MCGDIInsetRectangle(const MCRectangle &p_rect, uint32_t p_inset)
538+
{
539+
/* TODO - fix half pixels lost when insetting by odd integers */
540+
return MCRectangleMake(p_rect.x + p_inset / 2,
541+
p_rect.y + p_inset / 2,
542+
MCMax(0, (int32_t)p_rect.width - p_inset),
543+
MCMax(0, (int32_t)p_rect.height - p_inset));
544+
}
545+
537546
void MCGDIMetaContext::domark(MCMark *p_mark)
538547
{
539548
HDC t_dc;
@@ -826,16 +835,7 @@ void MCGDIMetaContext::domark(MCMark *p_mark)
826835
case MARK_TYPE_RECTANGLE:
827836
{
828837
if (t_should_inset)
829-
{
830-
// MM-2014-04-23: [[ Bug 11884 ]] Inset the bounds. Since GDI only accepts ints, if the inset value is uneven,
831-
// round up to the nearest even value, keeping behaviour as close to that of the graphics context as possible.
832-
if (p_mark -> rectangle . inset % 2)
833-
p_mark -> rectangle . inset ++;
834-
p_mark -> rectangle . bounds = MCRectangleMake(p_mark -> rectangle . bounds . x + p_mark -> rectangle . inset / 2,
835-
p_mark -> rectangle . bounds . y + p_mark -> rectangle . inset / 2,
836-
p_mark -> rectangle . bounds . width - p_mark -> rectangle . inset,
837-
p_mark -> rectangle . bounds . height - p_mark -> rectangle . inset);
838-
}
838+
p_mark->rectangle.bounds = MCGDIInsetRectangle(p_mark->rectangle.bounds, p_mark->rectangle.inset);
839839

840840
Rectangle(t_dc, p_mark -> rectangle . bounds . x, p_mark -> rectangle . bounds . y,
841841
p_mark -> rectangle . bounds . x + p_mark -> rectangle . bounds . width,
@@ -846,16 +846,7 @@ void MCGDIMetaContext::domark(MCMark *p_mark)
846846
case MARK_TYPE_ROUND_RECTANGLE:
847847
{
848848
if (t_should_inset)
849-
{
850-
// MM-2014-04-23: [[ Bug 11884 ]] Inset the bounds. Since GDI only accepts ints, if the inset value is uneven,
851-
// round up to the nearest even value, keeping behaviour as close to that of the graphics context as possible.
852-
if (p_mark -> round_rectangle . inset % 2)
853-
p_mark -> round_rectangle . inset ++;
854-
p_mark -> round_rectangle . bounds = MCRectangleMake(p_mark -> round_rectangle . bounds . x + p_mark -> round_rectangle . inset / 2,
855-
p_mark -> round_rectangle . bounds . y + p_mark -> round_rectangle . inset / 2,
856-
p_mark -> round_rectangle . bounds . width - p_mark -> round_rectangle . inset,
857-
p_mark -> round_rectangle . bounds . height - p_mark -> round_rectangle . inset);
858-
}
849+
p_mark->round_rectangle.bounds = MCGDIInsetRectangle(p_mark->round_rectangle.bounds, p_mark->round_rectangle.inset);
859850

860851
RoundRect(t_dc, p_mark -> round_rectangle . bounds . x, p_mark -> round_rectangle . bounds . y,
861852
p_mark -> round_rectangle . bounds . x + p_mark -> round_rectangle . bounds . width,
@@ -866,16 +857,7 @@ void MCGDIMetaContext::domark(MCMark *p_mark)
866857

867858
case MARK_TYPE_ARC:
868859
if (t_should_inset)
869-
{
870-
// MM-2014-04-23: [[ Bug 11884 ]] Inset the bounds. Since GDI only accepts ints, if the inset value is uneven,
871-
// round up to the nearest even value, keeping behaviour as close to that of the graphics context as possible.
872-
if (p_mark -> arc . inset % 2)
873-
p_mark -> arc . inset ++;
874-
p_mark -> arc . bounds = MCRectangleMake(p_mark -> arc . bounds . x + p_mark -> arc . inset / 2,
875-
p_mark -> arc . bounds . y + p_mark -> arc . inset / 2,
876-
p_mark -> arc . bounds . width - p_mark -> arc . inset,
877-
p_mark -> arc . bounds . height - p_mark -> arc . inset);
878-
}
860+
p_mark->arc.bounds = MCGDIInsetRectangle(p_mark->arc.bounds, p_mark->arc.inset);
879861

880862
gdi_do_arc(t_dc, NULL, p_mark -> stroke == NULL, p_mark -> arc . bounds . x, p_mark -> arc . bounds . y, p_mark -> arc . bounds . x + p_mark -> arc . bounds . width, p_mark -> arc . bounds . y + p_mark -> arc . bounds . height, p_mark -> arc . start, p_mark -> arc . start + p_mark -> arc . angle);
881863
if (p_mark -> stroke != NULL)

0 commit comments

Comments
 (0)