diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-05-05 20:51:15 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-06-22 06:09:36 +0000 |
commit | 47aebe3587c7be28ed4fde23b77848657482ed66 (patch) | |
tree | 99f7dee2e21482ef6bf3c326996e144c225f3ab5 /src/plugins/platforms/xcb/qxcbwmsupport.h | |
parent | 6a28a2cc34d938417affc96d2495a7e3d2e2b869 (diff) |
xcb: account for misbehaving Unity DnD Manager
... which may cause dnd data to be lost.
As soon as Unity sees that dnd operation has started (it monitors
for changes on XdndSelection) it creates an invisible window
named XdndCollectionWindowImp that fill entire screen and starts to
act as DnD target. Once it has fetched the mime data it moves
XdndCollectionWindowImp away without sending any DnD termination
events. XdndCollectionWindowImp does not respect the XDnD protocol.
Only when its gone we can start a normal dnd operation - looking for
real DnD target. We ask windows if they are XdndAware on the initial
mouse press and subsequent mouse move events. This patch sets a cursor
to Qt::ForbiddenCursor while DnD is interfered by XdndCollectionWindowImp.
A user will see the real DnD action (reflected by cursor) only after
the next mouse move when XdndCollectionWindowImp has stopped interfering.
We also setCanDrop(false) while DnD target is XdndCollectionWindowImp.
Temporary seeing ForbiddenCursor is better than losing DnD data.
Dropping in this state means that drop will simply be ignored.
It is unclear what Unity developers expected DnD source window to do when
user releases mouse while XdndCollectionWindowImp is stealing the data.
Looking at Unity code, it appears that they were hoping to be quick
enough that it would never happen.
Task-number: QTBUG-49464
Change-Id: I10880073f6d843572be44fe9a3c4f78194466299
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwmsupport.h')
0 files changed, 0 insertions, 0 deletions