aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--com.dec05eba.gpu_screen_recorder.appdata.xml21
-rw-r--r--meson.build2
-rw-r--r--project.conf2
-rw-r--r--src/main.cpp112
4 files changed, 77 insertions, 60 deletions
diff --git a/com.dec05eba.gpu_screen_recorder.appdata.xml b/com.dec05eba.gpu_screen_recorder.appdata.xml
index a44f26c..1d93bea 100644
--- a/com.dec05eba.gpu_screen_recorder.appdata.xml
+++ b/com.dec05eba.gpu_screen_recorder.appdata.xml
@@ -93,6 +93,27 @@
</screenshots>
<releases>
+ <release version="5.1.3" date="2025-02-03">
+ <description>
+ <ul>
+ <li>Fix unable to type keys (except hotkeys) when switching to new ui on steam deck (and possibly other devices)</li>
+ </ul>
+ </description>
+ </release>
+ <release version="5.1.2" date="2025-01-26">
+ <description>
+ <ul>
+ <li>Fix hotkeys not working on some keyboards (usually laptops)</li>
+ </ul>
+ </description>
+ </release>
+ <release version="5.1.1" date="2025-01-25">
+ <description>
+ <ul>
+ <li>Fix microphone volume being low when merging audio devices (don't normalize audio)</li>
+ </ul>
+ </description>
+ </release>
<release version="5.1.0" date="2025-01-24">
<description>
<ul>
diff --git a/meson.build b/meson.build
index 7a13183..5b2a926 100644
--- a/meson.build
+++ b/meson.build
@@ -1,4 +1,4 @@
-project('gpu-screen-recorder-gtk', ['c', 'cpp'], version : '5.1.0', default_options : ['warning_level=2'])
+project('gpu-screen-recorder-gtk', ['c', 'cpp'], version : '5.1.3', default_options : ['warning_level=2'])
add_project_arguments('-Wshadow', language : ['c', 'cpp'])
if get_option('buildtype') == 'debug'
diff --git a/project.conf b/project.conf
index 1f73d9b..58201b0 100644
--- a/project.conf
+++ b/project.conf
@@ -1,7 +1,7 @@
[package]
name = "gpu-screen-recorder-gtk"
type = "executable"
-version = "5.1.0"
+version = "5.1.3"
platforms = ["posix"]
[config]
diff --git a/src/main.cpp b/src/main.cpp
index f515e2f..9d92b23 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 4
+#define GSR_CURRENT_GLOBAL_HOTKEYS_CODE_VERSION 5
#ifndef GSR_VERSION
#define GSR_VERSION "unknown"
@@ -1711,6 +1711,16 @@ static void debug_print_args(const char **args) {
fprintf(stderr, "\n");
}
+static bool validate_window(GtkApplication *app, Window window) {
+ XWindowAttributes attr;
+ if(XGetWindowAttributes(dpy, window, &attr)) {
+ return true;
+ } else {
+ show_notification(app, "GPU Screen Recorder", "The window you are trying to record no longer exists", G_NOTIFICATION_PRIORITY_URGENT);
+ return false;
+ }
+}
+
static gboolean on_start_replay_button_click(GtkButton *button, gpointer userdata) {
GtkApplication *app = (GtkApplication*)userdata;
const gchar *dir = gtk_button_get_label(replay_file_chooser_button);
@@ -1772,6 +1782,8 @@ static gboolean on_start_replay_button_click(GtkButton *button, gpointer userdat
return true;
}
window_str = std::to_string(select_window_userdata.selected_window);
+ if(!validate_window(app, select_window_userdata.selected_window))
+ return true;
} else if(window_str == "focused") {
follow_focused = true;
}
@@ -1968,6 +1980,8 @@ static gboolean on_start_recording_button_click(GtkButton *button, gpointer user
return true;
}
window_str = std::to_string(select_window_userdata.selected_window);
+ if(!validate_window(app, select_window_userdata.selected_window))
+ return true;
} else if(window_str == "focused") {
follow_focused = true;
}
@@ -2130,6 +2144,8 @@ static gboolean on_start_streaming_button_click(GtkButton *button, gpointer user
return true;
}
window_str = std::to_string(select_window_userdata.selected_window);
+ if(!validate_window(app, select_window_userdata.selected_window))
+ return true;
} else if(window_str == "focused") {
follow_focused = true;
}
@@ -2734,6 +2750,39 @@ static void launch_gsr_ui(bool show_ui) {
gtk_widget_destroy(dialog);
}
+static bool kms_server_proxy_setup_gsr_ui(const char *msg) {
+ GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", msg);
+ const gint response = gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy(dialog);
+
+ switch(response) {
+ case GTK_RESPONSE_YES:
+ break;
+ case GTK_RESPONSE_NO:
+ default: {
+ config.main_config.use_new_ui = false;
+ save_config(config);
+ return false;
+ }
+ }
+
+ const int exit_code = system("flatpak-spawn --host -- /var/lib/flatpak/app/com.dec05eba.gpu_screen_recorder/current/active/files/bin/kms-server-proxy setup-gsr-ui");
+ if(exit_code != 0) {
+ GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "Failed to setup the new UI. You either cancelled the installation or you don't have pkexec installed and a polkit agent running.");
+ gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy(dialog);
+
+ config.main_config.use_new_ui = false;
+ save_configs();
+ return false;
+ }
+
+ config.main_config.use_new_ui = true;
+ config.main_config.installed_gsr_global_hotkeys_version = GSR_CURRENT_GLOBAL_HOTKEYS_CODE_VERSION;
+ save_config(config);
+ return true;
+}
+
static gboolean on_click_switch_to_new_ui(GtkButton*, gpointer) {
if(!dpy) {
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
@@ -2783,33 +2832,12 @@ static gboolean on_click_switch_to_new_ui(GtkButton*, gpointer) {
return true;
}
- dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
+ const bool kms_server_setup_finished = kms_server_proxy_setup_gsr_ui(
"The new UI needs root privileges to finish setup to make global hotkeys and recording work on any system. The new UI will also be added to system startup.\n"
"\n"
"Are you sure you want to continue?");
- response = gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
-
- switch(response) {
- case GTK_RESPONSE_YES:
- break;
- case GTK_RESPONSE_NO:
- default:
- return true;
- }
-
- const int exit_code = system("flatpak-spawn --host -- /var/lib/flatpak/app/com.dec05eba.gpu_screen_recorder/current/active/files/bin/kms-server-proxy setup-gsr-ui");
- if(exit_code != 0) {
- GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
- "Failed to setup the new UI. You either cancelled the installation or you don't have pkexec installed and a polkit agent running.");
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
+ if(!kms_server_setup_finished)
return true;
- }
-
- config.main_config.use_new_ui = true;
- config.main_config.installed_gsr_global_hotkeys_version = GSR_CURRENT_GLOBAL_HOTKEYS_CODE_VERSION;
- save_configs();
bool service_install_successful = (system(
"data_home=$(flatpak-spawn --host -- /bin/sh -c 'echo \"${XDG_DATA_HOME:-$HOME/.local/share}\"') && "
@@ -4452,39 +4480,6 @@ static void activate(GtkApplication *app, gpointer) {
}
}
-static bool kms_server_proxy_setup_gsr_ui(const char *msg) {
- GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", msg);
- const gint response = gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
-
- switch(response) {
- case GTK_RESPONSE_YES:
- break;
- case GTK_RESPONSE_NO:
- default: {
- config.main_config.use_new_ui = false;
- save_config(config);
- return false;
- }
- }
-
- const int exit_code = system("flatpak-spawn --host -- /var/lib/flatpak/app/com.dec05eba.gpu_screen_recorder/current/active/files/bin/kms-server-proxy setup-gsr-ui");
- if(exit_code != 0) {
- GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "Failed to setup the new UI. You either cancelled the installation or you don't have pkexec installed and a polkit agent running.");
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
-
- config.main_config.use_new_ui = false;
- save_configs();
- return false;
- }
-
- config.main_config.use_new_ui = true;
- config.main_config.installed_gsr_global_hotkeys_version = GSR_CURRENT_GLOBAL_HOTKEYS_CODE_VERSION;
- save_config(config);
- return true;
-}
-
static bool is_gsr_global_hotkeys_installed() {
const char *user_homepath = getenv("HOME");
if(!user_homepath)
@@ -4534,7 +4529,7 @@ static void startup_new_ui(bool launched_by_daemon) {
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
});
-
+
config.main_config.use_new_ui = false;
save_config(config);
return;
@@ -4558,6 +4553,7 @@ static void startup_new_ui(bool launched_by_daemon) {
start_gtk_run_handler([&finished]() {
finished = 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"
+ "You will need to restart the application to apply the update.\n"
"\n"
"Are you sure you want to continue?");
});