Skip to content

Commit a0924a4

Browse files
Optionally enable Wayland support
Co-authored-by: Silvio Traversaro <[email protected]>
1 parent 3a385b0 commit a0924a4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/visualization/src/Visualizer.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#define GLFW_EXPOSE_NATIVE_X11
2929
#define GLFW_EXPOSE_NATIVE_WAYLAND
3030
#define GLFW_EXPOSE_NATIVE_GLX
31+
#define IDYNTREE_USES_WAYLAND
3132
#endif
3233

3334
#include <GLFW/glfw3.h>
@@ -506,10 +507,13 @@ bool Visualizer::init(const VisualizerOptions &visualizerOptions)
506507
pimpl->m_windowId = glfwGetCocoaWindow(pimpl->m_window);
507508
irrDevParams.WindowId = (void*)(pimpl->m_windowId);
508509
#elif defined(__linux__)
509-
void* nativeWindow = nullptr;
510+
#ifdef IDYNTREE_USES_WAYLAND
511+
// Try Wayland first
512+
struct wl_surface* waylandWindow = glfwGetWaylandWindow(pimpl->m_window);
513+
#else
514+
void* waylandWindow = nullptr;
515+
#endif
510516

511-
// Try Wayland first
512-
struct wl_surface* waylandWindow = glfwGetWaylandWindow(pimpl->m_window);
513517
if (waylandWindow)
514518
{
515519
nativeWindow = static_cast<void*>(waylandWindow);

0 commit comments

Comments
 (0)