[gnome-shell/gbsneto/icon-grid-dnd-fixes: 13/14] appDisplay: Remove icon from folder when dragging out
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/icon-grid-dnd-fixes: 13/14] appDisplay: Remove icon from folder when dragging out
- Date: Fri, 25 Sep 2020 14:50:50 +0000 (UTC)
commit dd77e98e026e2ac7aa0ab862eb38dee78e90d810
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Sep 24 16:06:01 2020 -0300
appDisplay: Remove icon from folder when dragging out
When dragging an icon outside of a folder dialog, there's a small delay
before the dialog pops down. If the icon is dropped during this delay,
the drag is cancelled, and the icon continues to be in the folder.
However, this behavior turned out to be problematic, and it was a common
point of failure that throwing icons outside folders wouldn't work.
Remove the icon from the folder when dragging it to outside the dialog.
Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3092
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
js/ui/appDisplay.js | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 79373deaeb..a1558ff39f 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -2453,7 +2453,18 @@ var AppFolderDialog = GObject.registerClass({
this._setupDragMonitor();
}
- return DND.DragMotionResult.NO_DROP;
+ return DND.DragMotionResult.MOVE_DROP;
+ }
+
+ acceptDrop(source) {
+ const appId = source.id;
+
+ this.popdown(() => {
+ this._view.removeApp(source);
+ this._appDisplay.selectApp(appId);
+ });
+
+ return true;
}
toggle() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]