linux-capture: Watch for VisibilityNotify events

Some window managers like i3 don't issue Expose events when switching
between workspaces, but send VisibilityNotify events. This causes the
stream to freeze even when the workspace is switched back.

Related issue: #863
master
Aidan Epstein 2017-03-28 17:57:14 -05:00 committed by Antoine Pietri
parent 91c292d394
commit f4a8137412
2 changed files with 7 additions and 1 deletions

View File

@ -267,6 +267,9 @@ namespace XCompcap
if (ev.type == Expose)
changedWindows.insert(ev.xexpose.window);
if (ev.type == VisibilityNotify)
changedWindows.insert(ev.xvisibility.window);
if (ev.type == DestroyNotify)
changedWindows.insert(ev.xdestroywindow.event);
}

View File

@ -318,7 +318,10 @@ void XCompcapMain::updateSettings(obs_data_t *settings)
}
if (p->win)
XSelectInput(xdisp, p->win, StructureNotifyMask | ExposureMask);
XSelectInput(xdisp, p->win,
StructureNotifyMask
| ExposureMask
| VisibilityChangeMask);
XSync(xdisp, 0);
XWindowAttributes attr;