improve main_loop_sdl2 on android

This commit is contained in:
lixianjing 2022-10-11 17:26:39 +08:00
parent 4ae62f0b44
commit 8513f3e5d3
2 changed files with 7 additions and 5 deletions

View File

@ -3,6 +3,8 @@
2022/10/11
* fscript_widget新增show_fps接口(感谢雨欣提供补丁)
* 完善高亮策略中的update_background功能(感谢雨欣提供补丁)
* 修复安卓下修改system_info的分辨率不正确的问题(感谢智明提供补丁)
* 修复gif控件编译警告的问题(感谢智明提供补丁)
2022/10/10
* 修复awtk拼写错误和格式问题(感谢兆坤提供补丁)

View File

@ -209,13 +209,13 @@ static ret_t main_loop_sdl2_dispatch_window_event(main_loop_simple_t* loop, SDL_
timer_add(on_resized_timer, l->wm, 100);
break;
case SDL_WINDOWEVENT_SIZE_CHANGED: {
native_window_info_t info;
event_t e = event_init(EVT_NATIVE_WINDOW_RESIZED, NULL);
SDL_Window* win = SDL_GetWindowFromID(event->window.windowID);
int ww = 0;
int wh = 0;
SDL_GetWindowSize(win, &ww, &wh);
system_info_set_lcd_w(system_info(), ww);
system_info_set_lcd_h(system_info(), wh);
native_window_t* native_window = (native_window_t*)widget_get_prop_pointer(window_manager(), WIDGET_PROP_NATIVE_WINDOW);
native_window_get_info(native_window, &info);
system_info_set_lcd_w(system_info(), info.w);
system_info_set_lcd_h(system_info(), info.h);
window_manager_dispatch_native_window_event(l->wm, &e, win);
timer_add(on_resized_timer, l->wm, 100);
break;