Allow window to go to background if overlay open

pull/130/head
Peter Repukat 3 years ago
parent 9942f2566c
commit 2b99d1f89b

@ -66,8 +66,6 @@ TargetWindow::TargetWindow(std::function<void()> on_close, std::vector<std::stri
MARGINS margins;
margins.cxLeftWidth = -1;
DwmExtendFrameIntoClientArea(hwnd, &margins);
// always on top
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
DEVMODE dev_mode = {};
dev_mode.dmSize = sizeof(DEVMODE);
@ -101,9 +99,11 @@ void TargetWindow::setClickThrough(bool click_through)
HWND hwnd = window_.getSystemHandle();
if (click_through) {
SetWindowLong(hwnd, GWL_EXSTYLE, WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOPMOST | WS_EX_COMPOSITED);
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
else {
SetWindowLong(hwnd, GWL_EXSTYLE, WS_EX_LAYERED | WS_EX_COMPOSITED);
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
#endif
}

Loading…
Cancel
Save