From a29029b8cbfb2c55ede22d63a6b6c06c70b0ed32 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 3 Jan 2025 18:09:12 +0100 Subject: flatpak: make sure gpu screen recorder gtk is installed systemwide when launching gsr-ui as a daemon as well --- src/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index abfabb3..6b2a3ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -405,7 +405,7 @@ static void hide_window_when_recording_systray_callback(GtkMenuItem*, gpointer) static void set_label_selectable(gpointer data, gpointer) { GtkWidget *widget = GTK_WIDGET(data); - if (GTK_IS_LABEL(widget)) + if(GTK_IS_LABEL(widget)) gtk_label_set_selectable(GTK_LABEL(widget), true); } @@ -4520,6 +4520,16 @@ static void startup_new_ui(bool launched_by_daemon) { } } + if(!flatpak_is_installed_as_system()) { + GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + "GPU Screen Recorder needs to be installed system-wide to use the new UI. You can run this command to install GPU Screen recorder system-wide:\n" + "flatpak install --system com.dec05eba.gpu_screen_recorder\n"); + set_dialog_selectable(dialog); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + return; + } + if(config.main_config.installed_gsr_global_hotkeys_version != GSR_CURRENT_GLOBAL_HOTKEYS_CODE_VERSION) { if(!kms_server_proxy_setup_gsr_ui( "An update is available. The new GPU Screen Recorder UI needs root privileges to finish update to make global hotkeys and recording work on any system.\n" -- cgit v1.2.3