Index: xs/Gtk2.xs =================================================================== --- xs/Gtk2.xs (revision 2095) +++ xs/Gtk2.xs (working copy) @@ -535,16 +535,20 @@ ##guint gtk_key_snooper_install (GtkKeySnoopFunc snooper, gpointer func_data); =for apidoc -=for arg snooper (subroutine) function to call on every event, must return a boolean -Install a key "snooper" function, which will get called on all key events -before those events are delivered normally. These snoopers can be used to -implement custom key event handling. I will receive the widget to -which the event will be delivered and the event, and also I (if -provided). If I returns true, the event propagation will stop -(just like normal event handlers). +=for arg snooper (subroutine) function to call on every event +Install a key "snooper" function which will get called on all key +events before those events are delivered normally. These snoopers can +be used to implement custom key event handling. C returns an id that may be used with -C. +C (below). I is called as + + stopbool = &snooper ($widget, $event, $func_data); + +It should return true to stop event propagation, the same as +C event signal handlers. The C and +C constants can be used for the return (see +L). =cut guint gtk_key_snooper_install (class, SV * snooper, SV * func_data=NULL) CODE: Index: xs/GtkWindow.xs =================================================================== --- xs/GtkWindow.xs (revision 2095) +++ xs/GtkWindow.xs (working copy) @@ -48,9 +48,10 @@ $toplevel->signal_connect (delete_event => sub { if (any_unsaved_documents()) { popup_ask_save_before_exit_dialog(); - return 1; # don't propagate to default destroy + return Gtk2::EVENT_STOP; # don't go to default destroy + } else { + return Gtk2::EVENT_PROPAGATE; } - return 0; # do propagate }); In a dialog or secondary app window you might not want to destroy but