mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 10:09:49 +01:00
swallow: fix invalid regexes with empty vals
This commit is contained in:
parent
4c4fcc128b
commit
8944db49be
1 changed files with 10 additions and 4 deletions
|
@ -509,7 +509,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify swallowing
|
// verify swallowing
|
||||||
if (*PSWALLOW) {
|
if (*PSWALLOW && *PSWALLOWREGEX != STRVAL_EMPTY) {
|
||||||
// don't swallow ourselves
|
// don't swallow ourselves
|
||||||
std::regex rgx(*PSWALLOWREGEX);
|
std::regex rgx(*PSWALLOWREGEX);
|
||||||
if (!std::regex_match(g_pXWaylandManager->getAppIDClass(PWINDOW), rgx)) {
|
if (!std::regex_match(g_pXWaylandManager->getAppIDClass(PWINDOW), rgx)) {
|
||||||
|
@ -554,10 +554,16 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (finalFound) {
|
if (finalFound) {
|
||||||
|
bool valid = std::regex_match(g_pXWaylandManager->getAppIDClass(finalFound), rgx);
|
||||||
|
|
||||||
|
if (*PSWALLOWEXREGEX != STRVAL_EMPTY) {
|
||||||
std::regex exc(*PSWALLOWEXREGEX);
|
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
|
// check if it's the window we want & not exempt from getting swallowed
|
||||||
if (std::regex_match(g_pXWaylandManager->getAppIDClass(finalFound), rgx) &&
|
if (valid) {
|
||||||
!std::regex_match(g_pXWaylandManager->getTitle(finalFound), exc)) {
|
|
||||||
// swallow
|
// swallow
|
||||||
PWINDOW->m_pSwallowed = finalFound;
|
PWINDOW->m_pSwallowed = finalFound;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue