Hi,
I am trying to fix these 2 bugs to make the touch-initiated drag and drop work well on Win 8 tablet with touch screen support.
https://code.google.com/p/chromium/issues/detail?id=229322
http://code.google.com/p/chromium/issues/detail?id=229301
But I ran into a problem when facing DoDragDrop function. The DoDragDrop function is a COM API to carry out OLE drag-drop operation, see http://msdn.microsoft.com/en-us/library/windows/desktop/ms678486%28v=vs.85%29.aspx. According to its description, the DoDragDrop will enter its own loop and various method in IDropSource and IDropTarget interfaces. It works well with mouse event, but it is another thing to work with touch event.
* Problems in working with touch screen
If you try to play the drag-drop demo at http://html5demos.com/drag on a touch sensitive Win8 device with turning on “--enable-touch-drag-drop”, after a long press on a draggable element, it will become unresponsive to input event unless you unlock it with mouse click. I tried to log the calling stack and event sequence, and found that DoDragDrop is blocked (since DragSourceWin::QueryContinueQuery method doesn’t get called) , and right now the page is unresponsive. With mouse down event, DoDragDrop has a chance to run and the callback methods get running until a mouse up event happens, and meanwhile, the queued input events are fired, lots of WM_TOUCH message followed by WM_RBUTTONDOWN and WM_RBUTTONUP message (since press and hold will treated as right mouse button down event on Windows).
So the problem is, it seems the DoDragDrop cannot be driven by touch event. Consequently, all touch events are queued in system input event stream and get fired once a mouse down event feeds into the loop of DoDragDrop. As the touch events in event queue get fired one by one, the system also recognize them as mouse event on the fly according to the touch event sequence.
To fix this problem, we can programmatically send a right mouse button down event to drive DoDragDrop operation, if the finger is remove from screen, a right mouse button up event is fired and as a result, it leads to a drag-drop operation is finished. See the CL at https://codereview.chromium.org/14122008/. The patch can make http://html5demos.com/drag work as normal, but still failed to get drag-out downloading works.
* Problems in drag-out to download file
The example page is http://www.thecssninja.com/demo/gmail_dragout/ . The page will also get unresponsive if trying to drag-out the link file on touch screen. For the case of drag-out to download file, the different thing is, a drag-drop thread is created for file downloading, and so DoDragDrop is called in drag-drop thread instead the UI main thread. The approach in the above CL which programmatically sends right mouse button down event to drive DoDragDrop. But this time, DragSourceWin::QueryContinueQuery can get called, but meanwhile WebDragSourceWin::OnWaitForData get called quickly and then page become unresponsive.
Any hints for DoDragDrop usage on touch-enabled Windows? Thanks.
Hongbo
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev