diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-01-09 15:48:47 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-01-09 15:48:47 +0100 |
commit | 2b70a4758487f5f70f76ebe4be0f45bcf200baa7 (patch) | |
tree | 48618a6fbf983de808347b71434662bc4d113316 /src/main.cpp | |
parent | a53f5e69af1373b621690ea31b5e097552260b4a (diff) |
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 7208ae7..7b37ee4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,7 +20,7 @@ extern "C" { #include <vector> #include <libayatana-appindicator/app-indicator.h> -#define GSR_CURRENT_GLOBAL_HOTKEYS_CODE_VERSION 2 +#define GSR_CURRENT_GLOBAL_HOTKEYS_CODE_VERSION 3 #ifndef GSR_VERSION #define GSR_VERSION "unknown" @@ -2725,6 +2725,8 @@ static void video_codec_set_sensitive(GtkCellLayout *cell_layout, GtkCellRendere static void launch_gsr_ui(bool show_ui) { const char *args[] = { "gsr-ui", show_ui ? "launch-show" : "launch-hide", nullptr }; execvp(args[0], (char* const*)args); + // TODO: This is incorrect because window wont be defined here if this is called from startup. + // This is fine for not because this is only called inside the flatpak where gsr-ui is always available. GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "gsr-ui (gpu-screen-recorder-ui) isn't installed. Please install it first."); set_dialog_selectable(dialog); @@ -2956,7 +2958,7 @@ static GtkWidget* create_common_settings_page(GtkStack *stack, GtkApplication *a gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); g_application_quit(G_APPLICATION(select_window_userdata.app)); - return GTK_WIDGET(grid); + return GTK_WIDGET(main_grid); // TODO: ??? } } @@ -4574,6 +4576,9 @@ static void startup_new_ui(bool launched_by_daemon) { return; } + if(dpy) + XCloseDisplay(dpy); + launch_gsr_ui(!launched_by_daemon); exit(0); } |