summaryrefslogtreecommitdiff
path: root/src/events/Windows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/events/Windows.cpp')
-rw-r--r--src/events/Windows.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 1c95a1e5..d4164dff 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -509,7 +509,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
}
// verify swallowing
- if (*PSWALLOW) {
+ if (*PSWALLOW && *PSWALLOWREGEX != STRVAL_EMPTY) {
// don't swallow ourselves
std::regex rgx(*PSWALLOWREGEX);
if (!std::regex_match(g_pXWaylandManager->getAppIDClass(PWINDOW), rgx)) {
@@ -554,10 +554,16 @@ void Events::listener_mapWindow(void* owner, void* data) {
}
if (finalFound) {
- std::regex exc(*PSWALLOWEXREGEX);
+ bool valid = std::regex_match(g_pXWaylandManager->getAppIDClass(finalFound), rgx);
+
+ if (*PSWALLOWEXREGEX != STRVAL_EMPTY) {
+ std::regex exc(*PSWALLOWEXREGEX);
+
+ valid = valid && !std::regex_match(g_pXWaylandManager->getTitle(finalFound), exc);
+ }
+
// check if it's the window we want & not exempt from getting swallowed
- if (std::regex_match(g_pXWaylandManager->getAppIDClass(finalFound), rgx) &&
- !std::regex_match(g_pXWaylandManager->getTitle(finalFound), exc)) {
+ if (valid) {
// swallow
PWINDOW->m_pSwallowed = finalFound;