Skip to content

Commit

Permalink
Dnd remove via app pinned
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Dec 11, 2024
1 parent b67a1f6 commit 7d32f82
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Launcher.vala
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public class Dock.Launcher : Gtk.Box {
private int drag_offset_x = 0;
private int drag_offset_y = 0;

private bool flagged_for_removal = false;

public Launcher (App app) {
Object (app: app);
}
Expand Down Expand Up @@ -208,7 +210,11 @@ public class Dock.Launcher : Gtk.Box {
drag_source.prepare.connect (on_drag_prepare);
drag_source.drag_begin.connect (on_drag_begin);
drag_source.drag_cancel.connect (on_drag_cancel);
drag_source.drag_end.connect (() => moving = false);
drag_source.drag_end.connect (() => {
if (!flagged_for_removal) {
moving = false;
}
});

var drop_target = new Gtk.DropTarget (typeof (Launcher), MOVE) {
preload = true
Expand Down Expand Up @@ -435,7 +441,8 @@ public class Dock.Launcher : Gtk.Box {
popover.popup ();
popover.start_animation ();

LauncherManager.get_default ().remove_launcher (this, false);
app.pinned = false;
flagged_for_removal = true;

return true;
} else {
Expand Down

0 comments on commit 7d32f82

Please sign in to comment.