Skip to content

Commit

Permalink
Optionally enable Wayland support
Browse files Browse the repository at this point in the history
Co-authored-by: Silvio Traversaro <[email protected]>
  • Loading branch information
flferretti and traversaro committed Jan 7, 2025
1 parent 3a385b0 commit a0924a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/visualization/src/Visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define GLFW_EXPOSE_NATIVE_X11
#define GLFW_EXPOSE_NATIVE_WAYLAND
#define GLFW_EXPOSE_NATIVE_GLX
#define IDYNTREE_USES_WAYLAND
#endif

#include <GLFW/glfw3.h>
Expand Down Expand Up @@ -506,10 +507,13 @@ bool Visualizer::init(const VisualizerOptions &visualizerOptions)
pimpl->m_windowId = glfwGetCocoaWindow(pimpl->m_window);
irrDevParams.WindowId = (void*)(pimpl->m_windowId);
#elif defined(__linux__)
void* nativeWindow = nullptr;
#ifdef IDYNTREE_USES_WAYLAND
// Try Wayland first
struct wl_surface* waylandWindow = glfwGetWaylandWindow(pimpl->m_window);
#else
void* waylandWindow = nullptr;
#endif

// Try Wayland first
struct wl_surface* waylandWindow = glfwGetWaylandWindow(pimpl->m_window);
if (waylandWindow)
{
nativeWindow = static_cast<void*>(waylandWindow);
Expand Down

0 comments on commit a0924a4

Please sign in to comment.