summaryrefslogtreecommitdiff
path: root/src/wx/gl_video_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-03-10 23:21:30 +0100
committerCarl Hetherington <cth@carlh.net>2026-03-10 23:21:30 +0100
commit834231bc8e76aea27cc898361e168864301a6450 (patch)
treeed5b97f9f2bc08f4fab7fb8e270bc89f77000ca9 /src/wx/gl_video_view.cc
parent88342fb03c20f2e7380a11fd77fef74a4c8b454f (diff)
Fix updating of crop guess rectangle from the auto-crop dialog.
Before the change in the dialog would raise an ImageChanged which would reset the crop again, making it unchangeable.
Diffstat (limited to 'src/wx/gl_video_view.cc')
-rw-r--r--src/wx/gl_video_view.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc
index 0e115977d..a04cb3000 100644
--- a/src/wx/gl_video_view.cc
+++ b/src/wx/gl_video_view.cc
@@ -135,6 +135,15 @@ GLVideoView::check_for_butler_errors()
}
+void
+GLVideoView::update_crop_guess()
+{
+ /* Assume at least one update() has happened before now */
+ request(Request::SET_CROP_GUESS_AND_DRAW);
+ rethrow();
+}
+
+
/** Called from the UI thread */
void
GLVideoView::update()
@@ -952,6 +961,12 @@ try
} else if (_pending_request == Request::SET_IMAGE_AND_DRAW) {
_pending_request = Request::NONE;
set_image_and_draw();
+ } else if (_pending_request == Request::SET_CROP_GUESS_AND_DRAW) {
+ _pending_request = Request::NONE;
+ if (auto pv = player_video().first) {
+ set_image(pv);
+ }
+ draw();
}
boost::this_thread::interruption_point();
@@ -980,6 +995,11 @@ GLVideoView::display_next_frame(bool non_blocking)
void
GLVideoView::request(Request request)
{
+ if (_pending_request == Request::SET_IMAGE_AND_DRAW) {
+ /* Don't replace this; it's a superset of other requests */
+ return;
+ }
+
boost::mutex::scoped_lock lm(_playing_mutex);
_pending_request = request;
_thread_work_condition.notify_all();