Simplify tile dismissal

We want floating tiles to be activatable, but also dismiss the effect by
clicking on the whitespace.

The current solution doesn't work as a floating tile that is in turn
split will pull focus from the children meaning those tiles can't be deleted.

Rather than special casing and z-manipulation we can simplify everything
by moving tile dismissal to the root of the effect and appropariately
propagating the event.

BUG: 465740
This commit is contained in:
David Edmundson 2023-02-15 23:05:13 +00:00
parent 9b6c9242f6
commit 7b46f101e3
2 changed files with 8 additions and 3 deletions

View file

@ -17,7 +17,7 @@ Item {
x: Math.round(tile.absoluteGeometryInScreen.x)
y: Math.round(tile.absoluteGeometryInScreen.y)
z: (tile.layoutDirection === KWinComponents.Tile.Floating ? 1 : 0) + (focus ? 10 : 0)
z: focus ? 1000 : 0
//onZChanged: print(delegate + " "+z)
width: Math.round(tile.absoluteGeometryInScreen.width)
height: Math.round(tile.absoluteGeometryInScreen.height)
@ -126,12 +126,12 @@ Item {
MouseArea {
anchors.fill: parent
hoverEnabled: true
// enabled: tile.layoutDirection === KWinComponents.Tile.Floating
propagateComposedEvents: true
property point lastPos
onClicked: {
delegate.focus = true;
if (tile.layoutDirection !== KWinComponents.Tile.Floating) {
effect.deactivate(effect.animationDuration);
mouse.accepted = false;
}
}
onPressed: {

View file

@ -46,6 +46,11 @@ FocusScope {
active = false;
}
MouseArea {
anchors.fill: parent
onClicked: effect.deactivate(effect.animationDuration);
}
Item {
id: blurredWindows
anchors.fill: parent