improve window sdl focus

This commit is contained in:
lixianjing 2023-04-18 17:20:29 +08:00
parent 48dab8a03d
commit 6ce3bd1e30
2 changed files with 2 additions and 0 deletions

View File

@ -2,6 +2,7 @@
2023/04/18
* 修改离线画布用户自定义函数的宏名字(感谢智明提供补丁)
* 支持SDL点击窗口后自动聚焦(感谢智明提供补丁)
2023/04/15
* 增加cmd_args用于解析命令行参数。

View File

@ -658,6 +658,7 @@ ret_t native_window_sdl_init(bool_t shared, uint32_t w, uint32_t h) {
const char* title = system_info()->app_name;
SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1");
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_AUDIO) != 0) {
log_debug("Failed to initialize SDL: %s", SDL_GetError());
exit(0);