summaryrefslogtreecommitdiff
path: root/gtk2_ardour/engine_dialog.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-09-22 21:45:30 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2019-09-22 21:45:30 -0600
commit9c0beeb7591302747eee6e28c448314313f8d54a (patch)
tree47bda1b5cc13dc440baa39fb63d994bfc22dde60 /gtk2_ardour/engine_dialog.cc
parent80692dd36bda822962728a3b8705ec72d2f220bc (diff)
fix problem with ArdourDialog::on_delete_event() not being called when appropriate during app startup
The dialog is run using gtk_dialog_run() which uses on_response() to deal with delete/close events unlike a regular top level event loop. Probably even better would be run run the dialog from the top level event loop, but this is a bit complex
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r--gtk2_ardour/engine_dialog.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc
index 107e5bbf24..5e3ed3ee38 100644
--- a/gtk2_ardour/engine_dialog.cc
+++ b/gtk2_ardour/engine_dialog.cc
@@ -3101,13 +3101,30 @@ EngineControl::use_latency_button_clicked ()
}
}
+void
+EngineControl::on_response (int rid)
+{
+ /* this gets called if this Dialog is running under gtk_dialog_run()
+ rather than in the toplevel loop. This happens during program
+ startup.
+ */
+
+ if (rid == RESPONSE_DELETE_EVENT) {
+ on_delete_event ((GdkEventAny*) 0);
+ return;
+ }
+
+ ArdourDialog::on_response (rid);
+}
+
bool
EngineControl::on_delete_event (GdkEventAny* ev)
{
- if (notebook.get_current_page() == 2) {
- /* currently on latency tab - be sure to clean up */
+ if (lm_running || notebook.get_current_page() == 2) {
+ /* currently measuring latency - be sure to clean up */
end_latency_detection ();
}
+
return ArdourDialog::on_delete_event (ev);
}