Open luisbocanegra opened 1 month ago
Well turns out popups now align with the panel mask https://invent.kde.org/plasma/libplasma/-/merge_requests/1148.
Setting PlasmaCore.Types.NoBackground to the panel containmentItem https://github.com/luisbocanegra/plasma-panel-colorizer/blob/b284edbb89a335476418cf631d1a72d408c07c19/package/contents/ui/code/utils.js#L84C1-L88C2
function toggleTransparency(containmentItem, nativePanelBackgroundEnabled) {
containmentItem.Plasmoid.backgroundHints = !nativePanelBackgroundEnabled
? PlasmaCore.Types.NoBackground
: PlasmaCore.Types.DefaultBackground
}
results in the panel creating an empty mask https://github.com/KDE/plasma-workspace/blob/c809de7c72dcc7e94eeed5a0b09cb81f5512c2e0/shell/panelview.cpp#L1363C1-L1366C28
void PanelView::updateMask()
{
...
if (m_backgroundHints == Plasma::Types::NoBackground) {
KWindowEffects::enableBlurBehind(this, false);
KWindowEffects::enableBackgroundContrast(this, false);
setMask(QRegion()); // <- this line
Which successfully removes the blur and contrast (allowing the panel to be fully transparent) but breaks the positioning of popups.
If I don't set PlasmaCore.Types.NoBackground
and instead try to create an empty mask from my PanelColorizer::updatePanelMask, the panel detects it's empty and creates its own from the panel QRect instead:
} else {
QRegion mask;
QQuickItem *rootObject = this->rootObject();
QRect screenPanelRect = geometry();
screenPanelRect.moveTo(mapFromGlobal(screenPanelRect.topLeft()));
if (rootObject) {
QVariant maskProperty = rootObject->property("panelMask");
if (static_cast<QMetaType::Type>(maskProperty.typeId()) == QMetaType::QRegion) {
mask = get<QRegion>(std::move(maskProperty));
const QPoint floatingTranslucentItemOffset = rootObject->property("floatingTranslucentItemOffset").toPoint();
mask.translate(floatingTranslucentItemOffset);
}
}
if (mask.isEmpty()) {
mask = QRegion(QRect(screenPanelRect));
}
Creating a 1x1 mask and setting the correct position fixes the popups but now there is a bright dot on the screen and it will require compiling the C++ plugin.
region = QRegion();
translateX = abs(offset.x());
translateY = abs(offset.y() + rect.height() - 1);
Upstream Bugreport https://bugs.kde.org/show_bug.cgi?id=494193 Submitted a fix at https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4797 waiting for it to be reviewed
Fix has been merged 🎉 Will be available in Plasma 6.2.2 (Tue 2024-10-22)
Has this actually been fixed? I still face this issue with the dialogs being offset. I can temporarily fix it by enabling native panel background and disabling it, but this resets when I restart my system.
Using Plasma 6.2.3 Running widget version 1.2.0-1 from Aur
Has this actually been fixed? I still face this issue with the dialogs being offset. I can temporarily fix it by enabling native panel background and disabling it, but this resets when I restart my system.
Using Plasma 6.2.3 Running widget version 1.2.0-1 from Aur
Same. Plasma 6.2.3(Wayland), widget version 1.2.0-1 from AUR
With Blur custom background disabled on the panel, popups are spawned at the edge of the original blur mask (provided by the Plasma style SVG) and without Native panel background popups spawn at the edge of the panel "window" which seems to be bigger than the panel probably to reserve space for the SVG shadows and dodge windows features
That is why by enabling Blur custom background "fixes" the problem.
Also might be related to https://github.com/luisbocanegra/plasma-panel-colorizer/issues/100, the fix workaround for that was turn the mask on and off again when the panel size changes, just like what @nikoraasu describes.
Something needs to be done to ensure the the mask is always the correct one, most likely requires another upstream patch.