network: keep track of radio buttons in connection editor with action
Hooking to all the toggled signals from all the buttons for executing the same action is inneficient, and can potenticall end up in a segmentation fault due to some race in the signal emmission, where the active button gets deactivated before the clicked button is activated Looking at the GTK4 code, in a radio group: - The button which was previously active gets de-activated, emitting its corresponding toggled signal. - The active property for the clicked button gets set. - The clicked button emits its toggled signal. Therefore, if the first toggle signal gets processed before the active property is set, there can be a race condition. We are seeing this downstream at pmOS: https://gitlab.com/postmarketOS/pmaports/-/issues/1816 Instead of this racy behavior, follow upstream recommendation and keep track of the state through a stateful signal.
parent
aa66e593
Please register or sign in to comment