From c9ab557aaaffd76261aac2a1e995cd6b4d758e54 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Sat, 3 May 2025 10:19:13 +0200 Subject: [PATCH] BugFix snap X11?? --- rsc/launch_vimix.sh | 26 ++++++++++---------------- src/RenderingManager.cpp | 3 ++- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/rsc/launch_vimix.sh b/rsc/launch_vimix.sh index 83c676b..fdf8374 100644 --- a/rsc/launch_vimix.sh +++ b/rsc/launch_vimix.sh @@ -1,19 +1,13 @@ #!/bin/bash - -# Test if running under wayland -if [ -z "$WAYLAND_DISPLAY" ]; then - # not Wayland, nothing special - vimix "$@" +# test if there is an nvidia GPU +gpu=$(lspci | grep -i '.* vga .* nvidia .*') +shopt -s nocasematch +if [[ $gpu == *' nvidia '* ]]; then + # with nvidia, request render offload + printf 'Nvidia GPU present: %s\n' "$gpu" + __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia vimix "$@" else - # Wayland: test if there is an nvidia GPU - gpu=$(lspci | grep -i '.* vga .* nvidia .*') - shopt -s nocasematch - if [[ $gpu == *' nvidia '* ]]; then - # with nvidia, request Wayland render offload - printf 'Nvidia GPU present: %s\n' "$gpu" - __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia vimix "$@" - else - # otherwise, nothing special - vimix "$@" - fi + # otherwise, nothing special + printf 'GPU present: %s\n' "$gpu" + vimix "$@" fi diff --git a/src/RenderingManager.cpp b/src/RenderingManager.cpp index 042d405..012d56a 100644 --- a/src/RenderingManager.cpp +++ b/src/RenderingManager.cpp @@ -994,7 +994,8 @@ bool RenderingWindow::init(int index, GLFWwindow *share) // create the window window_ = glfwCreateWindow(winset.w, winset.h, winset.name.c_str(), NULL, master_); if (window_ == NULL){ - g_printerr("Failed to create GLFW Window %d", index_); + g_printerr("Failed to create GLFW Window %d (%s, %d x %d)\n", + index_, winset.name.c_str(), winset.w, winset.h); return false; }