forked from quickshell/quickshell
core/popupanchor: ensure item-derived rect is at least 1x1 pixels
This commit is contained in:
parent
9a30333405
commit
579d589290
1 changed files with 4 additions and 0 deletions
|
@ -189,11 +189,15 @@ void PopupAnchor::updateAnchor() {
|
|||
if (this->mItem && this->mProxyWindow) {
|
||||
auto baseRect =
|
||||
this->mUserRect.isEmpty() ? this->mItem->boundingRect() : this->mUserRect.qrect();
|
||||
|
||||
auto rect = this->mProxyWindow->contentItem()->mapFromItem(
|
||||
this->mItem,
|
||||
baseRect.marginsRemoved(this->mMargins.qmargins())
|
||||
);
|
||||
|
||||
if (rect.width() < 1) rect.setWidth(1);
|
||||
if (rect.height() < 1) rect.setHeight(1);
|
||||
|
||||
this->setWindowRect(rect.toRect());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue