Is it possible to tell if there's a drag-and-drop in progress from a Shell extension?

As the title says, I’m looking for a way to determine if there’s a drag-and-drop in progress from a Shell extension.

To give some context, I’m the developer of the Hot Edge extension. The biggest challenge I’m facing is how to prevent unintentional activations of the hot edge. Once common case of unintentional activations is hitting the bottom edge when pulling down on a scroll bar or highlighting a page of text. In those cases the primary mouse button is held down when the edge is hit, so I can prevent them by not activating the overview when the primary button is held.

Unfortunately, this also prevents you from dragging something into the overview and dropping it (because the mouse button is held during the drag), which is a very useful operation if the window you want to drop into is not visible on screen. So, I’d like the logic to look more like if !button held || drag in progress: activate overview. What I can’t figure out, though, is how to determine if a drag is in progress. I’ve tried handling the signals on Meta.Dnd but that didn’t work, and I’ve looked for ways of querying for a drag but couldn’t find anything in the API docs (I even thought of maybe querying the cursor shape in use to see if it’s the drag-and-drop cursor, but I couldn’t find a way to do that either).

If anyone knows how to do this, I’d appreciate the help :slight_smile: .

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.