Skip to content

Commit

Permalink
improve on_resized_timer
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Dec 2, 2024
1 parent 008d837 commit dc4e3ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* ubjson支持传输指针类型(感谢智明提供补丁)
* 增加弃用编译警告(感谢兆坤提供补丁)
* 修复dragger初始化与动画结束可能出现闪现的问题(感谢颖健提供补丁)
* 修复最大化过程会误触按钮的问题(感谢颖健提供补丁)

2024/11/30
* 增加函数 main\_loop\_post\_touch\_event
Expand Down
3 changes: 3 additions & 0 deletions src/main_loop/main_loop_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ static ret_t on_resized_timer(const timer_info_t* info) {
widget_t* wm = WIDGET(info->ctx);
widget_set_need_relayout_children(wm);
widget_invalidate_force(wm, NULL);
window_manager_set_ignore_input_events(wm, FALSE);

log_debug("on_resized_timer\n");
return RET_REMOVE;
Expand All @@ -251,6 +252,7 @@ static ret_t main_loop_sdl2_dispatch_window_event(main_loop_simple_t* loop, SDL_
event->window.data2);
break;
case SDL_WINDOWEVENT_RESIZED:
window_manager_set_ignore_input_events(l->wm, TRUE);
log_debug("Window %d resized to %dx%d\n", event->window.windowID, event->window.data1,
event->window.data2);
timer_add(on_resized_timer, l->wm, 100);
Expand All @@ -261,6 +263,7 @@ static ret_t main_loop_sdl2_dispatch_window_event(main_loop_simple_t* loop, SDL_
SDL_Window* win = SDL_GetWindowFromID(event->window.windowID);
native_window_t* native_window =
(native_window_t*)widget_get_prop_pointer(window_manager(), WIDGET_PROP_NATIVE_WINDOW);
window_manager_set_ignore_input_events(l->wm, TRUE);
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);
Expand Down

0 comments on commit dc4e3ef

Please sign in to comment.