mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-05-05 06:20:44 +09:00
Only allow one instance of gsr-ui to run
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "../include/GlobalHotkeysX11.hpp"
|
||||
#include "../include/GlobalHotkeysLinux.hpp"
|
||||
#include "../include/gui/Utils.hpp"
|
||||
#include "../include/Process.hpp"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
@@ -170,6 +171,13 @@ int main(int argc, char **argv) {
|
||||
usage();
|
||||
}
|
||||
|
||||
const pid_t gsr_ui_pid = gsr::pidof("gsr-ui");
|
||||
if(gsr_ui_pid != -1) {
|
||||
const char *args[] = { "gsr-notify", "--text", "Another instance of GPU Screen Recorder UI is already running", "--timeout", "5.0", "--icon-color", "ff0000", "--bg-color", "ff0000", nullptr };
|
||||
gsr::exec_program_daemonized(args);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Cant get window texture when prime-run is used
|
||||
disable_prime_run();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user