+ if (editor && editor->mouse_mode_tearoff()) {
+ XMLNode* t = new XMLNode (X_("mouse-mode"));
+ editor->mouse_mode_tearoff ()->add_state (*t);
+ tearoff_node->add_child_nocopy (*t);
+ }
+
+ window_node->add_child_nocopy (*tearoff_node);
+
+ Config->add_extra_xml (*window_node);
+
+ if (_startup && _startup->engine_control() && _startup->engine_control()->was_used()) {
+ Config->add_extra_xml (_startup->engine_control()->get_state());
+ }
+ Config->save_state();
+ if (ui_config->dirty()) {
+ ui_config->save_state ();
+ }
+
+ XMLNode& enode (static_cast<Stateful*>(editor)->get_state());
+ XMLNode& mnode (mixer->get_state());
+
+ if (_session) {
+ _session->add_instant_xml (enode);
+ _session->add_instant_xml (mnode);
+ if (location_ui->get ()) {
+ _session->add_instant_xml (location_ui->get()->ui().get_state ());
+ }
+ } else {
+ Config->add_instant_xml (enode);
+ Config->add_instant_xml (mnode);
+ if (location_ui->get ()) {
+ Config->add_instant_xml (location_ui->get()->ui().get_state ());
+ }
+ }
+
+ Keyboard::save_keybindings ();
+}
+
+void
+ARDOUR_UI::toggle_global_port_matrix (ARDOUR::DataType t)
+{
+ std::string const action = string_compose ("toggle-%1-connection-manager", t.to_string ());
+
+ if (_global_port_matrix[t]->get() == 0) {
+ _global_port_matrix[t]->set (new GlobalPortMatrixWindow (_session, t));
+ _global_port_matrix[t]->get()->signal_unmap().connect(sigc::bind (sigc::ptr_fun (&ActionManager::uncheck_toggleaction), string_compose (X_("<Actions>/Common/%1"), action)));
+ }
+
+ RefPtr<Action> act = ActionManager::get_action (X_("Common"), action.c_str());
+ if (act) {
+ RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
+
+ if (tact->get_active()) {
+ _global_port_matrix[t]->get()->present ();
+ } else {
+ _global_port_matrix[t]->get()->hide ();
+ }
+ }
+}
+
+void
+ARDOUR_UI::resize_text_widgets ()
+{
+ set_size_request_to_display_given_text (cpu_load_label, "DSP: 100.0%", 2, 2);
+ set_size_request_to_display_given_text (buffer_load_label, "Buffers: p:100% c:100%", 2, 2);
+}
+
+void
+ARDOUR_UI::focus_on_clock ()
+{
+ if (editor && primary_clock) {
+ editor->present ();
+ primary_clock->focus ();
+ }