Skip to content

Commit

Permalink
fix: linearize desktops in the desktop bar when using non linear desk…
Browse files Browse the repository at this point in the history
…top layout

Hiding the desktop bar based on the desktop layout produces unexpected
results.

BUG: 482023
  • Loading branch information
zzag authored and romangg committed Oct 9, 2024
1 parent 8eafe66 commit aa6eda4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions plugins/effects/overview/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ FocusScope {
property bool organized: false

property bool verticalDesktopBar: KWinComponents.Workspace.desktopGridHeight >= bar.desktopCount && KWinComponents.Workspace.desktopGridHeight != 1
property bool anyDesktopBar: verticalDesktopBar || KWinComponents.Workspace.desktopGridHeight == 1

// The values of overviewVal and gridVal might not be 0 on startup,
// but we always want to animate from 0 to those values. So, we initially
Expand Down Expand Up @@ -272,7 +271,6 @@ FocusScope {

Item {
id: desktopBar
visible: container.anyDesktopBar

// (overviewVal, gridVal) represents the state of the overview
// in a 2D coordinate plane. Math.atan2 returns the angle between
Expand Down Expand Up @@ -308,7 +306,7 @@ FocusScope {
opacity: desktopBar.opacity
anchors.left: container.verticalDesktopBar ? desktopBar.right : parent.left
anchors.right: parent.right
anchors.top: container.verticalDesktopBar || !container.anyDesktopBar ? parent.top : desktopBar.bottom
anchors.top: container.verticalDesktopBar ? parent.top : desktopBar.bottom
anchors.topMargin: Kirigami.Units.largeSpacing
height: searchField.height + 1 * Kirigami.Units.largeSpacing

Expand Down Expand Up @@ -340,7 +338,7 @@ FocusScope {

// These are the minimum position of maximum size of the desktop preview in the overview
property int minX: Kirigami.Units.largeSpacing + (container.verticalDesktopBar ? desktopBar.width : 0)
property int minY: Kirigami.Units.largeSpacing + topBar.height + (container.verticalDesktopBar || !container.anyDesktopBar ? 0 : desktopBar.height)
property int minY: Kirigami.Units.largeSpacing + topBar.height + (container.verticalDesktopBar ? 0 : desktopBar.height)
property int maxWidth: currentGeometry.width - minX - Kirigami.Units.gridUnit * 2
property int maxHeight: currentGeometry.height - minY - Kirigami.Units.gridUnit * 2

Expand Down Expand Up @@ -655,7 +653,6 @@ FocusScope {
partialActivationFactor: container.overviewVal + container.gridVal * effect.organizedGrid

targetScale: {
if (!container.anyDesktopBar) return targetScale;
if (overviewVal != 1) return targetScale;
let coordinate = container.verticalDesktopBar ? 'x' : 'y'
if (!activeDragHandler.active) {
Expand Down

0 comments on commit aa6eda4

Please sign in to comment.