cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.84k stars 2.92k forks source link

WPF - JavaScript DragEnd event not emitted #4801

Closed WilliamTomOBrien closed 3 months ago

WilliamTomOBrien commented 4 months ago

Is there an existing issue for this?

CefSharp Version

124.3.50.0

Operating System

Windows 11

Architecture

x64

.Net Version

4.7.2

Implementation

WPF

Reproduction Steps

  1. Run CefSharp.Wpf.Example
  2. Load the following gist in the browser
  3. Drag the blue box from one grey box to the other
  4. View the emit drag and drop events listed below

Expected behavior

I would expect the dragend event to be emit when the drag operation ended, as described here. In this example, this would be reflected by dragend being printed at the bottom of the event list.

This behavior does occur when using the CEF browser, as shown below. cef-124-drag-and-drop-events

Actual behavior

The dragend event is not emit after dragging and dropping an element.

cefsharp-124-drag-and-drop-events

Apologies for printing the events to the screen - I wanted the gif showing the behavior in CEF to match, and unfortunately trying to load DevTools when running the cefclient.exe --multi-threaded-message-loop --no-sandbox --off-screen-rendering-enabled --enable-gpu command would crash my instance of CEF.

Regression?

This issue seems like it may potentially be relevant, however was not followed up on by the creator. Unfortunately, I was unable to verify if this was the case, as I was unable to build the cefsharp/86 branch.

Known Workarounds

No known workarounds, aside from avoiding any functionality that would rely on an event handler for dragend.

Does this problem also occur in the CEF Sample Application

No

Other information

No response

amaitland commented 4 months ago

If cefclient with --off-screen-rendering-enabled works correctly then you can compare the behaviour and see what changes are required in the WPF implementation.

Pull requests welcome.

unfortunately trying to load DevTools when running the cefclient.exe --multi-threaded-message-loop --no-sandbox --off-screen-rendering-enabled --enable-gpu command would crash my instance of CEF.

This is expected if you are running M125 as there is an upstream issue as discussed at https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=19782

I wouldn't expect this issue if you are testing with the 124 build.

No known workarounds, aside from avoiding any functionality that would rely on an event handler for dragend.

Using https://github.com/cefsharp/CefSharp.Wpf.HwndHost should likely work as expected.