From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1178769-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 7CF0C1382C5
	for <garchives@archives.gentoo.org>; Wed, 10 Jun 2020 17:53:22 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 57FF0E094A;
	Wed, 10 Jun 2020 17:53:21 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 2F3D6E094A
	for <gentoo-commits@lists.gentoo.org>; Wed, 10 Jun 2020 17:53:21 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 7AB3934F248
	for <gentoo-commits@lists.gentoo.org>; Wed, 10 Jun 2020 17:53:19 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id D6037292
	for <gentoo-commits@lists.gentoo.org>; Wed, 10 Jun 2020 17:53:17 +0000 (UTC)
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" <asturm@gentoo.org>
Message-ID: <1591811550.da0505d7b983832b3d6c981a30cc8984d153a5ac.asturm@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtdeclarative/, dev-qt/qtdeclarative/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-qt/qtdeclarative/files/qtdeclarative-5.14.2-QQuickMouseArea-stuck-in-pressed-state.patch dev-qt/qtdeclarative/qtdeclarative-5.14.2-r3.ebuild
X-VCS-Directories: dev-qt/qtdeclarative/ dev-qt/qtdeclarative/files/
X-VCS-Committer: asturm
X-VCS-Committer-Name: Andreas Sturmlechner
X-VCS-Revision: da0505d7b983832b3d6c981a30cc8984d153a5ac
X-VCS-Branch: master
Date: Wed, 10 Jun 2020 17:53:17 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: c8255bd0-33ad-41c6-afe8-e70b5747e8a4
X-Archives-Hash: 299a3baadefb3d4e2398355f3e09e755

commit:     da0505d7b983832b3d6c981a30cc8984d153a5ac
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  9 19:44:56 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Jun 10 17:52:30 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da0505d7

dev-qt/qtdeclarative: Fix QQuickMouseArea get stuck in pressed state

Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ....2-QQuickMouseArea-stuck-in-pressed-state.patch | 55 ++++++++++++++++++++
 .../qtdeclarative/qtdeclarative-5.14.2-r3.ebuild   | 59 ++++++++++++++++++++++
 2 files changed, 114 insertions(+)

diff --git a/dev-qt/qtdeclarative/files/qtdeclarative-5.14.2-QQuickMouseArea-stuck-in-pressed-state.patch b/dev-qt/qtdeclarative/files/qtdeclarative-5.14.2-QQuickMouseArea-stuck-in-pressed-state.patch
new file mode 100644
index 00000000000..1dd0ff1155d
--- /dev/null
+++ b/dev-qt/qtdeclarative/files/qtdeclarative-5.14.2-QQuickMouseArea-stuck-in-pressed-state.patch
@@ -0,0 +1,55 @@
+From 8ace780b5aa298e3c01903bfd57f766a42209191 Mon Sep 17 00:00:00 2001
+From: Frederik Gladhorn <frederik.gladhorn@remarkable.com>
+Date: Sat, 28 Mar 2020 15:14:41 +0100
+Subject: [PATCH] Fix QQuickMouseArea getting stuck in pressed state when
+ hiding in press
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+In 78c1fcbc49f56463064eef738a475d9018357b24 we stopped giving the
+exclusive grab to hidden or disabled items with is good. But the change
+did not take into consideration how mouse area handles its internal
+state.
+
+As a simple example: A mouse area that would set itself hiddin in the
+press handler, would continue to have d->pressed == true, which means it
+would not react to any future press events.
+
+The fix is to let mouse area check in its change handler whether it has
+become invisible.
+The test also checks that enabled behaves the same way. There is no
+action needed, since mouse area does completely custom handling of
+enabled (maybe something to fix in Qt 6), disabling a mouse area doesn't
+disable its children for example, it doesn't invoke
+QQuickItem::setEnabled at all. Due to this circumventing the common
+behavior, by chance disabling a mouse area in the on pressed handler
+works.
+
+Fixes: QTBUG-74987
+Change-Id: Idb8499b3e5bcb744fbba203fdea5c46695bd5077
+Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
+---
+ src/quick/items/qquickmousearea.cpp                |  6 ++++
+ 3 files changed, 80 insertions(+)
+ create mode 100644 tests/auto/quick/qquickmousearea/data/settingHiddenInPressUngrabs.qml
+
+diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
+index 368379f5c40..dc60712a9cd 100644
+--- a/src/quick/items/qquickmousearea.cpp
++++ b/src/quick/items/qquickmousearea.cpp
+@@ -1083,6 +1083,12 @@ void QQuickMouseArea::itemChange(ItemChange change, const ItemChangeData &value)
+             }
+             setHovered(!d->hovered);
+         }
++        if (d->pressed && (!isVisible())) {
++            // This happens when the mouse area sets itself disabled or hidden
++            // inside the press handler. In that case we should not keep the internal
++            // state as pressed, since we never became the mouse grabber.
++            ungrabMouse();
++        }
+         break;
+     default:
+         break;
+-- 
+2.16.3

diff --git a/dev-qt/qtdeclarative/qtdeclarative-5.14.2-r3.ebuild b/dev-qt/qtdeclarative/qtdeclarative-5.14.2-r3.ebuild
new file mode 100644
index 00000000000..71250b4c877
--- /dev/null
+++ b/dev-qt/qtdeclarative/qtdeclarative-5.14.2-r3.ebuild
@@ -0,0 +1,59 @@
+# Copyright 2009-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{6,7,8} )
+inherit python-any-r1 qt5-build
+
+DESCRIPTION="The QML and Quick modules for the Qt5 framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+IUSE="gles2-only +jit localstorage vulkan +widgets"
+
+BDEPEND="${PYTHON_DEPS}"
+# qtgui[gles2-only=] is needed because of bug 504322
+DEPEND="
+	~dev-qt/qtcore-${PV}
+	~dev-qt/qtgui-${PV}[gles2-only=,vulkan=]
+	~dev-qt/qtnetwork-${PV}
+	~dev-qt/qttest-${PV}
+	localstorage? ( ~dev-qt/qtsql-${PV} )
+	widgets? ( ~dev-qt/qtwidgets-${PV}[gles2-only=] )
+"
+RDEPEND="${DEPEND}
+	!<dev-qt/qtquickcontrols-5.7:5
+"
+
+PATCHES=(
+	"${FILESDIR}/${P}-QQuickItemView-fix-maxXY-extent.patch" # QTBUG-83890
+	"${FILESDIR}/${P}-fix-subpixel-positioned-text.patch" # QTBUG-49646
+	"${FILESDIR}/${P}-QQuickMouseArea-stuck-in-pressed-state.patch" # QTBUG-74987
+)
+
+src_prepare() {
+	use jit || PATCHES+=("${FILESDIR}/${PN}-5.4.2-disable-jit.patch")
+
+	qt_use_disable_mod localstorage sql \
+		src/imports/imports.pro
+
+	qt_use_disable_mod widgets widgets \
+		src/src.pro \
+		src/qmltest/qmltest.pro \
+		tests/auto/auto.pro \
+		tools/tools.pro \
+		tools/qmlscene/qmlscene.pro \
+		tools/qml/qml.pro
+
+	qt5-build_src_prepare
+}
+
+src_configure() {
+	local myqmakeargs=(
+		--
+		-qml-debug
+	)
+	qt5-build_src_configure
+}