Add momentum scroll for macos

Taken from @mathewmariani lite-macos
This commit is contained in:
Francesco Abbate 2021-04-21 09:52:16 +02:00
parent 1f6680b492
commit 12ca5f3d2a
2 changed files with 11 additions and 1 deletions

View File

@ -9,3 +9,11 @@ void set_macos_bundle_resources(lua_State *L)
lua_setglobal(L, "MACOS_RESOURCES");
}}
/* Thanks to mathewmariani, taken from his lite-macos github repository. */
void enable_momentum_scroll() {
[[NSUserDefaults standardUserDefaults]
setBool: YES
forKey: @"AppleMomentumScrollSupported"];
}

View File

@ -97,6 +97,7 @@ static void init_window_icon(void) {
#ifdef __APPLE__
void set_macos_bundle_resources(lua_State *L);
void enable_momentum_scroll();
#endif
int main(int argc, char **argv) {
@ -154,6 +155,7 @@ init_lua:
#ifdef __APPLE__
set_macos_bundle_resources(L);
enable_momentum_scroll();
#endif
const char *init_lite_code = \