But then I noticed that you cannot select text or images at all while in FiveM, and dragging them around, as if user-select: none is applied to everything permanently.
This can’t be resolved as CEF relies on the OS implementation for dragging/dropping in these events (as they can also drag files to the OS itself), which won’t work for full-screen D3D applications.
Perhaps this can be resolved when/if we get rid of fullscreen mode, but this is unlikely due to weird drivers on user devices.
… actually, using AttachThreadInput causes DoDragDrop to not block - one won’t see any overlay from the dragged object (as this would be another child window), but dragging itself seems to work and not block the game like this.
I don’t know if this is still relevant but I did a workaround for drag/drop simulation for one of my projects. It is pretty simple actually and works quite well. Here is a showcase of it:
I simply assigned a mouseDown event to the draggable object and when it is fired, I assigned that object to a variable. I also assigned mouseUp events to the droppable places. And there is also an invisible div, which moves itself to the mouse location, if there is an object which is currently being dragged. Here is an example code representation of it.
$(function(){
var beingDragged = null;
$('#draggableObject').on('mousedown', function(){
console.log($(this).attr('id') + " is being dragged!");
beingDragged = $(this);
});
$(document).on('mouseup', function(){
var id = $(this).attr('id');
if (beingDragged != null && id == 'droppableDiv'){
console.log(beingDragged.attr('id') + " was dropped!");
beingDragged = null;
}
});
});
It’s not so much of a workaround, but rather an alternative (older) method of doing it. The HTML5 way is just way more responsive than conventional Javascript or jQuery (or at least it feels that way inside of browsers). It would be really neat to have support for it. If that means the overlay is not visible – that is fine I would imagine, one could always emulate that with Javascript.
I just tested the sample code from GitHub - msquerade/nuidrag, unfortunately, the problem still exists. Is there any chance of a solution to this problem in the future?