diff options
Diffstat (limited to 'src/macos.m')
-rw-r--r-- | src/macos.m | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/macos.m b/src/macos.m index 4ad267c1..191842f6 100644 --- a/src/macos.m +++ b/src/macos.m | |||
@@ -72,10 +72,10 @@ static NSString *currentSystemAppearance_(void) { | |||
72 | } | 72 | } |
73 | 73 | ||
74 | iBool shouldDefaultToMetalRenderer_MacOS(void) { | 74 | iBool shouldDefaultToMetalRenderer_MacOS(void) { |
75 | /* TODO: Test if SDL 2.0.16 works better (no stutters with Metal?). */ | ||
76 | return iFalse; /* | ||
77 | const iInt2 ver = macVer_(); | 75 | const iInt2 ver = macVer_(); |
78 | return ver.x > 10 || ver.y > 13;*/ | 76 | SDL_DisplayMode dispMode; |
77 | SDL_GetDesktopDisplayMode(0, &dispMode); | ||
78 | return dispMode.refresh_rate > 60 && (ver.x > 10 || ver.y > 13); | ||
79 | } | 79 | } |
80 | 80 | ||
81 | static void ignoreImmediateKeyDownEvents_(void) { | 81 | static void ignoreImmediateKeyDownEvents_(void) { |
@@ -436,6 +436,10 @@ static iBool processScrollWheelEvent_(NSEvent *event) { | |||
436 | const iBool isInertia = (event.momentumPhase & (NSEventPhaseBegan | NSEventPhaseChanged)) != 0; | 436 | const iBool isInertia = (event.momentumPhase & (NSEventPhaseBegan | NSEventPhaseChanged)) != 0; |
437 | const iBool isEnded = event.scrollingDeltaX == 0.0f && event.scrollingDeltaY == 0.0f && !isInertia; | 437 | const iBool isEnded = event.scrollingDeltaX == 0.0f && event.scrollingDeltaY == 0.0f && !isInertia; |
438 | const iWindow *win = &get_MainWindow()->base; | 438 | const iWindow *win = &get_MainWindow()->base; |
439 | if (event.window != nsWindow_(win->win)) { | ||
440 | /* Not the main window. */ | ||
441 | return iFalse; | ||
442 | } | ||
439 | if (isPerPixel) { | 443 | if (isPerPixel) { |
440 | /* On macOS 12.1, stopping ongoing inertia scroll with a tap seems to sometimes produce | 444 | /* On macOS 12.1, stopping ongoing inertia scroll with a tap seems to sometimes produce |
441 | spurious large scroll events. */ | 445 | spurious large scroll events. */ |
@@ -525,7 +529,6 @@ static iBool processScrollWheelEvent_(NSEvent *event) { | |||
525 | ev.wheel.y = iSign(ev.wheel.y); | 529 | ev.wheel.y = iSign(ev.wheel.y); |
526 | } | 530 | } |
527 | #endif | 531 | #endif |
528 | |||
529 | return iTrue; | 532 | return iTrue; |
530 | } | 533 | } |
531 | 534 | ||
@@ -734,7 +737,7 @@ enum iColorId removeColorEscapes_String(iString *d) { | |||
734 | static NSString *cleanString_(const iString *ansiEscapedText) { | 737 | static NSString *cleanString_(const iString *ansiEscapedText) { |
735 | iString mod; | 738 | iString mod; |
736 | initCopy_String(&mod, ansiEscapedText); | 739 | initCopy_String(&mod, ansiEscapedText); |
737 | iRegExp *ansi = makeAnsiEscapePattern_Text(); | 740 | iRegExp *ansi = makeAnsiEscapePattern_Text(iTrue /* with ESC */); |
738 | replaceRegExp_String(&mod, ansi, "", NULL, NULL); | 741 | replaceRegExp_String(&mod, ansi, "", NULL, NULL); |
739 | iRelease(ansi); | 742 | iRelease(ansi); |
740 | NSString *clean = [NSString stringWithUTF8String:cstr_String(&mod)]; | 743 | NSString *clean = [NSString stringWithUTF8String:cstr_String(&mod)]; |