From 3fd1a3ca429560bd29559b2d1615e8bf6b4e3d9e Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Sun, 29 Dec 2024 07:48:57 -0800 Subject: [PATCH] Default to Wayland if possible in ImGui backend --- backends/ui/imgui/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backends/ui/imgui/main.cpp b/backends/ui/imgui/main.cpp index eb07f95..374cbe3 100644 --- a/backends/ui/imgui/main.cpp +++ b/backends/ui/imgui/main.cpp @@ -861,6 +861,9 @@ void ImGuiUIBackend::QuitHandler() { int ImGuiUIBackend::run(std::vector realArgs, int argc, char** argv) { SDL_setenv("SDL_VIDEO_X11_WMCLASS", "looper", 1); + if (SDL_getenv("WAYLAND_DISPLAY")) { + SDL_setenv("SDL_VIDEODRIVER", "wayland", 0); + } int possible_error = UIBackend::run(realArgs, argc, argv); if (possible_error != 0) { return possible_error;