diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-05-31 22:54:14 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-05-31 23:00:42 +0200 |
commit | 4d7526d21ed78f61eefcb88631762127fb0d4e97 (patch) | |
tree | 0d0121c5acee59813eb66b8eb7ba0b095a8060f5 /src/WindowUtils.cpp | |
parent | fded9b8d57facde1a01e9456d9fd9c3b6955dd23 (diff) |
Add x11 window capture (video and screenshot)
Diffstat (limited to 'src/WindowUtils.cpp')
-rw-r--r-- | src/WindowUtils.cpp | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/WindowUtils.cpp b/src/WindowUtils.cpp index eb6080f..c6b278b 100644 --- a/src/WindowUtils.cpp +++ b/src/WindowUtils.cpp @@ -1,4 +1,5 @@ #include "../include/WindowUtils.hpp" +#include "../include/Utils.hpp" #include <X11/Xatom.h> #include <X11/Xutil.h> @@ -62,7 +63,7 @@ namespace gsr { return window_has_atom(dpy, window, net_wm_state_atom) || window_has_atom(dpy, window, wm_state_atom); } - static Window window_get_target_window_child(Display *display, Window window) { + Window window_get_target_window_child(Display *display, Window window) { if(window == None) return None; @@ -212,28 +213,6 @@ namespace gsr { return result; } - static std::string strip(const std::string &str) { - int start_index = 0; - int str_len = str.size(); - - for(int i = 0; i < str_len; ++i) { - if(str[i] != ' ') { - start_index += i; - str_len -= i; - break; - } - } - - for(int i = str_len - 1; i >= 0; --i) { - if(str[i] != ' ') { - str_len = i + 1; - break; - } - } - - return str.substr(start_index, str_len); - } - std::string get_focused_window_name(Display *dpy, WindowCaptureType window_capture_type) { std::string result; const Window focused_window = get_focused_window(dpy, window_capture_type); |