mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Add option to take a screenshot (default hotkey: alt+f1)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include <mglpp/mglpp.hpp>
|
||||
#include <mglpp/system/Clock.hpp>
|
||||
@@ -72,6 +73,11 @@ static void rpc_add_commands(gsr::Rpc *rpc, gsr::Overlay *overlay) {
|
||||
fprintf(stderr, "rpc command executed: %s\n", name.c_str());
|
||||
overlay->save_replay();
|
||||
});
|
||||
|
||||
rpc->add_handler("take-screenshot", [overlay](const std::string &name) {
|
||||
fprintf(stderr, "rpc command executed: %s\n", name.c_str());
|
||||
overlay->take_screenshot();
|
||||
});
|
||||
}
|
||||
|
||||
static bool is_gsr_ui_virtual_keyboard_running() {
|
||||
@@ -150,6 +156,7 @@ enum class LaunchAction {
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
setlocale(LC_ALL, "C"); // Sigh... stupid C
|
||||
mallopt(M_MMAP_THRESHOLD, 65536);
|
||||
|
||||
if(geteuid() == 0) {
|
||||
fprintf(stderr, "Error: don't run gsr-ui as the root user\n");
|
||||
|
||||
Reference in New Issue
Block a user