Hello community,

here is the log from the commit of package kdeclarative for openSUSE:Factory 
checked in at 2017-12-23 12:15:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kdeclarative (Old)
 and      /work/SRC/openSUSE:Factory/.kdeclarative.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kdeclarative"

Sat Dec 23 12:15:33 2017 rev:49 rq:559499 version:5.40.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kdeclarative/kdeclarative.changes        
2017-11-16 14:36:55.719559153 +0100
+++ /work/SRC/openSUSE:Factory/.kdeclarative.new/kdeclarative.changes   
2017-12-23 12:15:58.077876650 +0100
@@ -1,0 +2,7 @@
+Mon Dec 18 16:55:36 UTC 2017 - [email protected]
+
+- Add MouseEventListener-Allow-accepting-mouse-event.patch to make
+  it possible to fix double context menu issue with Qt 5.10 in
+  plasma5-desktop (kde#387199)
+
+-------------------------------------------------------------------

New:
----
  MouseEventListener-Allow-accepting-mouse-event.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kdeclarative.spec ++++++
--- /var/tmp/diff_new_pack.xN7p0Q/_old  2017-12-23 12:15:58.589851687 +0100
+++ /var/tmp/diff_new_pack.xN7p0Q/_new  2017-12-23 12:15:58.589851687 +0100
@@ -36,6 +36,8 @@
 Url:            http://www.kde.org
 Source:         
http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz
 Source1:        baselibs.conf
+# PATCH-FIX-UPSTREAM
+Patch:          MouseEventListener-Allow-accepting-mouse-event.patch
 BuildRequires:  cmake >= 3.0
 BuildRequires:  extra-cmake-modules >= %{_kf5_bugfix_version}
 BuildRequires:  fdupes
@@ -122,6 +124,7 @@
 %lang_package -n %lname
 %prep
 %setup -q
+%patch -p1
 
 %build
   %cmake_kf5 -d build

++++++ MouseEventListener-Allow-accepting-mouse-event.patch ++++++
>From e2795e9472333d5e8b2ce70017ca705474ebe3d2 Mon Sep 17 00:00:00 2001
From: Kai Uwe Broulik <[email protected]>
Date: Thu, 23 Nov 2017 11:04:01 +0100
Subject: [MouseEventListener] Allow accepting mouse event

This will keep the event from propagating. Accepting a press event will also 
not result in
clicked or pressAndHold being handled.

In Qt 5.10 event propagation changed resulting in FolderView opening both the 
item context menu
and containment context menu. Imho this actually makes sense since we never 
accepted the
mouse event there.

Differential Revision: https://phabricator.kde.org/D8864
---
 .../kquickcontrolsaddons/mouseeventlistener.cpp    | 30 ++++++++++++++++++++++
 .../kquickcontrolsaddons/mouseeventlistener.h      | 13 ++++++++++
 2 files changed, 43 insertions(+)

diff --git a/src/qmlcontrols/kquickcontrolsaddons/mouseeventlistener.cpp 
b/src/qmlcontrols/kquickcontrolsaddons/mouseeventlistener.cpp
index 0b8d981..10aa2f7 100644
--- a/src/qmlcontrols/kquickcontrolsaddons/mouseeventlistener.cpp
+++ b/src/qmlcontrols/kquickcontrolsaddons/mouseeventlistener.cpp
@@ -171,6 +171,11 @@ void MouseEventListener::mousePressEvent(QMouseEvent *me)
     emit pressed(&dme);
     emit pressedChanged();
 
+    if (dme.isAccepted()) {
+        me->setAccepted(true);
+        return;
+    }
+
     
m_pressAndHoldTimer->start(QGuiApplication::styleHints()->mousePressAndHoldInterval());
 }
 
@@ -187,6 +192,10 @@ void MouseEventListener::mouseMoveEvent(QMouseEvent *me)
 
     KDeclarativeMouseEvent dme(me->pos().x(), me->pos().y(), 
me->screenPos().x(), me->screenPos().y(), me->button(), me->buttons(), 
me->modifiers(), screenForGlobalPos(me->globalPos()));
     emit positionChanged(&dme);
+
+    if (dme.isAccepted()) {
+        me->setAccepted(true);
+    }
 }
 
 void MouseEventListener::mouseReleaseEvent(QMouseEvent *me)
