Hello community, here is the log from the commit of package kwayland for openSUSE:Factory checked in at 2019-03-21 09:48:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kwayland (Old) and /work/SRC/openSUSE:Factory/.kwayland.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kwayland" Thu Mar 21 09:48:43 2019 rev:60 rq:686771 version:5.56.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kwayland/kwayland.changes 2019-02-28 21:32:27.801752285 +0100 +++ /work/SRC/openSUSE:Factory/.kwayland.new.28833/kwayland.changes 2019-03-21 09:48:43.326863136 +0100 @@ -1,0 +2,16 @@ +Sun Mar 10 20:15:37 UTC 2019 - lbeltr...@kde.org + +- Update to 5.56.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.56.0.php +- Changes since 5.55.0: + * Only commit XdgOutput::done if changed + * FakeInput: add support for pointer move with absolute coordinates + * Add explicit SurfaceInterface::commited signal + * Add missing XdgShellPopup::ackConfigure + * Update copy paste error in XdgShellPopupStable member vars + * [server] Add surface data proxy mechanism + * [server] Add selectionChanged signal + +------------------------------------------------------------------- Old: ---- kwayland-5.55.0.tar.xz New: ---- kwayland-5.56.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kwayland.spec ++++++ --- /var/tmp/diff_new_pack.VxrKcT/_old 2019-03-21 09:48:44.750862751 +0100 +++ /var/tmp/diff_new_pack.VxrKcT/_new 2019-03-21 09:48:44.778862743 +0100 @@ -16,13 +16,13 @@ # -%define _tar_path 5.55 +%define _tar_path 5.56 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} Name: kwayland -Version: 5.55.0 +Version: 5.56.0 Release: 0 Summary: KDE Wayland library License: LGPL-2.1-or-later ++++++ kwayland-5.55.0.tar.xz -> kwayland-5.56.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/CMakeLists.txt new/kwayland-5.56.0/CMakeLists.txt --- old/kwayland-5.55.0/CMakeLists.txt 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/CMakeLists.txt 2019-03-02 14:30:05.000000000 +0100 @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.5) -set(KF5_VERSION "5.55.0") # handled by release scripts +set(KF5_VERSION "5.56.0") # handled by release scripts project(KWayland VERSION ${KF5_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 5.55.0 NO_MODULE) +find_package(ECM 5.56.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/autotests/client/test_fake_input.cpp new/kwayland-5.56.0/autotests/client/test_fake_input.cpp --- old/kwayland-5.55.0/autotests/client/test_fake_input.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/autotests/client/test_fake_input.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -44,6 +44,7 @@ void testAuthenticate(); void testMotion(); + void testMotionAbsolute(); void testPointerButtonQt_data(); void testPointerButtonQt(); void testPointerButtonLinux_data(); @@ -179,6 +180,31 @@ QCOMPARE(motionSpy.last().first().toSizeF(), QSizeF(0, 0)); } +void FakeInputTest::testMotionAbsolute() +{ + // this test verifies that motion is properly passed to the server + QVERIFY(!m_device->isAuthenticated()); + QSignalSpy motionSpy(m_device, &FakeInputDevice::pointerMotionAbsoluteRequested); + QVERIFY(motionSpy.isValid()); + + // without an authentication we shouldn't get the signals + m_fakeInput->requestPointerMoveAbsolute(QPointF(1, 2)); + QVERIFY(!motionSpy.wait(100)); + + // now let's authenticate the interface + m_device->setAuthentication(true); + m_fakeInput->requestPointerMoveAbsolute(QPointF(1, 2)); + QVERIFY(motionSpy.wait()); + QCOMPARE(motionSpy.count(), 1); + QCOMPARE(motionSpy.last().first().toPointF(), QPointF(1, 2)); + + // just for the fun: once more + m_fakeInput->requestPointerMoveAbsolute(QPointF(0, 0)); + QVERIFY(motionSpy.wait()); + QCOMPARE(motionSpy.count(), 2); + QCOMPARE(motionSpy.last().first().toPointF(), QPointF(0, 0)); +} + void FakeInputTest::testPointerButtonQt_data() { QTest::addColumn<Qt::MouseButton>("qtButton"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/autotests/client/test_wayland_surface.cpp new/kwayland-5.56.0/autotests/client/test_wayland_surface.cpp --- old/kwayland-5.55.0/autotests/client/test_wayland_surface.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/autotests/client/test_wayland_surface.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -271,6 +271,7 @@ QVERIFY(serverSurface->parentResource()); QVERIFY(!serverSurface->isMapped()); + QSignalSpy committedSpy(serverSurface, SIGNAL(committed())); QSignalSpy damageSpy(serverSurface, SIGNAL(damaged(QRegion))); QVERIFY(damageSpy.isValid()); @@ -282,6 +283,7 @@ QCoreApplication::processEvents(); QVERIFY(damageSpy.isEmpty()); QVERIFY(!serverSurface->isMapped()); + QCOMPARE(committedSpy.count(), 1); QImage img(QSize(10, 10), QImage::Format_ARGB32_Premultiplied); img.fill(Qt::black); @@ -293,6 +295,7 @@ QCOMPARE(serverSurface->damage(), QRegion(0, 0, 10, 10)); QCOMPARE(damageSpy.first().first().value<QRegion>(), QRegion(0, 0, 10, 10)); QVERIFY(serverSurface->isMapped()); + QCOMPARE(committedSpy.count(), 2); // damage multiple times QRegion testRegion(5, 8, 3, 6); @@ -308,6 +311,7 @@ QCOMPARE(serverSurface->damage(), testRegion); QCOMPARE(damageSpy.first().first().value<QRegion>(), testRegion); QVERIFY(serverSurface->isMapped()); + QCOMPARE(committedSpy.count(), 3); } void TestWaylandSurface::testFrameCallback() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/client/fakeinput.cpp new/kwayland-5.56.0/src/client/fakeinput.cpp --- old/kwayland-5.55.0/src/client/fakeinput.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/client/fakeinput.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -100,6 +100,16 @@ org_kde_kwin_fake_input_pointer_motion(d->manager, wl_fixed_from_double(delta.width()), wl_fixed_from_double(delta.height())); } +void FakeInput::requestPointerMoveAbsolute(const QPointF &pos) +{ + Q_ASSERT(d->manager.isValid()); + if (wl_proxy_get_version(d->manager) < ORG_KDE_KWIN_FAKE_INPUT_POINTER_MOTION_ABSOLUTE_SINCE_VERSION) { + return; + } + + org_kde_kwin_fake_input_pointer_motion_absolute(d->manager, wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); +} + void FakeInput::Private::sendPointerButtonState(Qt::MouseButton button, quint32 state) { #if HAVE_LINUX_INPUT_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/client/fakeinput.h new/kwayland-5.56.0/src/client/fakeinput.h --- old/kwayland-5.55.0/src/client/fakeinput.h 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/client/fakeinput.h 2019-03-02 14:30:05.000000000 +0100 @@ -134,6 +134,12 @@ **/ void requestPointerMove(const QSizeF &delta); /** + * Request an absolute pointer motion to @p pos position. + * + * @since 5.54 + **/ + void requestPointerMoveAbsolute(const QPointF &pos); + /** * Convenience overload. * @see requestPointerButtonPress(quint32) **/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/client/protocols/fake-input.xml new/kwayland-5.56.0/src/client/protocols/fake-input.xml --- old/kwayland-5.55.0/src/client/protocols/fake-input.xml 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/client/protocols/fake-input.xml 2019-03-02 14:30:05.000000000 +0100 @@ -16,7 +16,7 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ]]></copyright> - <interface name="org_kde_kwin_fake_input" version="2"> + <interface name="org_kde_kwin_fake_input" version="3"> <description summary="Fake input manager"> This interface allows other processes to provide fake input events. Purpose is on the one hand side to provide testing facilities like XTest on X11. @@ -83,5 +83,9 @@ A client should use this request to send touch frame event. </description> </request> + <request name="pointer_motion_absolute" since="3"> + <arg name="x" type="fixed"/> + <arg name="y" type="fixed"/> + </request> </interface> </protocol> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/client/registry.cpp new/kwayland-5.56.0/src/client/registry.cpp --- old/kwayland-5.55.0/src/client/registry.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/client/registry.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -204,7 +204,7 @@ &Registry::remoteAccessManagerRemoved }}, {Registry::Interface::FakeInput, { - 2, + 3, QByteArrayLiteral("org_kde_kwin_fake_input"), &org_kde_kwin_fake_input_interface, &Registry::fakeInputAnnounced, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/client/xdgshell.cpp new/kwayland-5.56.0/src/client/xdgshell.cpp --- old/kwayland-5.55.0/src/client/xdgshell.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/client/xdgshell.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -360,6 +360,11 @@ d->requestGrab(seat, serial); } +void XdgShellPopup::ackConfigure(quint32 serial) +{ + d->ackConfigure(serial); +} + XdgShellPopup::operator xdg_surface*() { return *(d.data()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/client/xdgshell.h new/kwayland-5.56.0/src/client/xdgshell.h --- old/kwayland-5.55.0/src/client/xdgshell.h 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/client/xdgshell.h 2019-03-02 14:30:05.000000000 +0100 @@ -586,6 +586,16 @@ */ void requestGrab(Seat *seat, quint32 serial); + /** + * When a configure event is received, if a client commits the + * Surface in response to the configure event, then the client + * must make an ackConfigure request sometime before the commit + * request, passing along the @p serial of the configure event. + * @see configureRequested + * @since 5.56 + **/ + void ackConfigure(quint32 serial); + operator xdg_surface*(); operator xdg_surface*() const; operator xdg_popup*(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/client/xdgshell_p.h new/kwayland-5.56.0/src/client/xdgshell_p.h --- old/kwayland-5.55.0/src/client/xdgshell_p.h 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/client/xdgshell_p.h 2019-03-02 14:30:05.000000000 +0100 @@ -268,6 +268,10 @@ Q_UNUSED(seat); Q_UNUSED(serial); }; + virtual void ackConfigure(quint32 serial) { + Q_UNUSED(serial); + } + virtual operator xdg_surface*() { return nullptr; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/client/xdgshell_stable.cpp new/kwayland-5.56.0/src/client/xdgshell_stable.cpp --- old/kwayland-5.55.0/src/client/xdgshell_stable.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/client/xdgshell_stable.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -498,23 +498,24 @@ void destroy() override; bool isValid() const override; void requestGrab(Seat *seat, quint32 serial) override; + void ackConfigure(quint32 serial) override; using XdgShellPopup::Private::operator zxdg_popup_v6*; using XdgShellPopup::Private::operator zxdg_surface_v6*; operator xdg_surface*() override { - return xdgsurfacev6; + return xdgsurface; } operator xdg_surface*() const override { - return xdgsurfacev6; + return xdgsurface; } operator xdg_popup*() override { - return xdgpopupv6; + return xdgpopup; } operator xdg_popup*() const override { - return xdgpopupv6; + return xdgpopup; } - WaylandPointer<xdg_surface, xdg_surface_destroy> xdgsurfacev6; - WaylandPointer<xdg_popup, xdg_popup_destroy> xdgpopupv6; + WaylandPointer<xdg_surface, xdg_surface_destroy> xdgsurface; + WaylandPointer<xdg_popup, xdg_popup_destroy> xdgpopup; QRect pendingRect; @@ -554,7 +555,7 @@ void XdgShellPopupStable::Private::popupDoneCallback(void *data, xdg_popup *xdg_popup) { auto s = static_cast<XdgShellPopupStable::Private*>(data); - Q_ASSERT(s->xdgpopupv6 == xdg_popup); + Q_ASSERT(s->xdgpopup == xdg_popup); emit s->q->popupDone(); } @@ -566,35 +567,39 @@ void XdgShellPopupStable::Private::setup(xdg_surface *s, xdg_popup *p) { Q_ASSERT(p); - Q_ASSERT(!xdgsurfacev6); - Q_ASSERT(!xdgpopupv6); + Q_ASSERT(!xdgsurface); + Q_ASSERT(!xdgpopup); - xdgsurfacev6.setup(s); - xdgpopupv6.setup(p); - xdg_surface_add_listener(xdgsurfacev6, &s_surfaceListener, this); - xdg_popup_add_listener(xdgpopupv6, &s_popupListener, this); + xdgsurface.setup(s); + xdgpopup.setup(p); + xdg_surface_add_listener(xdgsurface, &s_surfaceListener, this); + xdg_popup_add_listener(xdgpopup, &s_popupListener, this); } void XdgShellPopupStable::Private::release() { - xdgpopupv6.release(); + xdgpopup.release(); } void XdgShellPopupStable::Private::destroy() { - xdgpopupv6.destroy(); + xdgpopup.destroy(); } bool XdgShellPopupStable::Private::isValid() const { - return xdgpopupv6.isValid(); + return xdgpopup.isValid(); } void XdgShellPopupStable::Private::requestGrab(Seat *seat, quint32 serial) { - xdg_popup_grab(xdgpopupv6, *seat, serial); + xdg_popup_grab(xdgpopup, *seat, serial); } +void XdgShellPopupStable::Private::ackConfigure(quint32 serial) +{ + xdg_surface_ack_configure(xdgsurface, serial); +} XdgShellPopupStable::XdgShellPopupStable(QObject *parent) : XdgShellPopup(new Private(this), parent) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/client/xdgshell_v6.cpp new/kwayland-5.56.0/src/client/xdgshell_v6.cpp --- old/kwayland-5.55.0/src/client/xdgshell_v6.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/client/xdgshell_v6.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -483,6 +483,7 @@ void destroy() override; bool isValid() const override; void requestGrab(Seat *seat, quint32 serial) override; + void ackConfigure(quint32 serial) override; using XdgShellPopup::Private::operator xdg_popup*; using XdgShellPopup::Private::operator xdg_surface*; @@ -580,6 +581,10 @@ zxdg_popup_v6_grab(xdgpopupv6, *seat, serial); } +void XdgShellPopupUnstableV6::Private::ackConfigure(quint32 serial) +{ + zxdg_surface_v6_ack_configure(xdgsurfacev6, serial); +} XdgShellPopupUnstableV6::XdgShellPopupUnstableV6(QObject *parent) : XdgShellPopup(new Private(this), parent) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/datadevice_interface.cpp new/kwayland-5.56.0/src/server/datadevice_interface.cpp --- old/kwayland-5.55.0/src/server/datadevice_interface.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/datadevice_interface.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -61,6 +61,8 @@ }; Drag drag; + SurfaceInterface *proxyRemoteSurface = nullptr; + private: DataDeviceInterface *q_func() { return reinterpret_cast<DataDeviceInterface*>(q); @@ -99,10 +101,15 @@ void DataDeviceInterface::Private::startDrag(DataSourceInterface *dataSource, SurfaceInterface *origin, SurfaceInterface *i, quint32 serial) { - const bool pointerGrab = seat->hasImplicitPointerGrab(serial) && seat->focusedPointerSurface() == origin; + SurfaceInterface *focusSurface = origin; + if (proxyRemoteSurface) { + // origin is a proxy surface + focusSurface = proxyRemoteSurface; + } + const bool pointerGrab = seat->hasImplicitPointerGrab(serial) && seat->focusedPointerSurface() == focusSurface; if (!pointerGrab) { // Client doesn't have pointer grab. - const bool touchGrab = seat->hasImplicitTouchGrab(serial) && seat->focusedTouchSurface() == origin; + const bool touchGrab = seat->hasImplicitTouchGrab(serial) && seat->focusedTouchSurface() == focusSurface; if (!touchGrab) { // Client neither has pointer nor touch grab. No drag start allowed. return; @@ -209,7 +216,7 @@ SurfaceInterface *DataDeviceInterface::origin() const { Q_D(); - return d->surface; + return d->proxyRemoteSurface ? d->proxyRemoteSurface : d->surface; } DataSourceInterface *DataDeviceInterface::selection() const @@ -292,6 +299,11 @@ } return; } + if (d->proxyRemoteSurface && d->proxyRemoteSurface == surface) { + // A proxy can not have the remote surface as target. + // TODO: do this for all client's surfaces? + return; + } auto *source = d->seat->dragSource()->dragSource(); DataOfferInterface *offer = d->createDataOffer(source); d->drag.surface = surface; @@ -371,6 +383,13 @@ return d->drag.serial; } +void DataDeviceInterface::updateProxy(SurfaceInterface *remote) +{ + Q_D(); + // TODO: connect destroy signal? + d->proxyRemoteSurface = remote; +} + DataDeviceInterface::Private *DataDeviceInterface::d_func() const { return reinterpret_cast<DataDeviceInterface::Private*>(d.data()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/datadevice_interface.h new/kwayland-5.56.0/src/server/datadevice_interface.h --- old/kwayland-5.55.0/src/server/datadevice_interface.h 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/datadevice_interface.h 2019-03-02 14:30:05.000000000 +0100 @@ -82,6 +82,11 @@ * @since 5.6 **/ void updateDragTarget(SurfaceInterface *surface, quint32 serial); + /** + * Mark this DataDeviceInterface as being a proxy device for @p remote. + * @since 5.56 + **/ + void updateProxy(SurfaceInterface *remote); Q_SIGNALS: void dragStarted(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/fakeinput_interface.cpp new/kwayland-5.56.0/src/server/fakeinput_interface.cpp --- old/kwayland-5.55.0/src/server/fakeinput_interface.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/fakeinput_interface.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -42,6 +42,7 @@ void bind(wl_client *client, uint32_t version, uint32_t id) override; static void authenticateCallback(wl_client *client, wl_resource *resource, const char *application, const char *reason); static void pointerMotionCallback(wl_client *client, wl_resource *resource, wl_fixed_t delta_x, wl_fixed_t delta_y); + static void pointerMotionAbsoluteCallback(wl_client *client, wl_resource *resource, wl_fixed_t x, wl_fixed_t y); static void buttonCallback(wl_client *client, wl_resource *resource, uint32_t button, uint32_t state); static void axisCallback(wl_client *client, wl_resource *resource, uint32_t axis, wl_fixed_t value); static void touchDownCallback(wl_client *client, wl_resource *resource, quint32 id, wl_fixed_t x, wl_fixed_t y); @@ -74,7 +75,7 @@ FakeInputDevice *q; }; -const quint32 FakeInputInterface::Private::s_version = 2; +const quint32 FakeInputInterface::Private::s_version = 3; QList<quint32> FakeInputInterface::Private::touchIds = QList<quint32>(); #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -87,7 +88,8 @@ touchMotionCallback, touchUpCallback, touchCancelCallback, - touchFrameCallback + touchFrameCallback, + pointerMotionAbsoluteCallback }; #endif @@ -149,6 +151,16 @@ emit d->pointerMotionRequested(QSizeF(wl_fixed_to_double(delta_x), wl_fixed_to_double(delta_y))); } +void FakeInputInterface::Private::pointerMotionAbsoluteCallback(wl_client *client, wl_resource *resource, wl_fixed_t x, wl_fixed_t y) +{ + Q_UNUSED(client) + FakeInputDevice *d = device(resource); + if (!d || !d->isAuthenticated()) { + return; + } + emit d->pointerMotionAbsoluteRequested(QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); +} + void FakeInputInterface::Private::axisCallback(wl_client *client, wl_resource *resource, uint32_t axis, wl_fixed_t value) { Q_UNUSED(client) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/fakeinput_interface.h new/kwayland-5.56.0/src/server/fakeinput_interface.h --- old/kwayland-5.55.0/src/server/fakeinput_interface.h 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/fakeinput_interface.h 2019-03-02 14:30:05.000000000 +0100 @@ -114,6 +114,12 @@ **/ void pointerMotionRequested(const QSizeF &delta); /** + * Request an absolute pointer motion to @p pos. + * + * @since 5.54 + **/ + void pointerMotionAbsoluteRequested(const QPointF &pos); + /** * Requests a pointer button pressed for @p button. **/ void pointerButtonPressRequested(quint32 button); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/pointer_interface.cpp new/kwayland-5.56.0/src/server/pointer_interface.cpp --- old/kwayland-5.55.0/src/server/pointer_interface.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/pointer_interface.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -27,6 +27,7 @@ #include "display.h" #include "subcompositor_interface.h" #include "surface_interface.h" +#include "datadevice_interface.h" // Wayland #include <wayland-server.h> @@ -232,32 +233,37 @@ // TODO: handle touch connect(parent, &SeatInterface::pointerPosChanged, this, [this] { Q_D(); - if (d->seat->isDragPointer()) { - // handled by DataDevice + if (!d->focusedSurface || !d->resource) { return; } - if (d->focusedSurface && d->resource) { - if (!d->focusedSurface->lockedPointer().isNull() && d->focusedSurface->lockedPointer()->isLocked()) { + if (d->seat->isDragPointer()) { + const auto *originSurface = d->seat->dragSource()->origin(); + const bool proxyRemoteFocused = originSurface->dataProxy() && originSurface == d->focusedSurface; + if (!proxyRemoteFocused) { + // handled by DataDevice return; } - const QPointF pos = d->seat->focusedPointerSurfaceTransformation().map(d->seat->pointerPos()); - auto targetSurface = d->focusedSurface->inputSurfaceAt(pos); - if (!targetSurface) { - targetSurface = d->focusedSurface; - } - if (targetSurface != d->focusedChildSurface.data()) { - const quint32 serial = d->seat->display()->nextSerial(); - d->sendLeave(d->focusedChildSurface.data(), serial); - d->focusedChildSurface = QPointer<SurfaceInterface>(targetSurface); - d->sendEnter(targetSurface, pos, serial); - d->sendFrame(); - d->client->flush(); - } else { - const QPointF adjustedPos = pos - surfacePosition(d->focusedChildSurface); - wl_pointer_send_motion(d->resource, d->seat->timestamp(), - wl_fixed_from_double(adjustedPos.x()), wl_fixed_from_double(adjustedPos.y())); - d->sendFrame(); - } + } + if (!d->focusedSurface->lockedPointer().isNull() && d->focusedSurface->lockedPointer()->isLocked()) { + return; + } + const QPointF pos = d->seat->focusedPointerSurfaceTransformation().map(d->seat->pointerPos()); + auto targetSurface = d->focusedSurface->inputSurfaceAt(pos); + if (!targetSurface) { + targetSurface = d->focusedSurface; + } + if (targetSurface != d->focusedChildSurface.data()) { + const quint32 serial = d->seat->display()->nextSerial(); + d->sendLeave(d->focusedChildSurface.data(), serial); + d->focusedChildSurface = QPointer<SurfaceInterface>(targetSurface); + d->sendEnter(targetSurface, pos, serial); + d->sendFrame(); + d->client->flush(); + } else { + const QPointF adjustedPos = pos - surfacePosition(d->focusedChildSurface); + wl_pointer_send_motion(d->resource, d->seat->timestamp(), + wl_fixed_from_double(adjustedPos.x()), wl_fixed_from_double(adjustedPos.y())); + d->sendFrame(); } }); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/seat_interface.cpp new/kwayland-5.56.0/src/server/seat_interface.cpp --- old/kwayland-5.55.0/src/server/seat_interface.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/seat_interface.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -273,6 +273,7 @@ if (currentSelection == dataDevice) { // current selection is cleared currentSelection = nullptr; + emit q->selectionChanged(nullptr); if (keys.focus.selection) { keys.focus.selection->sendClearSelection(); } @@ -306,9 +307,17 @@ // no implicit grab, abort drag return; } + auto *originSurface = dataDevice->origin(); + const bool proxied = originSurface->dataProxy(); + if (!proxied) { + // origin surface + drag.target = dataDevice; + drag.surface = originSurface; + // TODO: transformation needs to be either pointer or touch + drag.transformation = globalPointer.focus.transformation; + } drag.source = dataDevice; - drag.target = dataDevice; - drag.surface = dragSurface; + drag.sourcePointer = interfaceForSurface(originSurface, pointers); drag.destroyConnection = QObject::connect(dataDevice, &QObject::destroyed, q, [this] { endDrag(display->nextSerial()); @@ -328,7 +337,7 @@ } else { drag.dragSourceDestroyConnection = QMetaObject::Connection(); } - dataDevice->updateDragTarget(dataDevice->origin(), dataDevice->dragImplicitGrabSerial()); + dataDevice->updateDragTarget(proxied ? nullptr : originSurface, dataDevice->dragImplicitGrabSerial()); emit q->dragStarted(); emit q->dragSurfaceChanged(); } @@ -405,6 +414,7 @@ void SeatInterface::Private::updateSelection(DataDeviceInterface *dataDevice, bool set) { + bool selChanged = currentSelection != dataDevice; if (keys.focus.surface && (keys.focus.surface->client() == dataDevice->client())) { // cancel the previous selection cancelPreviousSelection(dataDevice); @@ -419,9 +429,13 @@ } else { keys.focus.selection->sendClearSelection(); currentSelection = nullptr; + selChanged = true; } } } + if (selChanged) { + emit q->selectionChanged(currentSelection); + } } void SeatInterface::setHasKeyboard(bool has) @@ -865,11 +879,11 @@ // ignore return; } - if (d->globalPointer.focus.surface) { + if (auto *focusSurface = d->globalPointer.focus.surface) { for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { (*it)->buttonPressed(button, serial); } - if (d->globalPointer.focus.surface == d->keys.focus.surface) { + if (focusSurface == d->keys.focus.surface) { // update the focused child surface auto p = focusedPointer(); if (p) { @@ -1580,6 +1594,7 @@ d->keys.focus.selection->sendClearSelection(); } } + emit selectionChanged(dataDevice); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/seat_interface.h new/kwayland-5.56.0/src/server/seat_interface.h --- old/kwayland-5.55.0/src/server/seat_interface.h 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/seat_interface.h 2019-03-02 14:30:05.000000000 +0100 @@ -644,6 +644,7 @@ /** * @returns The DataDeviceInterface holding the current clipboard selection. * @since 5.24 + * @see selectionChanged * @see setSelection **/ DataDeviceInterface *selection() const; @@ -657,6 +658,7 @@ * * @param dataDevice Sets the current clipboard selection. * @see selection + * @see selectionChanged * @since 5.24 **/ void setSelection(DataDeviceInterface *dataDevice); @@ -683,6 +685,14 @@ void focusedPointerChanged(KWayland::Server::PointerInterface*); /** + * Emitted whenever the selection changes + * @since 5.56 + * @see selection + * @see setSelection + **/ + void selectionChanged(DataDeviceInterface*); + + /** * Emitted when a drag'n'drop operation is started * @since 5.6 * @see dragEnded diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/surface_interface.cpp new/kwayland-5.56.0/src/server/surface_interface.cpp --- old/kwayland-5.55.0/src/server/surface_interface.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/surface_interface.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -487,6 +487,7 @@ void SurfaceInterface::Private::commit() { + Q_Q(SurfaceInterface); if (!subSurface.isNull() && subSurface->isSynchronized()) { swapStates(&pending, &subSurfacePending, false); } else { @@ -504,6 +505,7 @@ subSurface->d_func()->commit(); } } + emit q->committed(); } void SurfaceInterface::Private::commitSubSurface() @@ -903,6 +905,18 @@ return !d->idleInhibitors.isEmpty(); } +void SurfaceInterface::setDataProxy(SurfaceInterface *surface) +{ + Q_D(); + d->dataProxy = surface; +} + +SurfaceInterface* SurfaceInterface::dataProxy() const +{ + Q_D(); + return d->dataProxy; +} + SurfaceInterface::Private *SurfaceInterface::d_func() const { return reinterpret_cast<Private*>(d.data()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/surface_interface.h new/kwayland-5.56.0/src/server/surface_interface.h --- old/kwayland-5.55.0/src/server/surface_interface.h 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/surface_interface.h 2019-03-02 14:30:05.000000000 +0100 @@ -275,6 +275,22 @@ **/ static SurfaceInterface *get(quint32 id, const ClientConnection *client); + /** + * Set @p surface as a data proxy for this SurfaceInterface. This enables + * the proxy to conduct drags on the surface's client behalf. + * + * Setting a data proxy is only allowed when the client owning this surface + * has not created a data device itself. + * @since 5.56 + **/ + void setDataProxy(SurfaceInterface *surface); + /** + * Returns the data proxy of this SurfaceInterface or null if there + * is none set. + * @since 5.56 + **/ + SurfaceInterface* dataProxy() const; + Q_SIGNALS: /** * Emitted whenever the SurfaceInterface got damaged. @@ -338,6 +354,15 @@ **/ void inhibitsIdleChanged(); + /** + * Emitted when the Surface has been committed. + * + * This signal is emitted after all the relevant damage and xyzChanged signals + * for this commit are emitted. + * @since 5.54 + **/ + void committed(); + private: friend class CompositorInterface; friend class SubSurfaceInterface; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/surface_interface_p.h new/kwayland-5.56.0/src/server/surface_interface_p.h --- old/kwayland-5.55.0/src/server/surface_interface_p.h 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/surface_interface_p.h 2019-03-02 14:30:05.000000000 +0100 @@ -103,6 +103,8 @@ QHash<OutputInterface*, QMetaObject::Connection> outputDestroyedConnections; QVector<IdleInhibitorInterface*> idleInhibitors; + SurfaceInterface *dataProxy = nullptr; + private: QMetaObject::Connection constrainsOneShotConnection; QMetaObject::Connection constrainsUnboundConnection; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kwayland-5.55.0/src/server/xdgoutput_interface.cpp new/kwayland-5.56.0/src/server/xdgoutput_interface.cpp --- old/kwayland-5.55.0/src/server/xdgoutput_interface.cpp 2019-02-02 18:24:11.000000000 +0100 +++ new/kwayland-5.56.0/src/server/xdgoutput_interface.cpp 2019-03-02 14:30:05.000000000 +0100 @@ -80,6 +80,7 @@ void resourceDisconnected(XdgOutputV1Interface *resource); QPoint pos; QSize size; + bool dirty = false; bool doneOnce = false; QList<XdgOutputV1Interface*> resources; }; @@ -187,6 +188,7 @@ return; } d->size = size; + d->dirty = true; for(auto resource: d->resources) { resource->setLogicalSize(size); } @@ -203,6 +205,7 @@ return; } d->pos = pos; + d->dirty = true; for(auto resource: d->resources) { resource->setLogicalPosition(pos); } @@ -216,6 +219,10 @@ void XdgOutputInterface::done() { d->doneOnce = true; + if (!d->dirty) { + return; + } + d->dirty = false; for(auto resource: d->resources) { resource->done(); }