mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-04-08 04:18:08 +09:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f526c175f6 | ||
|
|
4e25fd486b |
@@ -1,4 +1,4 @@
|
||||
project('gsr-ui', ['c', 'cpp'], version : '1.0.2', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
|
||||
project('gsr-ui', ['c', 'cpp'], version : '1.0.3', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
|
||||
|
||||
if get_option('buildtype') == 'debug'
|
||||
add_project_arguments('-g3', language : ['c', 'cpp'])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "gsr-ui"
|
||||
type = "executable"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
platforms = ["posix"]
|
||||
|
||||
[lang.cpp]
|
||||
|
||||
@@ -45,21 +45,21 @@ namespace gsr {
|
||||
Window focused_window = None;
|
||||
|
||||
if(cap_type == WindowCaptureType::FOCUSED) {
|
||||
Atom type = None;
|
||||
int format = 0;
|
||||
unsigned long num_items = 0;
|
||||
unsigned long bytes_left = 0;
|
||||
unsigned char *data = NULL;
|
||||
XGetWindowProperty(dpy, DefaultRootWindow(dpy), net_active_window_atom, 0, 1, False, XA_WINDOW, &type, &format, &num_items, &bytes_left, &data);
|
||||
// Atom type = None;
|
||||
// int format = 0;
|
||||
// unsigned long num_items = 0;
|
||||
// unsigned long bytes_left = 0;
|
||||
// unsigned char *data = NULL;
|
||||
// XGetWindowProperty(dpy, DefaultRootWindow(dpy), net_active_window_atom, 0, 1, False, XA_WINDOW, &type, &format, &num_items, &bytes_left, &data);
|
||||
|
||||
if(type == XA_WINDOW && num_items == 1 && data)
|
||||
focused_window = *(Window*)data;
|
||||
// if(type == XA_WINDOW && num_items == 1 && data)
|
||||
// focused_window = *(Window*)data;
|
||||
|
||||
if(data)
|
||||
XFree(data);
|
||||
// if(data)
|
||||
// XFree(data);
|
||||
|
||||
if(focused_window)
|
||||
return focused_window;
|
||||
// if(focused_window)
|
||||
// return focused_window;
|
||||
|
||||
int revert_to = 0;
|
||||
XGetInputFocus(dpy, &focused_window, &revert_to);
|
||||
|
||||
Reference in New Issue
Block a user