Skip to content

Commit

Permalink
RMG: set QT_VULKAN_LIB to libvulkan.so.1 on Linux in main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Aug 26, 2023
1 parent 01dbc47 commit 38b9469
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Source/RMG/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ int main(int argc, char **argv)
qInstallMessageHandler(message_handler);

#ifndef _WIN32
// install signal handler
signal(SIGINT, signal_handler);
// on Linux we need to install signal handlers,
// so we can exit cleanly when the user presses
// i.e control+c
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
#endif

#ifndef _WIN32
// on Linux, wayland works only on some compositors,
// it works on KDE plasma and sway (on 2023-07-26),
// but i.e doesn't work on GNOME wayland or labwc,
Expand All @@ -109,6 +109,14 @@ int main(int argc, char **argv)
setenv("QT_QPA_PLATFORM", "xcb", 1);
}

// on Linux, Qt on some distributions
// fails to load libvulkan, so to fix that
// we'll help out and tell it about libvulkan.so.1,
// but we wont overwrite the variable value if it
// already contains one, the user might set it
// to a custom value themselves
setenv("QT_VULKAN_LIB", "libvulkan.so.1", 0);

// ensure the default OpenGL format
// doesn't have vsync enabled by default,
// only needed for linux (for now)
Expand Down

0 comments on commit 38b9469

Please sign in to comment.