Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] plasma-workspace: partially revert panelspacer to old behaviour to pr…
@ 2021-04-03 15:43 Johnnynator
  2021-04-03 16:15 ` [PR REVIEW] " ericonr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Johnnynator @ 2021-04-03 15:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1674 bytes --]

There is a new pull request by Johnnynator against master on the void-packages repository

https://github.com/Johnnynator/void-packages panelspacer
https://github.com/void-linux/void-packages/pull/29977

plasma-workspace: partially revert panelspacer to old behaviour to pr…
…event a crash on musl

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29977.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-panelspacer-29977.patch --]
[-- Type: text/x-diff, Size: 9032 bytes --]

From 2b5a29a6b855f4c4fc385868deefec9eb2c5e77c Mon Sep 17 00:00:00 2001
From: John Zimmermann <me@johnnynator.dev>
Date: Sat, 3 Apr 2021 17:41:47 +0200
Subject: [PATCH] plasma-workspace: partially revert panelspacer to old
 behaviour to prevent a crash on musl

---
 .../files/panelspacer-musl.patch              | 170 ++++++++++++++++++
 srcpkgs/plasma-workspace/template             |   8 +-
 2 files changed, 177 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/plasma-workspace/files/panelspacer-musl.patch

diff --git a/srcpkgs/plasma-workspace/files/panelspacer-musl.patch b/srcpkgs/plasma-workspace/files/panelspacer-musl.patch
new file mode 100644
index 000000000000..14e6ecb3f587
--- /dev/null
+++ b/srcpkgs/plasma-workspace/files/panelspacer-musl.patch
@@ -0,0 +1,170 @@
+This is essentially a revert to the behaviour pre 7b3b06a48576835df0386b0bc29bb325e53a04ed
+The "new" one crashes on both 32bit and musl Systems.
+---
+--- applets/panelspacer/package/contents/ui/main.qml	2021-04-03 16:45:02.282366207 +0200
++++ -	2021-04-03 17:33:41.066971468 +0200
+@@ -17,156 +17,38 @@
+  * You chenterX have received a copy of the GNU General Public License
+  * along with this program.  If not, see <http://www.gnu.org/licenses/>
+  */
+-
+ import QtQuick 2.0
+ import QtQuick.Layouts 1.1
+ import org.kde.plasma.core 2.0 as PlasmaCore
+ import org.kde.plasma.plasmoid 2.0
+-import org.kde.kirigami 2.10 as Kirigami
++import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
+ 
+ Item {
+     id: root
+ 
++    z: 9999
+     property bool horizontal: plasmoid.formFactor !== PlasmaCore.Types.Vertical
+ 
+     Layout.fillWidth: plasmoid.configuration.expanding
+     Layout.fillHeight: plasmoid.configuration.expanding
+ 
+-    Layout.minimumWidth: plasmoid.nativeInterface.containment.editMode ? units.gridUnit * 2 : 1
+-    Layout.minimumHeight: plasmoid.nativeInterface.containment.editMode ? units.gridUnit * 2 : 1
+-    Layout.preferredWidth: horizontal
+-        ? (plasmoid.configuration.expanding ? optimalSize : plasmoid.configuration.length)
+-        : 0
+-    Layout.preferredHeight: horizontal
+-        ? 0
+-        : (plasmoid.configuration.expanding ? optimalSize : plasmoid.configuration.length)
++    Layout.minimumWidth: 1
++    Layout.minimumHeight: 1
++    Layout.preferredWidth: horizontal ? plasmoid.configuration.length : 0
++    Layout.preferredHeight: horizontal ? 0 : plasmoid.configuration.length
+ 
+     Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
+ 
+-    property int optimalSize: units.largeSpacing
+-
+     function action_expanding() {
+         plasmoid.configuration.expanding = plasmoid.action("expanding").checked;
+     }
+-
+-    // Search the actual gridLayout of the panel
+-    property GridLayout panelLayout: {
+-        var candidate = root.parent;
+-        while (candidate) {
+-            if (candidate instanceof GridLayout) {
+-                return candidate;
+-            }
+-            candidate = candidate.parent;
+-        }
+-    }
+-
+     Component.onCompleted: {
+         plasmoid.setAction("expanding", i18n("Set flexible size"));
+         var action = plasmoid.action("expanding");
+         action.checkable = true;
+-        action.checked = Qt.binding(function() {return plasmoid.configuration.expanding});
++        action.checked = plasmoid.configuration.expanding;
+ 
+         plasmoid.removeAction("configure");
+     }
+-
+-    property real leftItemsSizeHint: 0
+-    property real rightItemsSizeHint: 0
+-    property real middleItemsSizeHint: {
+-        // Every time this binding gets reevaluated we want to queue a recomputation of the size hints
+-        Qt.callLater(root.updateHints)
+-        if (!twinSpacer || !panelLayout || !leftTwin || !rightTwin) {
+-            return 0;
+-        }
+-
+-        var leftTwinParent = leftTwin.parent;
+-        var rightTwinParent = rightTwin.parent;
+-        if (!leftTwinParent || !rightTwinParent) {
+-            return 0;
+-        }
+-        var firstSpacerFound = false;
+-        var secondSpacerFound = false;
+-        var leftItemsHint = 0;
+-        var middleItemsHint = 0;
+-        var rightItemsHint = 0;
+-
+-        // Children order is guaranteed to be the same as the visual order of items in the layout
+-        for (var i in panelLayout.children) {
+-            var child = panelLayout.children[i];
+-            if (!child.visible) {
+-                continue;
+-            } else if (child == leftTwinParent) {
+-                firstSpacerFound = true;
+-            } else if (child == rightTwinParent) {
+-                secondSpacerFound = true;
+-            } else if (secondSpacerFound) {
+-                if (root.horizontal) {
+-                    rightItemsHint += Math.min(child.Layout.maximumWidth, Math.max(child.Layout.minimumWidth, child.Layout.preferredWidth)) + panelLayout.rowSpacing;
+-                } else {
+-                    rightItemsHint += Math.min(child.Layout.maximumWidth, Math.max(child.Layout.minimumHeight, child.Layout.preferredHeight)) + panelLayout.columnSpacing;
+-                }
+-            } else if (firstSpacerFound) {
+-                if (root.horizontal) {
+-                    middleItemsHint += Math.min(child.Layout.maximumWidth, Math.max(child.Layout.minimumWidth, child.Layout.preferredWidth)) + panelLayout.rowSpacing;
+-                } else {
+-                    middleItemsHint += Math.min(child.Layout.maximumWidth, Math.max(child.Layout.minimumHeight, child.Layout.preferredHeight)) + panelLayout.columnSpacing;
+-                }
+-            } else {
+-                if (root.horizontal) {
+-                    leftItemsHint += Math.min(child.Layout.maximumWidth, Math.max(child.Layout.minimumWidth, child.Layout.preferredWidth)) + panelLayout.rowSpacing;
+-                } else {
+-                    leftItemsHint += Math.min(child.Layout.maximumHeight, Math.max(child.Layout.minimumHeight, child.Layout.preferredHeight)) + panelLayout.columnSpacing;
+-                }
+-            }
+-        }
+-
+-        rightItemsSizeHint = rightItemsHint;
+-        leftItemsSizeHint = leftItemsHint;
+-        return middleItemsHint;
+-    }
+-
+-    readonly property Item twinSpacer: plasmoid.configuration.expanding && plasmoid.nativeInterface.twinSpacer && plasmoid.nativeInterface.twinSpacer.configuration.expanding ? plasmoid.nativeInterface.twinSpacer : null
+-    readonly property Item leftTwin: {
+-        if (!twinSpacer) {
+-            return null;
+-        }
+-
+-        if (root.horizontal) {
+-            return root.Kirigami.ScenePosition.x < twinSpacer.Kirigami.ScenePosition.x ? plasmoid : twinSpacer;
+-        } else {
+-            return root.Kirigami.ScenePosition.y < twinSpacer.Kirigami.ScenePosition.y ? plasmoid : twinSpacer;
+-        }
+-    }
+-    readonly property Item rightTwin: {
+-        if (!twinSpacer) {
+-            return null;
+-        }
+-
+-        if (root.horizontal) {
+-            return root.Kirigami.ScenePosition.x >= twinSpacer.Kirigami.ScenePosition.x ? plasmoid : twinSpacer;
+-        } else {
+-            return root.Kirigami.ScenePosition.y >= twinSpacer.Kirigami.ScenePosition.y ? plasmoid : twinSpacer;
+-        }
+-    }
+-
+-    function updateHints() {
+-        if (!twinSpacer || !panelLayout || !leftTwin || !rightTwin) {
+-            root.optimalSize = root.horizontal ? plasmoid.nativeInterface.containment.width : plasmoid.nativeInterface.containment.height;
+-            return;
+-        }
+-
+-        var halfContainment = root.horizontal ?plasmoid.nativeInterface.containment.width/2 : plasmoid.nativeInterface.containment.height/2;
+-
+-        if (leftTwin == plasmoid) {
+-            root.optimalSize = Math.max(units.smallSpacing, halfContainment - middleItemsSizeHint/2 - leftItemsSizeHint)
+-        } else {
+-            root.optimalSize = Math.max(units.smallSpacing, halfContainment - middleItemsSizeHint/2 - rightItemsSizeHint)
+-        }
+-    }
+-    
+-
+-    Rectangle {
+-        anchors.fill: parent
+-        color: theme.highlightColor
+-        visible: plasmoid.nativeInterface.containment.editMode
+-    }
+ }
++
diff --git a/srcpkgs/plasma-workspace/template b/srcpkgs/plasma-workspace/template
index 15366088e54a..04d38d6ba22a 100644
--- a/srcpkgs/plasma-workspace/template
+++ b/srcpkgs/plasma-workspace/template
@@ -1,7 +1,7 @@
 # Template file for 'plasma-workspace'
 pkgname=plasma-workspace
 version=5.21.3
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF -DWaylandScanner_EXECUTABLE=/usr/bin/wayland-scanner"
 hostmakedepends="extra-cmake-modules iso-codes pkg-config kdoctools kcoreaddons
@@ -29,6 +29,12 @@ if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DKF5_HOST_TOOLING=/usr/lib/cmake"
 fi
 
+post_patch() {
+	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+		patch -Np0 < $FILESDIR/panelspacer-musl.patch
+	fi
+}
+
 kworkspace_package() {
 	short_desc="Plasma Workspace Library for KF5"
 	pkg_install() {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR REVIEW] plasma-workspace: partially revert panelspacer to old behaviour to pr…
  2021-04-03 15:43 [PR PATCH] plasma-workspace: partially revert panelspacer to old behaviour to pr… Johnnynator
@ 2021-04-03 16:15 ` ericonr
  2021-04-03 17:55 ` Johnnynator
  2021-04-03 20:23 ` [PR PATCH] [Closed]: " Johnnynator
  2 siblings, 0 replies; 4+ messages in thread
From: ericonr @ 2021-04-03 16:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29977#discussion_r606681527

Comment:
You are only applying for musl, I think it should also be applied for 32bit targets, per the comment in the patch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR REVIEW] plasma-workspace: partially revert panelspacer to old behaviour to pr…
  2021-04-03 15:43 [PR PATCH] plasma-workspace: partially revert panelspacer to old behaviour to pr… Johnnynator
  2021-04-03 16:15 ` [PR REVIEW] " ericonr
@ 2021-04-03 17:55 ` Johnnynator
  2021-04-03 20:23 ` [PR PATCH] [Closed]: " Johnnynator
  2 siblings, 0 replies; 4+ messages in thread
From: Johnnynator @ 2021-04-03 17:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

New review comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/29977#discussion_r606691827

Comment:
Yeah, and I probably should also test if this actually fixes the problem on 32bit targets. Currently trying to figure out, why the newer code breaks qml.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Closed]: plasma-workspace: partially revert panelspacer to old behaviour to pr…
  2021-04-03 15:43 [PR PATCH] plasma-workspace: partially revert panelspacer to old behaviour to pr… Johnnynator
  2021-04-03 16:15 ` [PR REVIEW] " ericonr
  2021-04-03 17:55 ` Johnnynator
@ 2021-04-03 20:23 ` Johnnynator
  2 siblings, 0 replies; 4+ messages in thread
From: Johnnynator @ 2021-04-03 20:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

There's a closed pull request on the void-packages repository

plasma-workspace: partially revert panelspacer to old behaviour to pr…
https://github.com/void-linux/void-packages/pull/29977

Description:
…event a crash on musl

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-03 20:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-03 15:43 [PR PATCH] plasma-workspace: partially revert panelspacer to old behaviour to pr… Johnnynator
2021-04-03 16:15 ` [PR REVIEW] " ericonr
2021-04-03 17:55 ` Johnnynator
2021-04-03 20:23 ` [PR PATCH] [Closed]: " Johnnynator

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).