cursor during drag and drop with osr, on mac

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

cursor during drag and drop with osr, on mac

Postby sdiverdi » Fri Jan 21, 2022 12:40 am

I have a mac CEF app that uses off screen rendering and I'm working on drag and drop functionality. I'm heavily borrowing code cefclient, and mostly things are good. However I've noticed a behavior difference between cefclient with and without OSR turned on. Attached below are two screencaps that show the same drag and drop action on this codepen, where I click the "Triumph" div and drag it to the "Your Selection" div on the right: https://codepen.io/notepage/pen/XavXaE The normal (without_osr version) shows that during the drag and drop there's a nice thumbnail of the Triumph div being dragged attached to the cursor. The OSR version of the same action however does not include this thumbnail. I'm at a loss for explaining this difference in behavior, and am failing to find relevant code in cefclient, libcef, and chromium sources. Does anyone know where I might look to see how this drag and drop thumbnail cursor is implemented, or any ideas on how I may implement something similar for the OSR browser in my app?

Normal (without OSR) drag and drop with cursor thumbnail:
normal.jpg
normal.jpg (46.06 KiB) Viewed 3536 times


OSR drag and drop without cursor thumbnail:
osr.jpg
osr.jpg (44.65 KiB) Viewed 3536 times
sdiverdi
Mentor
 
Posts: 51
Joined: Fri Dec 25, 2020 7:41 pm

Re: cursor during drag and drop with osr, on mac

Postby sdiverdi » Fri Jan 21, 2022 1:23 am

Ah of course a bit more searching and I've found another lead, issue #1715: https://bitbucket.org/chromiumembedded/ ... -drag-drop which says it's resolved, in that CefDragData now has GetImage(), but cefclient/browser/browser_window_osr_mac.mm startDragging:allowedOps:point: still has nil passed into drawImage. I just checked and the CefDragData passed in has an image! So I'll see if giving it to drawImage fixes the problem.
sdiverdi
Mentor
 
Posts: 51
Joined: Fri Dec 25, 2020 7:41 pm

Re: cursor during drag and drop with osr, on mac

Postby sdiverdi » Fri Jan 21, 2022 1:46 am

Good news! That was it. :-)
sdiverdi
Mentor
 
Posts: 51
Joined: Fri Dec 25, 2020 7:41 pm

Re: cursor during drag and drop with osr, on mac

Postby magreenblatt » Fri Jan 21, 2022 11:00 am

Can you submit that fix as a PR? Thanks.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 49 guests