When using gtkmm and having the init code in on_realize on the main window it seems as if the code is needed to be initialized two times before the window recives the right events... this also happened when i set the init code to a button, i had to click twice to get the right events