From f4a8137412f02ae1ceabcc5b98a053e69cf09834 Mon Sep 17 00:00:00 2001 From: Aidan Epstein Date: Tue, 28 Mar 2017 17:57:14 -0500 Subject: [PATCH] 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 --- plugins/linux-capture/xcompcap-helper.cpp | 3 +++ plugins/linux-capture/xcompcap-main.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/linux-capture/xcompcap-helper.cpp b/plugins/linux-capture/xcompcap-helper.cpp index cf4f0f6ab..55657f822 100644 --- a/plugins/linux-capture/xcompcap-helper.cpp +++ b/plugins/linux-capture/xcompcap-helper.cpp @@ -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); } diff --git a/plugins/linux-capture/xcompcap-main.cpp b/plugins/linux-capture/xcompcap-main.cpp index 7a09ecbbf..50c2d9974 100644 --- a/plugins/linux-capture/xcompcap-main.cpp +++ b/plugins/linux-capture/xcompcap-main.cpp @@ -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;