1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-08 04:09:15 -04:00

popout: fix opening popouts across monitors

cc/brightness: fix delegate bindings and pinning
This commit is contained in:
bbedward
2026-05-19 11:23:03 -04:00
parent 4845299cc2
commit cdc1102092
6 changed files with 249 additions and 134 deletions
+26 -6
View File
@@ -357,14 +357,19 @@ Item {
animationsEnabled = false;
_primeContent = true;
if (_lastOpenedScreen !== null && _lastOpenedScreen !== screen) {
const screenChanged = _lastOpenedScreen !== null && _lastOpenedScreen !== screen;
if (screenChanged) {
// Hide on this tick so Qt actually tears down the wl_surface; the show
// gets deferred below so the unmap is processed before the remap.
contentWindow.visible = false;
}
_lastOpenedScreen = screen;
if (contentContainer) {
// animationsEnabled is false here, so this snaps to closed without animating.
morph.openProgress = 0;
// Snap morph closed only on a fresh open; on screen-change re-open we stay at 1
// because shouldBeVisible doesn't change and won't drive morph back to 1.
if (!shouldBeVisible)
morph.openProgress = 0;
_captureChromeAnimTravel();
}
@@ -375,12 +380,25 @@ Item {
_chromeClaimId = "";
}
contentWindow.visible = true;
if (screenChanged) {
// Defer the show one event-loop tick. Qt coalesces a synchronous
// false→true visibility flip into a no-op, leaving WindowBlur committed
// to the previous screen's wl_surface. Splitting the flip across ticks
// forces a real surface destroy+create so BackgroundEffect.surfaceCreated
// fires and the blur region republishes on the new surface.
Qt.callLater(() => {
if (!root.shouldBeVisible)
return;
contentWindow.visible = true;
popoutBlur.kick();
});
} else {
contentWindow.visible = true;
}
animationsEnabled = true;
shouldBeVisible = true;
if (shouldBeVisible && screen) {
contentWindow.visible = true;
PopoutManager.showPopout(popoutHandle);
opened();
}
@@ -1081,7 +1099,9 @@ Item {
Connections {
target: contentWindow
function onVisibleChanged() {
if (!contentWindow.visible)
// open() flips contentWindow.visible to rebind the layer surface to
// a new screen; don't deactivate the wrapper while still open.
if (!contentWindow.visible && !root.shouldBeVisible)
contentWrapper._renderActive = false;
}
}
+31 -7
View File
@@ -287,21 +287,43 @@ Item {
_frozenMaskWidth = maskWidth;
_frozenMaskHeight = maskHeight;
if (_lastOpenedScreen !== null && _lastOpenedScreen !== screen) {
const screenChanged = _lastOpenedScreen !== null && _lastOpenedScreen !== screen;
if (screenChanged) {
// Hide on this tick so Qt actually tears down the wl_surface; the show
// gets deferred below so the unmap is processed before the remap.
contentWindow.visible = false;
backgroundWindow.visible = false;
}
_lastOpenedScreen = screen;
if (contentContainer) {
// animationsEnabled is false here, so this snaps to closed without animating.
if (contentContainer && !shouldBeVisible) {
// Snap morph closed only on a fresh open; on screen-change re-open we stay at 1
// because shouldBeVisible doesn't change and won't drive morph back to 1.
morph.openProgress = 0;
}
_setSurfaceGeometry(alignedX, alignedY, alignedWidth, alignedHeight);
if (backgroundWindowRequired)
backgroundWindow.visible = true;
contentWindow.visible = true;
if (screenChanged) {
// Defer the show one event-loop tick. Qt coalesces a synchronous
// false→true visibility flip into a no-op, leaving WindowBlur committed
// to the previous screen's wl_surface. Splitting the flip across ticks
// forces a real surface destroy+create so BackgroundEffect.surfaceCreated
// fires and the blur region republishes on the new surface.
Qt.callLater(() => {
if (!root.shouldBeVisible)
return;
if (root.backgroundWindowRequired)
backgroundWindow.visible = true;
contentWindow.visible = true;
popoutBlur.kick();
_bgCommitWindow = true;
bgCommitSettleTimer.restart();
});
} else {
if (backgroundWindowRequired)
backgroundWindow.visible = true;
contentWindow.visible = true;
}
animationsEnabled = true;
shouldBeVisible = true;
@@ -840,7 +862,9 @@ Item {
Connections {
target: contentWindow
function onVisibleChanged() {
if (!contentWindow.visible)
// open() flips contentWindow.visible to rebind the layer surface to
// a new screen; don't deactivate the wrapper while still open.
if (!contentWindow.visible && !root.shouldBeVisible)
contentWrapper._renderActive = false;
}
}
+11
View File
@@ -34,6 +34,17 @@ Item {
targetWindow.BackgroundEffect.blurRegion = _active ? blurRegion : null;
}
// Force BackgroundEffect to re-publish the blur region on the current wl_surface.
// Clearing first bypasses Quickshell's same-Region dedup in BackgroundEffect::setBlurRegion,
// setting pendingBlurRegion=true so the next polish actually ships the region — needed
// when the underlying surface has been remapped (e.g. PanelWindow.screen change).
function kick() {
if (!targetWindow)
return;
targetWindow.BackgroundEffect.blurRegion = null;
targetWindow.BackgroundEffect.blurRegion = _active ? blurRegion : null;
}
on_ActiveChanged: _apply()
onTargetWindowChanged: _apply()