[server] Abort drag start on correct conditions and without posting error
ClosedPublic

Authored by romangg on Aug 25 2018, 9:21 AM.

Details

Summary

A drag start request should be dismissed when the client does not have an
implicit pointer grab or the currently focused pointer surface is not the
origin. The conditions for that were wrong in the past.

Also just ignore the request and not post directly an error, that potentially
kills the client since by concurrency the client might have send a valid
request, that got invalidated through grab or focus change at the same time
on the server side.

Test Plan

Manually and autotest.

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
romangg created this revision.Aug 25 2018, 9:21 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 25 2018, 9:21 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
romangg requested review of this revision.Aug 25 2018, 9:21 AM
romangg updated this revision to Diff 40406.Aug 25 2018, 10:49 AM
  • Update autotest

I updated the autotest. Note that the old autotest was broken anyway because the wrong pointer button serial was used when the drag was started and by that aborted in SeatInterface. The new test fails on testDragInternally with:

QFATAL : TestDataDevice::testDragInternally(grab and focus) ASSERT: "source" in file /home/roman/dev/kde/src/frameworks/kwayland/src/server/dataoffer_interface.cpp, line 153
FAIL!  : TestDataDevice::testDragInternally(grab and focus) Received a fatal error.

what is a different problem. A data offer should not be created when there is no data source. The old autotest did not capture this problem, since the drag was aborted on the SeatInterface.

romangg edited the test plan for this revision. (Show Details)Aug 25 2018, 11:06 AM
adridg added a subscriber: adridg.Sep 4 2018, 1:30 PM
adridg added inline comments.
src/server/datadevice_interface.cpp
103–104

this looks like it's still missing a !, based on the explanation "when the client does not have an implicit pointer grab"

romangg added inline comments.Sep 4 2018, 2:14 PM
src/server/datadevice_interface.cpp
103–104

There is a ! in the beginning. Or did you mean something else?

adridg added inline comments.Sep 4 2018, 6:02 PM
src/server/datadevice_interface.cpp
103–104

I need new glasses :)

davidedmundson accepted this revision.Sep 4 2018, 10:23 PM
This revision is now accepted and ready to land.Sep 4 2018, 10:23 PM