Skip to content

Commit

Permalink
[C libgui] Dispatch window resized event to all elements upon reception
Browse files Browse the repository at this point in the history
  • Loading branch information
codyd51 committed Feb 7, 2024
1 parent 5c97bf7 commit ba45f9b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions programs/subprojects/libgui/libgui.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,21 @@ static void _handle_amc_messages(gui_application_t* app, bool should_block, bool
continue;
}
else if (event == AWM_WINDOW_RESIZED) {
/*
got_resize_msg = true;
awm_window_resized_msg_t* m = (awm_window_resized_msg_t*)msg->body;
newest_resize_msg = *m;
continue;
*/
//awm_window_resized_msg_t* m = (awm_window_resized_msg_t*)&newest_resize_msg;
awm_window_resized_msg_t* m = (awm_window_resized_msg_t*)msg->body;
window->size = m->new_size;
//printf("%ld handling resize message %d %d\n", getpid(), m->new_size.width, m->new_size.height);
for (uint32_t i = 0; i < window->all_gui_elems->size; i++) {
gui_elem_t* elem = array_lookup(window->all_gui_elems, i);
elem->base._priv_window_resized_cb(elem, window->size);
}
continue;
}
else if (event == AWM_WINDOW_RESIZE_ENDED) {
continue;
Expand Down

0 comments on commit ba45f9b

Please sign in to comment.