mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-05-04 22:10:44 +09:00
Fix regression: incorrect window resulting in incorrect game name and background for uncomposited x11
This commit is contained in:
@@ -45,21 +45,21 @@ namespace gsr {
|
|||||||
Window focused_window = None;
|
Window focused_window = None;
|
||||||
|
|
||||||
if(cap_type == WindowCaptureType::FOCUSED) {
|
if(cap_type == WindowCaptureType::FOCUSED) {
|
||||||
Atom type = None;
|
// Atom type = None;
|
||||||
int format = 0;
|
// int format = 0;
|
||||||
unsigned long num_items = 0;
|
// unsigned long num_items = 0;
|
||||||
unsigned long bytes_left = 0;
|
// unsigned long bytes_left = 0;
|
||||||
unsigned char *data = NULL;
|
// unsigned char *data = NULL;
|
||||||
XGetWindowProperty(dpy, DefaultRootWindow(dpy), net_active_window_atom, 0, 1, False, XA_WINDOW, &type, &format, &num_items, &bytes_left, &data);
|
// 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)
|
// if(type == XA_WINDOW && num_items == 1 && data)
|
||||||
focused_window = *(Window*)data;
|
// focused_window = *(Window*)data;
|
||||||
|
|
||||||
if(data)
|
// if(data)
|
||||||
XFree(data);
|
// XFree(data);
|
||||||
|
|
||||||
if(focused_window)
|
// if(focused_window)
|
||||||
return focused_window;
|
// return focused_window;
|
||||||
|
|
||||||
int revert_to = 0;
|
int revert_to = 0;
|
||||||
XGetInputFocus(dpy, &focused_window, &revert_to);
|
XGetInputFocus(dpy, &focused_window, &revert_to);
|
||||||
|
|||||||
Reference in New Issue
Block a user