Bug 211723 - [GTK] Rework drag and drop handling in preparation for GTK4
Summary: [GTK] Rework drag and drop handling in preparation for GTK4
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on: 211511
Blocks: GTK4 211779
  Show dependency treegraph
 
Reported: 2020-05-11 06:14 PDT by Carlos Garcia Campos
Modified: 2020-05-12 12:27 PDT (History)
2 users (show)

See Also:


Attachments
Patch (66.87 KB, patch)
2020-05-11 06:22 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Patch (71.41 KB, patch)
2020-05-12 05:49 PDT, Carlos Garcia Campos
aperez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2020-05-11 06:14:29 PDT
Make it easier to share the implementation.
Comment 1 Carlos Garcia Campos 2020-05-11 06:22:17 PDT
Created attachment 399015 [details]
Patch
Comment 2 Carlos Garcia Campos 2020-05-12 05:49:58 PDT
Created attachment 399122 [details]
Patch

I forgot to add the gtk4 stubs
Comment 3 Adrian Perez 2020-05-12 09:17:18 PDT
Comment on attachment 399122 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=399122&action=review

> Source/WebCore/platform/gtk/GtkUtilities.cpp:111
> +        && gdkAction & GDK_ACTION_LINK)

It took me a while to understand why this is done in this way. IMO it's more
idiomatic to use a bitmastk to checl all flags at once: 

  static constexpr auto gdkEveryMask = GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK;
  if ((gdkAction & gdkEveryMask) == gdkEveryMask)
      return DragOperationEvery;

...but it was already written this way before, so feel free to leave it as-is.
Comment 4 Carlos Garcia Campos 2020-05-12 12:27:55 PDT
Committed r261570: <https://trac.webkit.org/changeset/261570>