window: fix empty masks not applying

This commit is contained in:
outfoxxed 2024-03-10 04:08:42 -07:00
parent 7a15495e3f
commit 8cf0659444
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -1,5 +1,6 @@
#include "proxywindow.hpp" #include "proxywindow.hpp"
#include <qnamespace.h>
#include <qobject.h> #include <qobject.h>
#include <qqmlengine.h> #include <qqmlengine.h>
#include <qqmllist.h> #include <qqmllist.h>
@ -215,6 +216,12 @@ void ProxyWindowBase::updateMask() {
auto windowRegion = QRegion(QRect(0, 0, this->width(), this->height())); auto windowRegion = QRegion(QRect(0, 0, this->width(), this->height()));
mask = this->mMask->applyTo(windowRegion); mask = this->mMask->applyTo(windowRegion);
} }
if (mask.isEmpty()) {
this->window->setFlag(Qt::WindowTransparentForInput, true);
}
} else {
this->window->setFlag(Qt::WindowTransparentForInput, false);
} }
this->window->setMask(mask); this->window->setMask(mask);