mirror of
https://github.com/amiwm/amiwm.git
synced 2026-03-24 01:24:15 +00:00
localize control flow and variables
State and control flow for modal mouse actions (dragging/resizing/etc) was fragmented and scattered through main.c, making code convoluted and hard to maintain. I fixed that by applying good structured programming practics: implementing sub-event-loops for those modal actions, rather than checking which modal action is currently in action at the main event-loop. That commit took me more time than i expected... abstract out all spaghettish, global-state control flow into a single, encapsulated scope for each modal action… test if i broke anything… find any dead code that is not used anymore (implementing that global state we had before)… I also put some `static` in global variables and routines, so the compile can warn whether an unused variable/function is defined (and help me on removing dead code).
This commit is contained in: