BugFix snap X11??

This commit is contained in:
Bruno Herbelin
2025-05-03 10:19:13 +02:00
parent a6840ade89
commit c9ab557aaa
2 changed files with 12 additions and 17 deletions

View File

@@ -1,19 +1,13 @@
#!/bin/bash
# Test if running under wayland
if [ -z "$WAYLAND_DISPLAY" ]; then
# not Wayland, nothing special
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
# 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
else
# otherwise, nothing special
printf 'GPU present: %s\n' "$gpu"
vimix "$@"
fi
fi

View File

@@ -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;
}