summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-06-25 11:34:37 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-06-25 11:34:37 -0400
commitb43d3fe8d79ff6315b7a8d9bb76168944bb81287 (patch)
tree859c41e4458d4c84fa473b1dabb0bc75b9392179
parent9b7b5fc9bc5bd293915a5934bb3f086730d67cf5 (diff)
add UIConfig variable for lock timer
-rw-r--r--gtk2_ardour/editor.cc8
-rw-r--r--gtk2_ardour/ui_config_vars.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index addf2f3b38..f4552ea9b1 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -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.
diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h
index 16ffd26255..56eec53852 100644
--- a/gtk2_ardour/ui_config_vars.h
+++ b/gtk2_ardour/ui_config_vars.h
@@ -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)