From 7920493569041de2d8c991eb4b04b33d41b70d57 Mon Sep 17 00:00:00 2001
From: Good Guy <good1.2guy@gmail.com>
Date: Mon, 29 Jan 2018 17:25:02 -0700
Subject: [PATCH] viewer window playback tweaks

---
 cinelerra-5.1/cinelerra/vwindowgui.C | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/vwindowgui.C b/cinelerra-5.1/cinelerra/vwindowgui.C
index a94e1767..ea05537b 100644
--- a/cinelerra-5.1/cinelerra/vwindowgui.C
+++ b/cinelerra-5.1/cinelerra/vwindowgui.C
@@ -354,6 +354,19 @@ int VWindowGUI::keypress_event()
 
 int VWindowGUI::button_press_event()
 {
+	if( get_buttonpress() == LEFT_BUTTON && canvas->get_canvas() &&
+	    canvas->get_canvas()->get_cursor_over_window() ) {
+		PlaybackEngine *playback_engine = vwindow->playback_engine;
+		unlock_window();
+		if( playback_engine->is_playing_back ) {
+			transport->handle_transport(STOP, 1);
+		}
+		else {
+			transport->handle_transport(NORMAL_FWD, 1);
+		}
+		vwindow->gui->lock_window("VWindowEditing::prev_label");
+		return 1;
+	}
 	if(canvas->get_canvas())
 		return canvas->button_press_event_base(canvas->get_canvas());
 	return 0;
@@ -418,6 +431,11 @@ int VWindowGUI::drag_stop()
 		EDL *edl = mwindow->session->drag_clips->size() ?
 			mwindow->session->drag_clips->get(0) :
 			0;
+		if( vwindow->playback_engine->is_playing_back ) {
+			unlock_window();
+			vwindow->stop_playback(1);
+			lock_window("VWindowGUI::drag_stop");
+		}
 
 		if(indexable)
 			vwindow->change_source(indexable);
-- 
2.26.2