I'm working on a desktop application with GTK3 in C. I want to capture keyboard layout change events. I could not find any useful solutions online. The few solutions I found online were using infinite while loop to check for layout change, but I don't want to do that as I don't want one of my threads to wait forever.
Is there a way to receive keyboard layout change events over a signal mechanism?