diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-11-06 03:14:56 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-11-06 03:14:56 +0300 |
commit | 1ccc0c39ea31b77f7e1ee42074a049cd968ec3ac (patch) | |
tree | 633ec13779724cf58f8d77c9ef4347a11db71a4f | |
parent | 4d7496851567ae00e2c33d1ef5fddf0db9275fa4 (diff) |
Delay toplevel creation until after OpenGL initialization.
-rw-r--r-- | profiler/src/BackendWayland.cpp | 10 |
1 files 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<void()> 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<void()> 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::microseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count(); |