13
0

add UIConfig variable for lock timer

This commit is contained in:
Paul Davis 2014-06-25 11:34:37 -04:00
parent 9b7b5fc9bc
commit b43d3fe8d7
2 changed files with 6 additions and 3 deletions

View File

@ -1110,7 +1110,10 @@ Editor::on_realize ()
Window::on_realize ();
Realized ();
start_lock_event_timing ();
if (ARDOUR_UI::config()->get_lock_gui_after_seconds()) {
start_lock_event_timing ();
}
signal_event().connect (sigc::mem_fun (*this, &Editor::generic_event_handler));
}
@ -1143,13 +1146,12 @@ bool
Editor::lock_timeout_callback ()
{
struct timeval now, delta;
const uint32_t lock_timeout_secs = 5; /* 2 minutes */
gettimeofday (&now, 0);
timersub (&now, &last_event_time, &delta);
if (delta.tv_sec > lock_timeout_secs) {
if (delta.tv_sec > ARDOUR_UI::config()->get_lock_gui_after_seconds()) {
lock ();
/* don't call again. Returning false will effectively
disconnect us from the timer callback.

View File

@ -25,4 +25,5 @@ UI_CONFIG_VARIABLE(float, timeline_item_gradient_depth, "timeline-item-gradient-
UI_CONFIG_VARIABLE(bool, all_floating_windows_are_dialogs, "all-floating-windows-are-dialogs", false)
UI_CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-track-color", false)
UI_CONFIG_VARIABLE (bool, show_waveform_clipping, "show-waveform-clipping", true)
UI_CONFIG_VARIABLE (uint32_t, lock_gui_after_seconds, "lock-gui-after-seconds", 0)