diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-07-22 02:59:37 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-07-22 02:59:37 +0200 |
commit | 0b72c15041af2f2c890fd645ab3118c125864627 (patch) | |
tree | 6a491ebd0c91ef67b63122766475560c3b687a7d | |
parent | 713db0294dce6f348c89178356e0284397f36392 (diff) |
Restrict recording to drm card controlled displays on amd/intel
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | src/main.cpp | 22 |
2 files changed, 13 insertions, 12 deletions
@@ -5,4 +5,5 @@ Disable overclocking and show some kind of sign that overclocking is not possibl Button (in the field) to remove hotkey. Implement global hotkeys on wayland. Add pipewire capture option. -Error if polkit agent is not running (pkexec --help may work but the agent might not be running anyways).
\ No newline at end of file +Error if polkit agent is not running (pkexec --help may work but the agent might not be running anyways). +Fix gui crash on stop recording on sway.
\ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index a9a777b..f78330e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2016,7 +2016,7 @@ static bool audio_inputs_contains(const std::vector<AudioInput> &audio_inputs, c } static void get_connection_by_active_type(void **connection, gsr_connection_type *connection_type) { - if(wayland) { + if(wayland || gpu_inf.vendor != GPU_VENDOR_NVIDIA) { if(gsr_egl_supports_wayland_capture(&egl)) { *connection = &egl; *connection_type = GSR_CONNECTION_WAYLAND; @@ -2860,7 +2860,16 @@ static void activate(GtkApplication *app, gpointer) { return; } - if(wayland && !gsr_egl_supports_wayland_capture(&egl)) { + if(!gl_get_gpu_info(&egl, &gpu_inf)) { + 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."); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + g_application_quit(G_APPLICATION(app)); + return; + } + + if((gpu_inf.vendor != GPU_VENDOR_NVIDIA) || (wayland && !gsr_egl_supports_wayland_capture(&egl))) { if(!gsr_get_valid_card_path(drm_card_path)) { GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "Failed to find a valid DRM card."); @@ -2873,15 +2882,6 @@ static void activate(GtkApplication *app, gpointer) { drm_card_path[0] = '\0'; } - if(!gl_get_gpu_info(&egl, &gpu_inf)) { - 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."); - gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); - g_application_quit(G_APPLICATION(app)); - return; - } - if(gpu_inf.vendor == GPU_VENDOR_NVIDIA) { if(!is_cuda_installed()) { GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, |