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
This commit is contained in:
parent
80692dd36b
commit
9c0beeb759
|
@ -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
|
bool
|
||||||
EngineControl::on_delete_event (GdkEventAny* ev)
|
EngineControl::on_delete_event (GdkEventAny* ev)
|
||||||
{
|
{
|
||||||
if (notebook.get_current_page() == 2) {
|
if (lm_running || notebook.get_current_page() == 2) {
|
||||||
/* currently on latency tab - be sure to clean up */
|
/* currently measuring latency - be sure to clean up */
|
||||||
end_latency_detection ();
|
end_latency_detection ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ArdourDialog::on_delete_event (ev);
|
return ArdourDialog::on_delete_event (ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -353,6 +353,7 @@ private:
|
||||||
|
|
||||||
void on_switch_page (GtkNotebookPage*, guint page_num);
|
void on_switch_page (GtkNotebookPage*, guint page_num);
|
||||||
bool on_delete_event (GdkEventAny*);
|
bool on_delete_event (GdkEventAny*);
|
||||||
|
void on_response (int);
|
||||||
|
|
||||||
void engine_running ();
|
void engine_running ();
|
||||||
void engine_stopped ();
|
void engine_stopped ();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user