Best practice for handling Linux window change signal and mutable state

Hello @Zorcal welcome to ziggit :slight_smile:

The inner struct function cannot access outer local variables. It can access global variables.

When handlers are called, the normal execution of your program is interrupted in some unknown state.
Your best strategy is to do almost nothing in the handler; just notify the program about the change e.g. by raising a flag. Then your main program loop can handle the resize.

2 Likes