diff --git a/direct/src/plugin/p3dWinSplashWindow.cxx b/direct/src/plugin/p3dWinSplashWindow.cxx index a42dbc6aa0..bd6f0e61b3 100755 --- a/direct/src/plugin/p3dWinSplashWindow.cxx +++ b/direct/src/plugin/p3dWinSplashWindow.cxx @@ -209,6 +209,25 @@ unregister_window_class() { } } +//////////////////////////////////////////////////////////////////// +// Function: P3DWinSplashWindow::button_click_detected +// Access: Protected, Virtual +// Description: Called when a button click by the user is detected in +// set_mouse_data(), this method simply turns around and +// notifies the instance. It's a virtual method to give +// subclasses a chance to redirect this message to the +// main thread or process, as necessary. +//////////////////////////////////////////////////////////////////// +void P3DWinSplashWindow:: +button_click_detected() { + // Since this message is detected in the sub-thread in the Windows + // case, we have to protect ourselves from re-entry by grabbing the + // global _api_lock. + ACQUIRE_LOCK(_api_lock); + P3DSplashWindow::button_click_detected(); + RELEASE_LOCK(_api_lock); +} + //////////////////////////////////////////////////////////////////// // Function: P3DWinSplashWindow::start_thread // Access: Private diff --git a/direct/src/plugin/p3dWinSplashWindow.h b/direct/src/plugin/p3dWinSplashWindow.h index 09df643ef0..caaa203038 100755 --- a/direct/src/plugin/p3dWinSplashWindow.h +++ b/direct/src/plugin/p3dWinSplashWindow.h @@ -43,6 +43,9 @@ public: static void register_window_class(); static void unregister_window_class(); +protected: + virtual void button_click_detected(); + private: void start_thread(); void stop_thread(); diff --git a/direct/src/plugin/p3d_plugin_common.h b/direct/src/plugin/p3d_plugin_common.h index 53ab372740..f7219aa4b1 100644 --- a/direct/src/plugin/p3d_plugin_common.h +++ b/direct/src/plugin/p3d_plugin_common.h @@ -42,6 +42,9 @@ using namespace std; extern ostream *nout_stream; #define nout (*nout_stream) +// Appears in p3d_plugin.cxx. +extern LOCK _api_lock; + // A convenience function for formatting a generic P3D_object to an // ostream. inline ostream &