Page 1 of 1

CefDragHandler::OnDraggableRegionsChanged is not called

PostPosted: Sun Apr 26, 2020 8:24 pm
by blackknife
CefDragHandler::OnDraggableRegionsChanged is not called when html element class that has -webkit-app-region: drag attribute is updated.

My Cef version: 80.0.4+g74f7b0c+chromium-80.0.3987.122

Re: CefDragHandler::OnDraggableRegionsChanged is not called

PostPosted: Tue Apr 28, 2020 11:08 am
by magreenblatt
What OS? This works fine for me with M83 on Windows 10:
Code: Select all
cefclient.exe --use-views --url=http://tests/draggable

Re: CefDragHandler::OnDraggableRegionsChanged is not called

PostPosted: Tue Apr 28, 2020 8:13 pm
by blackknife
magreenblatt wrote:What OS? This works fine for me with M83 on Windows 10:
Code: Select all
cefclient.exe --use-views --url=http://tests/draggable


My Windows version is win10 1803.

You can use this html to debug draggable region.
Click red region to toggle class that contain "-webkit-app-region: drag;" attribute. When the div's drag class has been added, it still can't be dragged.

Code: Select all
<!DOCTYPE html>
<html>
<head>
    <title>Document</title>
    <style>
        .drag
        {
            -webkit-app-region: drag;
        }
    </style>
</head>
<body>
    <div id="drag_region" style="background-color: red; width: 200px; height: 200px;"></div>
</body>
</html>
<script>
    document.querySelector("#drag_region").addEventListener("click", function(ev)
    {
        if(ev.target.classList.length == 0)
            ev.target.classList.add("drag");
        else
            ev.target.classList.remove("drag");
    });
</script>

Re: CefDragHandler::OnDraggableRegionsChanged is not called

PostPosted: Wed Apr 29, 2020 6:47 am
by Czarek
What if you set position to absolute as in cefclient's draggable.html test?

Re: CefDragHandler::OnDraggableRegionsChanged is not called

PostPosted: Wed Apr 29, 2020 10:30 pm
by blackknife
Czarek wrote:What if you set position to absolute as in cefclient's draggable.html test?


It still can't drag.

New code that set position to absolute:
Code: Select all
<!DOCTYPE html>
<html>
<head>
    <title>Document</title>
    <style>
        .drag
        {
            -webkit-app-region: drag;
        }
    </style>
</head>
<body>
    <div id="drag_region" style="background-color: red; width: 200px; height: 200px; position: absolute; left: 0; top: 0;"></div>
</body>
</html>
<script>
    document.querySelector("#drag_region").addEventListener("click", function(ev)
    {
        if(ev.target.classList.length == 0)
            ev.target.classList.add("drag");
        else
            ev.target.classList.remove("drag");
    });
</script>

Re: CefDragHandler::OnDraggableRegionsChanged is not called

PostPosted: Thu Apr 30, 2020 10:13 am
by magreenblatt
Indeed, it appears that RenderFrameObserver::DraggableRegionsChanged is not called by Chromium on dynamic assignment of the "-webkit-app-region: drag" style. You can file a bug at https://crbug.com/.

Re: CefDragHandler::OnDraggableRegionsChanged is not called

PostPosted: Tue May 05, 2020 8:55 pm
by blackknife
Thanks for your answer. I will do it.

Re: CefDragHandler::OnDraggableRegionsChanged is not called

PostPosted: Mon Jun 29, 2020 5:27 am
by ajitchavan
@magreenblatt, Is this issue fixed ?
If no, can I know know the status of it and when is it planned?

I could see same issue in chromium version - 83.3.12+g0889ff0+chromium-83.0.4103.97
@blackknife, Did you post this issue at https://bugs.chromium.org/p/chromium/issues/list ?