From ba4d258c88b40e3ef174c750af4c7f0b84b744e0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 26 Jul 2024 10:49:19 +0200 Subject: Check gsr command exit status before output (makes sure to properly give opengl error warning) --- src/main.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 85a2050..a57a403 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3865,37 +3865,37 @@ static void activate(GtkApplication *app, gpointer) { return; } - if(gsr_info.system_info.display_server == DisplayServer::UNKNOWN) { + if(gsr_info_exit_status == GsrInfoExitStatus::OPENGL_FAILED) { GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - "Neither X11 nor Wayland is running."); + "Failed to get OpenGL information. Make sure your GPU drivers are properly installed. " + "If you are using nvidia then make sure to run \"flatpak update\" to make sure that your flatpak nvidia driver version matches your distros nvidia driver version. If this doesn't work then you might need to manually install a flatpak nvidia driver version that matches your distros nvidia driver version."); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); g_application_quit(G_APPLICATION(app)); return; } - if(gsr_info.system_info.display_server == DisplayServer::X11 && !dpy) { + if(gsr_info_exit_status == GsrInfoExitStatus::NO_DRM_CARD) { GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - "Failed to connect to X11 server"); + "Failed to find a valid DRM card. If you are running GPU Screen Recorder with prime-run then try running without it."); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); g_application_quit(G_APPLICATION(app)); return; } - if(gsr_info_exit_status == GsrInfoExitStatus::OPENGL_FAILED) { + if(gsr_info.system_info.display_server == DisplayServer::UNKNOWN) { GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - "Failed to get OpenGL information. Make sure your GPU drivers are properly installed. " - "If you are using nvidia then make sure to run \"flatpak update\" to make sure that your flatpak nvidia driver version matches your distros nvidia driver version. If this doesn't work then you might need to manually install a flatpak nvidia driver version that matches your distros nvidia driver version."); + "Neither X11 nor Wayland is running."); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); g_application_quit(G_APPLICATION(app)); return; } - if(gsr_info_exit_status == GsrInfoExitStatus::NO_DRM_CARD) { + if(gsr_info.system_info.display_server == DisplayServer::X11 && !dpy) { GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - "Failed to find a valid DRM card. If you are running GPU Screen Recorder with prime-run then try running without it."); + "Failed to connect to X11 server"); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); g_application_quit(G_APPLICATION(app)); -- cgit v1.2.3