From d8a9f12a4fa4ed81f02ccc722fb9cfeb8e37f7cb Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Mon, 6 Sep 2021 15:21:02 +0300 Subject: [PATCH] Smooth scrolling in the SDL port on macOS --- SDL/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SDL/main.c b/SDL/main.c index 796eeff..7861ac6 100644 --- a/SDL/main.c +++ b/SDL/main.c @@ -682,10 +682,21 @@ static bool get_arg_flag(const char *flag, int *argc, char **argv) return false; } +#ifdef __APPLE__ +#include +static void enable_smooth_scrolling(void) +{ + CFPreferencesSetAppValue(CFSTR("AppleMomentumScrollSupported"), kCFBooleanTrue, kCFPreferencesCurrentApplication); +} +#endif + int main(int argc, char **argv) { #ifdef _WIN32 SetProcessDPIAware(); +#endif +#ifdef __APPLE__ + enable_smooth_scrolling(); #endif fprintf(stderr, "SameBoy v" GB_VERSION "\n");