decouple renderer/events on mac

This commit is contained in:
2018-08-08 17:42:56 +02:00
parent d57d4f3490
commit 72fbbb08a3
3 changed files with 156 additions and 61 deletions

View File

@@ -49,8 +49,10 @@ void App::pick_image(std::function<void(std::string path)> callback)
#ifdef __IOS__
[ios_view pick_photo:callback];
#elif __OSX__
std::string path = [osx_view pick_file];
callback(path);
dispatch_async(dispatch_get_main_queue(), ^{
std::string path = [osx_view pick_file];
callback(path);
});
#elif __ANDROID__
//displayKeyboard(and_app, false);
#elif _WIN32

View File

@@ -577,7 +577,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
tasklist.emplace_back([wp] {
App::I.key_down(convert_key((int)wp));
});
break;
}
break;
case WM_SYSKEYUP:
@@ -640,7 +639,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
tasklist.emplace_back([lp]{
App::I.mouse_up(1, (float)GET_X_LPARAM(lp), (float)GET_Y_LPARAM(lp), kEventSource::Mouse);
});
break;
}
break;
case WM_MOUSEWHEEL: