This function takes four arguments so that it may be passed directly as the menu position callback to Gtk2::Menu::popup(), which passes in initial x and y values for historical reasons. Otherwise, you need only pass two arguments.
This function can be used as the menu_pos_func argument to Gtk2::Menu::popup.