From 0993c5811f23c4601e8f5768ee48e8832cfdbec9 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 18 Jul 2023 06:28:23 +0200 Subject: Show wayland specific error message when not system wide and flatpak --- src/main.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 151fcee..ec6e2db 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1089,12 +1089,20 @@ static bool show_pkexec_flatpak_error_if_needed() { } if(is_inside_flatpak() && !flatpak_is_installed_as_system()) { - GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - "GPU Screen Recorder needs to be installed system-wide to record your monitor on AMD/Intel. To install GPU Screen recorder system-wide, you can run this command:\n" - "flatpak install flathub --system com.dec05eba.gpu_screen_recorder\n" - "Alternatively, record a single window which doesn't have this restriction."); - gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); + if(wayland) { + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + "GPU Screen Recorder needs to be installed system-wide to record your monitor on Wayland. To install GPU Screen recorder system-wide, you can run this command:\n" + "flatpak install flathub --system com.dec05eba.gpu_screen_recorder\n"); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + } else { + GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + "GPU Screen Recorder needs to be installed system-wide to record your monitor on AMD/Intel. To install GPU Screen recorder system-wide, you can run this command:\n" + "flatpak install flathub --system com.dec05eba.gpu_screen_recorder\n" + "Alternatively, record a single window which doesn't have this restriction."); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + } return true; } } -- cgit v1.2.3