@@ -205,6 +214,10 @@ void MouseEventListener::mouseReleaseEvent(QMouseEvent *me)
         emit clicked(&dme);
         m_pressAndHoldTimer->stop();
     }
+
+    if (dme.isAccepted()) {
+        me->setAccepted(true);
+    }
 }
 
 void MouseEventListener::wheelEvent(QWheelEvent *we)
@@ -260,7 +273,12 @@ bool MouseEventListener::childMouseEventFilter(QQuickItem 
*item, QEvent *event)
         emit pressed(&dme);
         emit pressedChanged();
 
+        if (dme.isAccepted()) {
+            return true;
+        }
+
         
m_pressAndHoldTimer->start(QGuiApplication::styleHints()->mousePressAndHoldInterval());
+
         break;
     }
     case QEvent::HoverMove: {
@@ -280,6 +298,10 @@ bool MouseEventListener::childMouseEventFilter(QQuickItem 
*item, QEvent *event)
         KDeclarativeMouseEvent dme(myPos.x(), myPos.y(), screenPos.x(), 
screenPos.y(), Qt::NoButton, Qt::NoButton, he->modifiers(), nullptr);
         //qDebug() << "positionChanged..." << dme.x() << dme.y();
         emit positionChanged(&dme);
+
+        if (dme.isAccepted()) {
+            return true;
+        }
         break;
     }
     case QEvent::MouseMove: {
@@ -304,6 +326,10 @@ bool MouseEventListener::childMouseEventFilter(QQuickItem 
*item, QEvent *event)
             m_pressAndHoldEvent = new KDeclarativeMouseEvent(myPos.x(), 
myPos.y(), me->screenPos().x(), me->screenPos().y(), me->button(), 
me->buttons(), me->modifiers(), screenForGlobalPos(me->globalPos()));
         }
         emit positionChanged(&dme);
+
+        if (dme.isAccepted()) {
+            return true;
+        }
         break;
     }
     case QEvent::MouseButtonRelease: {
@@ -321,6 +347,10 @@ bool MouseEventListener::childMouseEventFilter(QQuickItem 
*item, QEvent *event)
             emit clicked(&dme);
             m_pressAndHoldTimer->stop();
         }
+
+        if (dme.isAccepted()) {
+            return true;
+        }
         break;
     }
     case QEvent::UngrabMouse: {
diff --git a/src/qmlcontrols/kquickcontrolsaddons/mouseeventlistener.h 
b/src/qmlcontrols/kquickcontrolsaddons/mouseeventlistener.h
index 2799fda..c34ca25 100644
--- a/src/qmlcontrols/kquickcontrolsaddons/mouseeventlistener.h
+++ b/src/qmlcontrols/kquickcontrolsaddons/mouseeventlistener.h
@@ -43,6 +43,7 @@ class KDeclarativeMouseEvent : public QObject
     Q_PROPERTY(Qt::MouseButtons buttons READ buttons)
     Q_PROPERTY(Qt::KeyboardModifiers modifiers READ modifiers)
     Q_PROPERTY(QScreen* screen READ screen CONSTANT)
+    Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted NOTIFY 
acceptedChanged)
 
 public:
     KDeclarativeMouseEvent(int x, int y, int screenX, int screenY,
@@ -69,10 +70,21 @@ public:
     Qt::KeyboardModifiers modifiers() const { return m_modifiers; }
     QScreen* screen() const { return m_screen; }
 
+    bool isAccepted() const { return m_accepted; }
+    void setAccepted(bool accepted) {
+        if (m_accepted != accepted) {
+            m_accepted = accepted;
+            emit acceptedChanged();
+        }
+    }
+
     // only for internal usage
     void setX(int x) { m_x = x; }
     void setY(int y) { m_y = y; }
 
+Q_SIGNALS:
+    void acceptedChanged();
+
 private:
     int m_x;
     int m_y;
@@ -82,6 +94,7 @@ private:
     Qt::MouseButtons m_buttons;
     Qt::KeyboardModifiers m_modifiers;
     QScreen *m_screen;
+    bool m_accepted = false;
 };
 
 class KDeclarativeWheelEvent : public QObject
-- 
cgit v0.11.2


Reply via email to