From 1ccc0c39ea31b77f7e1ee42074a049cd968ec3ac Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 6 Nov 2022 01:14:56 +0100 Subject: Delay toplevel creation until after OpenGL initialization. --- profiler/src/BackendWayland.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/profiler/src/BackendWayland.cpp b/profiler/src/BackendWayland.cpp index bdbe45d7..9946951b 100644 --- a/profiler/src/BackendWayland.cpp +++ b/profiler/src/BackendWayland.cpp @@ -121,11 +121,6 @@ Backend::Backend( const char* title, std::function redraw, RunQueue* mai s_eglWin = wl_egl_window_create( s_surf, m_winPos.w, m_winPos.h ); s_xdgSurf = xdg_wm_base_get_xdg_surface( s_wm, s_surf ); xdg_surface_add_listener( s_xdgSurf, &surfaceListener, nullptr ); - wl_display_roundtrip( s_dpy ); - - s_toplevel = xdg_surface_get_toplevel( s_xdgSurf ); - xdg_toplevel_add_listener( s_toplevel, &toplevelListener, nullptr ); - xdg_toplevel_set_title( s_toplevel, title ); constexpr EGLint eglConfigAttrib[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, @@ -165,6 +160,11 @@ Backend::Backend( const char* title, std::function redraw, RunQueue* mai ImGui_ImplOpenGL3_Init( "#version 150" ); + wl_display_roundtrip( s_dpy ); + s_toplevel = xdg_surface_get_toplevel( s_xdgSurf ); + xdg_toplevel_add_listener( s_toplevel, &toplevelListener, nullptr ); + xdg_toplevel_set_title( s_toplevel, title ); + ImGuiIO& io = ImGui::GetIO(); io.BackendPlatformName = "wayland (tracy profiler)"; s_time = std::chrono::duration_cast( std::chrono::high_resolution_clock::now().time_since_epoch() ).count(); -- cgit v1.2.3