Keyboard events in Gtk propagates bottom up, starting from the top level window and then up the Z order. However mouse button events are first delivered to the
Source codes c++ gtkmm3 gtk4 linux: #include <gtkmm.h> #include <gtk/gtk.h> #include <glib.h> int main(int argc, char *argv[]) { auto app =