summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-08-09 00:03:11 +0200
committerCarl Hetherington <cth@carlh.net>2020-08-09 00:03:11 +0200
commit09778ab5747c081acb51190bafdfeba63e3ea7fd (patch)
treeccf8d9d7679765e10d757992009c03457a9aab78
parentb0f642ee90a2babed6547ea68e987751621fe3f3 (diff)
wxEVT_CREATE appears never to arrive on Windows, so change thingsv2.15.96
to create the OpenGL thread on the first paint request.
-rw-r--r--src/wx/gl_video_view.cc12
-rw-r--r--src/wx/gl_video_view.h1
2 files changed, 4 insertions, 9 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc
index 6788d0384..50fdd0298 100644
--- a/src/wx/gl_video_view.cc
+++ b/src/wx/gl_video_view.cc
@@ -74,7 +74,6 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent)
_canvas = new wxGLCanvas (parent, wxID_ANY, 0, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE);
_canvas->Bind (wxEVT_PAINT, boost::bind(&GLVideoView::update, this));
_canvas->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized)));
- _canvas->Bind (wxEVT_CREATE, boost::bind(&GLVideoView::create, this));
_canvas->Bind (wxEVT_TIMER, boost::bind(&GLVideoView::check_for_butler_errors, this));
_timer.reset (new wxTimer(_canvas));
@@ -111,6 +110,10 @@ GLVideoView::check_for_butler_errors ()
void
GLVideoView::update ()
{
+ if (!_thread.joinable()) {
+ _thread = boost::thread (boost::bind(&GLVideoView::thread, this));
+ }
+
{
boost::mutex::scoped_lock lm (_canvas_mutex);
if (!_canvas->IsShownOnScreen()) {
@@ -414,10 +417,3 @@ GLVideoView::request_one_shot ()
_thread_work_condition.notify_all ();
}
-void
-GLVideoView::create ()
-{
- if (!_thread.joinable()) {
- _thread = boost::thread (boost::bind(&GLVideoView::thread, this));
- }
-}
diff --git a/src/wx/gl_video_view.h b/src/wx/gl_video_view.h
index fcf5dbcf2..e1a7fc1ac 100644
--- a/src/wx/gl_video_view.h
+++ b/src/wx/gl_video_view.h
@@ -60,7 +60,6 @@ private:
void thread ();
void thread_playing ();
void request_one_shot ();
- void create ();
void check_for_butler_errors ();
/* Mutex for use of _canvas; it's only contended when our ::thread