[Bf-blender-cvs] [d1a5f24e735] blender-v3.4-release: Cleanup: move GHOST_WindowWayland::swapBuffers behind ifdef

Campbell Barton noreply at git.blender.org
Wed Nov 16 02:33:16 CET 2022


Commit: d1a5f24e735197fa14196c199b3554e541ab4127
Author: Campbell Barton
Date:   Wed Nov 16 10:55:01 2022 +1100
Branches: blender-v3.4-release
https://developer.blender.org/rBd1a5f24e735197fa14196c199b3554e541ab4127

Cleanup: move GHOST_WindowWayland::swapBuffers behind ifdef

The callback is only used for an assertion.

===================================================================

M	intern/ghost/intern/GHOST_WindowWayland.cpp
M	intern/ghost/intern/GHOST_WindowWayland.h

===================================================================

diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp
index 99bbf9109ec..63fed9a8172 100644
--- a/intern/ghost/intern/GHOST_WindowWayland.cpp
+++ b/intern/ghost/intern/GHOST_WindowWayland.cpp
@@ -913,13 +913,13 @@ GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
   setSwapInterval(0);
 }
 
+#ifdef USE_EVENT_BACKGROUND_THREAD
 GHOST_TSuccess GHOST_WindowWayland::swapBuffers()
 {
-#ifdef USE_EVENT_BACKGROUND_THREAD
   GHOST_ASSERT(system_->main_thread_id == std::this_thread::get_id(), "Only from main thread!");
-#endif
   return GHOST_Window::swapBuffers();
 }
+#endif /* USE_EVENT_BACKGROUND_THREAD */
 
 GHOST_TSuccess GHOST_WindowWayland::setWindowCursorGrab(GHOST_TGrabCursorMode mode)
 {
diff --git a/intern/ghost/intern/GHOST_WindowWayland.h b/intern/ghost/intern/GHOST_WindowWayland.h
index c43f7ca008c..528159a26cb 100644
--- a/intern/ghost/intern/GHOST_WindowWayland.h
+++ b/intern/ghost/intern/GHOST_WindowWayland.h
@@ -78,7 +78,9 @@ class GHOST_WindowWayland : public GHOST_Window {
 
   /* Ghost API */
 
-  GHOST_TSuccess swapBuffers() override;
+#ifdef USE_EVENT_BACKGROUND_THREAD
+  GHOST_TSuccess swapBuffers() override; /* Only for assertion. */
+#endif
 
   uint16_t getDPIHint() override;



More information about the Bf-blender-cvs mailing list