-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popup/dialogs spawn at incorrect position if 'Native panel background' is disabled in Plasma 6.2 Beta #80
Comments
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 } 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.
Screencast_20241004_223204.webm |
Upstream Bugreport https://bugs.kde.org/show_bug.cgi?id=494193 |
Fix has been merged 🎉 Will be available in Plasma 6.2.2 (Tue 2024-10-22) |
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 #100, the Something needs to be done to ensure the the mask is always the correct one, most likely requires another upstream patch. |
The text was updated successfully, but these errors were encountered: