From e249d18da9b432b957eed5b4733348ad8caea79c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 20 Jul 2024 02:20:05 +0200 Subject: Dont show error if the desktop portal menu was closed by the user --- TODO | 4 +--- src/main.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 6050eca..ec156b4 100644 --- a/TODO +++ b/TODO @@ -28,6 +28,4 @@ Add refresh button for audio devices. Put it beside the "add" button. In the new Gray out monitor capture on intel if plane is compressed. Show the user to desktop portal capture instead. -Dont show error if closing the desktop portal popup. - -Look at showmethekey https://github.com/AlynxZhou/showmethekey to see how to do global hotkeys without x11/wayland. \ No newline at end of file +Look at showmethekey https://github.com/AlynxZhou/showmethekey to see how to do global hotkeys without x11/wayland. diff --git a/src/main.cpp b/src/main.cpp index 359d0db..439fc81 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1652,6 +1652,8 @@ static gboolean on_start_replay_button_click(GtkButton *button, gpointer userdat "You need to have pkexec installed and a polkit agent running to record your monitor", G_NOTIFICATION_PRIORITY_URGENT); } else if(exit_status == 50) { show_notification(app, "GPU Screen Recorder", "Desktop portal capture failed. Either you canceled the desktop portal or your Wayland compositor doesn't support desktop portal capture or it's incorrectly setup on your system", G_NOTIFICATION_PRIORITY_URGENT); + } else if(exit_status == 60) { + // Canceled by the user } else if(!exit_success || (already_dead && exit_status != 0)) { show_notification(app, "GPU Screen Recorder", "Failed to start replay. Either your graphics card doesn't support GPU Screen Recorder with the settings you used or you don't have enough disk space to record a video", G_NOTIFICATION_PRIORITY_URGENT); @@ -1848,6 +1850,8 @@ static gboolean on_start_recording_button_click(GtkButton *button, gpointer user "You need to have pkexec installed and a polkit agent running to record your monitor", G_NOTIFICATION_PRIORITY_URGENT); } else if(exit_status == 50) { show_notification(app, "GPU Screen Recorder", "Desktop portal capture failed. Either you canceled the desktop portal or your Wayland compositor doesn't support desktop portal capture or it's incorrectly setup on your system", G_NOTIFICATION_PRIORITY_URGENT); + } else if(exit_status == 60) { + // Canceled by the user } else if(!exit_success || (already_dead && exit_status != 0)) { show_notification(app, "GPU Screen Recorder", "Failed to save video. Either your graphics card doesn't support GPU Screen Recorder with the settings you used or you don't have enough disk space to record a video. Run GPU Screen Recorder from the terminal to see more information when this failure happens", G_NOTIFICATION_PRIORITY_URGENT); } else if(exit_success) { @@ -2002,6 +2006,8 @@ static gboolean on_start_streaming_button_click(GtkButton *button, gpointer user "You need to have pkexec installed and a polkit agent running to record your monitor", G_NOTIFICATION_PRIORITY_URGENT); } else if(exit_status == 50) { show_notification(app, "GPU Screen Recorder", "Desktop portal capture failed. Either you canceled the desktop portal or your Wayland compositor doesn't support desktop portal capture or it's incorrectly setup on your system", G_NOTIFICATION_PRIORITY_URGENT); + } else if(exit_status == 60) { + // Canceled by the user } else if(!exit_success || (already_dead && exit_status != 0)) { show_notification(app, "GPU Screen Recorder", "Failed to stream video. There is either an error in your streaming config or your graphics card doesn't support GPU Screen Recorder with the settings you used", G_NOTIFICATION_PRIORITY_URGENT); } else if(exit_success) { -- cgit v1.2.3