aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO37
-rw-r--r--com.dec05eba.gpu_screen_recorder.appdata.xml6
-rw-r--r--src/main.cpp66
3 files changed, 42 insertions, 67 deletions
diff --git a/TODO b/TODO
index 4abaefc..ee014aa 100644
--- a/TODO
+++ b/TODO
@@ -9,42 +9,16 @@ Add translation support (using gettext, which uses .mo files and _ macro). It sh
But how? maybe have a page that links to the english translation files (or translation directory) in git and give instructions,
telling them to copy the file content and then send me the file by email with the language name (then I can add it to the correct)
file with correct locale. Or if they know how to use git they can use that directly.
-Add option to start replay on system startup (use the gpu screen recorder systemd file?) and use the settings from the replay page.
- Dont add this option if not running systemd, or disable the button then.
- Fix screen capture breaking after suspend/monitor change on nvidia x11.
- Add note about replaying can get bugged on suspend unless nvidia reg for suspend is added (because cuda breaks, nvidia driver bug).
- Detect suspend before it happens and unload cuda/nvenc then and reload after suspend. This is a workaround to nvidia driver bug that breaks cuda on suspend.
- Disable the gpu screen recorders aur/source package systemd service if enabled in the gui since these are two different services. Or make that service and gui service the same and work with the same (gui) config file.
Remove the need to install gpu screen recorder flatpak as system. This can now be done because of kms-server-proxy.
Implement profiles to quickly switch between settings.
Use https://hosted.weblate.org/ for translation.
-Detect game name by using x11 window class or title. Fallback to finding pressure vessel, find the binary is runs and get the directory name directly under the proton game list directory. Fallback to pure wine. x11 window class works in xwayland too.
-
Have separate options for each record option (stream, record and replay) or have option to use profiles. Remake the gui and have a proper overlay! on wlroots and kde use https://wayland.app/protocols/wlr-layer-shell-unstable-v1.
-Add refresh button for audio devices. Put it beside the "add" button. In the new ui this should update automatically without a button.
-
-Gray out monitor capture on intel if plane is compressed. Show the user to desktop portal capture instead.
-
-Look at showmethekey https://github.com/AlynxZhou/showmethekey to see how to do global hotkeys without x11/wayland. The password prompt for this can be removed by using polkit rules, this is how SwayOSD does it.
- doing this in the flatpak requires --device=input in the flatpak manifest if we are doing it without hack where we launch an external process, running outside the flatpak with root access.
-
A single flatpak can only be installed either system-wide or user, so there can be a check if it's installed system-wide or user and it will only match one. With this information we can guaranteed know the flatpak directory of the running gpu screen recorder instance. The command `flatpak info -l com.dec05eba.gpu_screen_recorder` can also be used and is available for all flatpak users.
Re-renable hotkeys on hyprland after it's fixed in the hyprland desktop portal. Or use hyprland specific protocol to do it ourselves, and it also works better.
-Replay on startup should be its own page with its own settings for everything and should not allow enabling the feature unless global hotkeys can be enable.
- To make sure this works, create a separate program to handle global hotkeys with root access to make it work for every user and keys should be registered by requiring root access (every time its changed), with a confirm button.
- Or have a predefined set of keys that can be changed. Also have a key to show the gui.
- The replay on startup should be this gpu screen recorder gtk program but should launch a separate gui (in a different cpp file)
- and should be a single page with start/stop button and whatever. It should also show a systray similar to the default one but with only
- start/stop/save/exit button. The UI is needed for gnome users that dont have a systray!
- Maybe create gnome extension so that gnome users can see recording status, or mention to the user that it's a gnome limitation.
- The system startup program should work like the gpu screen recorder systemd daemon but start gpu screen recorder gtk with a special argument to launch it into this
- replay mode. The replay mode program should loop and launch gpu screen recorder, restarting it if it crashes. If it crashes show an error dialog to the user
- and if hotkeys cant be registered then also show an error.
-
Notifications are not shown on kde plasma while using desktop portal capture (system-wide). This is a design choice by kde, see https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/blob/master/src/screencast.cpp?ref_type=heads#L41 . The DoNotDisturb.WhenScreenSharing config controls this. This can be bypassed by making the notification critical. Maybe notifications should be set as critical? but only on kde.
Maybe we should create our own notification system with gtk layer shell (which is supported by every platform except gnome wayland).
On gnome wayland maybe we can fallback to x11? we need to add back --socket=x11 and remove --socket=fallback-x11 from flatpak manifest.
@@ -52,19 +26,8 @@ Notifications are not shown on kde plasma while using desktop portal capture (sy
Maybe map the drm framebuffer to opengl with write permission and draw to that opengl texture with a framebuffer. That would allow us to draw on the screen anywhere on any wayland compositor (and x11 amd/intel). We can also do this after the video frame has been captured to not include it in the video.
Maybe use drm overlay plane, if possible.
-For replay on system startup add functionality to only record if an application is fullscreen (on the focused monitor, or any monitor if not possible).
- This is easy to do with x11. For hyprland/sway we can maybe use hyprctl/swaymsg. On kde maybe we can do something similar to this: https://github.com/jinliu/kdotool. For gnome maybe do something like this: https://github.com/ActivityWatch/aw-watcher-window/pull/46/files
-
-When replay on system startup option is added also install gsr-nvidia.conf and tell the user to reboot and explain the issue.
-
Start recording after showing start recording notification has disappeared, not at the same time.
-Use modprobe command. modprobe on system startup in modprobe.d directory is only available for udev, other systems need to add it to linux kernel boot parameters (is this also needed for nvidia open kernel module driver?).
-
-Save gpu screen recorder status in $XDG_RUNTIME_DIR.
-
-Add option to capture application audio. This should show a popup where you can use one of the available applications or a custom one and choose to record that application or all applications except that one.
-
Add profile option. Convert view to profile, add an option at the bottom that says "Edit profiles..." which should show a popup where you can create/remove profiles. New profiles should always be in advanced view.
Move x11 hotkey code to its own file.
diff --git a/com.dec05eba.gpu_screen_recorder.appdata.xml b/com.dec05eba.gpu_screen_recorder.appdata.xml
index 0f54305..d450767 100644
--- a/com.dec05eba.gpu_screen_recorder.appdata.xml
+++ b/com.dec05eba.gpu_screen_recorder.appdata.xml
@@ -3,13 +3,17 @@
<id>com.dec05eba.gpu_screen_recorder</id>
<name>GPU Screen Recorder</name>
<summary>A shadowplay-like screen recorder for Linux. The fastest screen recorder for Linux</summary>
- <developer_name>dec05eba</developer_name>
+ <developer id="com.dec05eba.gpu_screen_recorder">
+ <name>dec05eba</name>
+ </developer>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<url type="homepage">https://git.dec05eba.com/gpu-screen-recorder/about/</url>
<url type="bugtracker">https://github.com/dec05eba/gpu-screen-recorder-issues</url>
<url type="contribute">https://git.dec05eba.com/?p=about</url>
<url type="donation">https://git.dec05eba.com/?p=about</url>
+ <url type="help">https://git.dec05eba.com/gpu-screen-recorder/about/</url>
+ <url type="faq">https://git.dec05eba.com/gpu-screen-recorder/about/</url>
<supports>
<control>pointing</control>
diff --git a/src/main.cpp b/src/main.cpp
index 887e854..d3d633d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4305,11 +4305,7 @@ static const char* gpu_vendor_to_name(GpuVendor vendor) {
return "";
}
-static void activate(GtkApplication *app, gpointer) {
- flatpak = is_inside_flatpak();
- nvfbc_installed = gsr_info.system_info.display_server != DisplayServer::WAYLAND && is_nv_fbc_installed();
- page_navigation_userdata.app = app;
-
+static bool gsr_startup_validation() {
if(gsr_info_exit_status == GsrInfoExitStatus::FAILED_TO_RUN_COMMAND) {
const char *cmd = flatpak ? "flatpak run --command=gpu-screen-recorder com.dec05eba.gpu_screen_recorder -w screen -f 60 -o video.mp4" : "gpu-screen-recorder -w screen -f 60 -o video.mp4";
GtkWidget *dialog = gtk_message_dialog_new_with_markup(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
@@ -4319,8 +4315,7 @@ static void activate(GtkApplication *app, gpointer) {
set_dialog_selectable(dialog);
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
- g_application_quit(G_APPLICATION(app));
- return;
+ return false;
}
if(gsr_info_exit_status == GsrInfoExitStatus::OPENGL_FAILED) {
@@ -4331,8 +4326,7 @@ static void activate(GtkApplication *app, gpointer) {
set_dialog_selectable(dialog);
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
- g_application_quit(G_APPLICATION(app));
- return;
+ return false;
}
if(gsr_info_exit_status == GsrInfoExitStatus::NO_DRM_CARD) {
@@ -4340,8 +4334,7 @@ static void activate(GtkApplication *app, gpointer) {
"Failed to find a valid DRM card. If you are running GPU Screen Recorder with prime-run then try running without it.");
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
- g_application_quit(G_APPLICATION(app));
- return;
+ return false;
}
if(gsr_info.system_info.display_server == DisplayServer::UNKNOWN) {
@@ -4349,8 +4342,7 @@ static void activate(GtkApplication *app, gpointer) {
"Neither X11 nor Wayland is running.");
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
- g_application_quit(G_APPLICATION(app));
- return;
+ return false;
}
if(gsr_info.system_info.display_server == DisplayServer::X11 && !dpy) {
@@ -4358,8 +4350,7 @@ static void activate(GtkApplication *app, gpointer) {
"Failed to connect to the X11 server");
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
- g_application_quit(G_APPLICATION(app));
- return;
+ return false;
}
if(gsr_info.gpu_info.vendor == GpuVendor::NVIDIA) {
@@ -4368,8 +4359,7 @@ static void activate(GtkApplication *app, gpointer) {
"CUDA is not installed on your system. GPU Screen Recorder requires CUDA to be installed to work with a NVIDIA GPU.");
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
- g_application_quit(G_APPLICATION(app));
- return;
+ return false;
}
if(!is_nvenc_installed()) {
@@ -4377,11 +4367,21 @@ static void activate(GtkApplication *app, gpointer) {
"NVENC is not installed on your system. GPU Screen Recorder requires NVENC to be installed to work with a NVIDIA GPU.");
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
- g_application_quit(G_APPLICATION(app));
- return;
+ return false;
}
}
+ return true;
+}
+
+static void activate(GtkApplication *app, gpointer) {
+ if(!gsr_startup_validation()) {
+ g_application_quit(G_APPLICATION(app));
+ return;
+ }
+
+ page_navigation_userdata.app = app;
+
std::string window_title = "GPU Screen Recorder v" + std::string(GSR_VERSION) + " | Running on ";
window_title += gpu_vendor_to_name(gsr_info.gpu_info.vendor);
@@ -4526,6 +4526,11 @@ static void startup_new_ui(bool launched_by_daemon) {
}
}
+ start_gtk_run_handler([]() {
+ if(!gsr_startup_validation())
+ exit(0);
+ });
+
if(!flatpak_is_installed_as_system()) {
start_gtk_run_handler([]() {
GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
@@ -4587,17 +4592,7 @@ int main(int argc, char **argv) {
config_empty = false;
config = read_config(config_empty);
- if(use_old_ui_opt) {
- system("flatpak-spawn --host -- systemctl disable --now --user gpu-screen-recorder-ui");
- config.main_config.use_new_ui = false;
- save_config(config);
- }
-
- if(config.main_config.use_new_ui)
- startup_new_ui(launched_by_daemon_opt);
-
gsr_info_exit_status = get_gpu_screen_recorder_info(&gsr_info);
-
if(gsr_info_exit_status == GsrInfoExitStatus::OK) {
if(gsr_info.system_info.display_server == DisplayServer::WAYLAND) {
setenv("GDK_BACKEND", "wayland", true);
@@ -4606,6 +4601,19 @@ int main(int argc, char **argv) {
}
}
+ flatpak = is_inside_flatpak();
+ nvfbc_installed = gsr_info.system_info.display_server != DisplayServer::WAYLAND && is_nv_fbc_installed();
+
+ if(use_old_ui_opt) {
+ system("flatpak-spawn --host -- systemctl disable --user gpu-screen-recorder-ui");
+ system("flatpak-spawn --host -- systemctl stop --user gpu-screen-recorder-ui");
+ config.main_config.use_new_ui = false;
+ save_config(config);
+ }
+
+ if(config.main_config.use_new_ui)
+ startup_new_ui(launched_by_daemon_opt);
+
char app_id[] = "com.dec05eba.gpu_screen_recorder";
// Gtk sets wayland app id / x11 wm class from the binary name, so we override it here.
// This is needed for the correct window icon on wayland (app id needs to match the desktop file name).