summaryrefslogtreecommitdiff
path: root/src/macos.m
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-06 15:07:17 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-06 15:07:17 +0200
commit076e34aa8d1e57cbf3142abdc91c8e88d21b75d6 (patch)
tree3ee91315ee1a083b74d84637af28252f039fa084 /src/macos.m
parentedb260848a42de2e1af44cab93dbf267d20e1f6f (diff)
parent53ab74c3a25521faa6f41b40b1969a3b8e8ad027 (diff)
Merge branch 'dev' into work/v1.11
# Conflicts: # CMakeLists.txt # res/fonts/SmolEmoji-Regular.ttf # res/lang/gl.bin # src/app.c
Diffstat (limited to 'src/macos.m')
-rw-r--r--src/macos.m13
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
74iBool shouldDefaultToMetalRenderer_MacOS(void) { 74iBool 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
81static void ignoreImmediateKeyDownEvents_(void) { 81static 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) {
734static NSString *cleanString_(const iString *ansiEscapedText) { 737static 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)];