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) --- TODO | 7 ++++++- src/main.cpp | 18 +++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index 9065eea..13eeae4 100644 --- a/TODO +++ b/TODO @@ -46,4 +46,9 @@ Replay on startup should be its own page with its own settings for everything an and if hotkeys cant be registered then also show an error. Notifications are not shown on kde plasma while using desktop portal capture (system-wide). This is a design choice by kde, see https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/blob/master/src/screencast.cpp?ref_type=heads#L41 . The DoNotDisturb.WhenScreenSharing config controls this. This can be bypassed by making the notification critical. Maybe notifications should be set as critical? but only on kde. - Maybe we should create our own notification system with gtk layer shell (which is supported by every platform except gnome wayland). \ No newline at end of file + Maybe we should create our own notification system with gtk layer shell (which is supported by every platform except gnome wayland). + On gnome wayland maybe we can fallback to x11? we need to add back --socket=x11 and remove --socket=fallback-x11 from flatpak manifest. + Maybe use this: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/264 when that gets supported. But will gnome support that? + +For replay on system startup add functionality to only record if an application is fullscreen (on the focused monitor, or any monitor if not possible). + This is easy to do with x11. For hyprland/sway we can maybe use hyprctl/swaymsg. On kde maybe we can do something similar to this: https://github.com/jinliu/kdotool. For gnome maybe do something like this: https://github.com/ActivityWatch/aw-watcher-window/pull/46/files 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