mirror of
https://github.com/elementary/gala.git
synced 2024-09-17 10:27:37 +03:00
abort all drags when the view is closed
This commit is contained in:
parent
e00c49f1a7
commit
4971e9b26e
@ -330,6 +330,26 @@ namespace Gala
|
||||
drag_canceled ();
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows you to abort all drags currently running for a given drag-id
|
||||
*/
|
||||
public static void cancel_all_by_id (string id)
|
||||
{
|
||||
var actors = sources.@get (id);
|
||||
if (actors == null)
|
||||
return;
|
||||
|
||||
foreach (var actor in actors) {
|
||||
foreach (var action in actor.get_actions ()) {
|
||||
var drag_action = action as DragDropAction;
|
||||
if (drag_action != null && drag_action.dragging) {
|
||||
drag_action.cancel ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void finish ()
|
||||
{
|
||||
// make sure they reset the style or whatever they changed when hovered
|
||||
|
@ -342,6 +342,8 @@ namespace Gala
|
||||
grab_key_focus ();
|
||||
|
||||
icon_groups.y = height - WorkspaceClone.BOTTOM_OFFSET + 20;
|
||||
} else {
|
||||
DragDropAction.cancel_all_by_id ("multitaskingview-window");
|
||||
}
|
||||
|
||||
// find active workspace clone and raise it, so there are no overlaps while transitioning
|
||||
|
Loading…
Reference in New Issue
Block a user