Igalia / chromium

Old repo. See https://crbug.com/578890 instead.
https://chromium.googlesource.com/chromium/src.git
BSD 3-Clause "New" or "Revised" License
115 stars 16 forks source link

fixup! Implements Drag and Drop for Ozone/X11 #498

Open jkim-julie opened 5 years ago

jkim-julie commented 5 years ago

It adds APIs to handle drop action at WmDropHandler, implements them at DesktopDragDropClientOzone and connects them to Ozone/X11.

jkim-julie commented 5 years ago

Wayland changes also has WmDrophandler. During rebase, i think we missed the part to handle drop action for wayland from somewhere because there is only start dragging at upstream gerrit now. For receiving drop, it'll be handled after landing start dragging patch. If you look at DesktopDragDropClientOzone ctor, https://github.com/Igalia/chromium/blob/005f53290881da8e326b1c7946134c63e207fe44/ui/views/widget/desktop_aura/desktop_drag_drop_client_ozone.cc#L28, it's registered as WmDropWindowHanlder and receives messages from platform when drag is finished. The drag and drop has two way communication. So, without window handlers from previous change, it extended interfaces at PlatformWindow, from views to platform, for starting drag from chromium, and PlatformWindowDelegate, from platform to views, for receiving drop from platform. This patch has both of them, starting dragging and receiving drop.

msisov commented 5 years ago

Ok, then using callbacks is not a good idea, right?

jkim-julie commented 5 years ago

For the change at upstream, https://chromium-review.googlesource.com/c/chromium/src/+/1218446, I removed drop handler as I agreed we can use callback for starting dragging. When dragging is started from external applications, we need to consider how PlatformWindow sends messages to DesktopDragDropClientOzone.

If Window Handler is not fit for handling it,

msisov commented 5 years ago

Ok, I need to check more carefully.