From 72b8a73a1b66caa6c03c3afb2d979f14a197ff60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 28 May 2025 10:09:02 -0700 Subject: [PATCH] AppButton: Fix drag to dock --- src/Widgets/AppButton.vala | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Widgets/AppButton.vala b/src/Widgets/AppButton.vala index d323b2657..2ac13a03d 100644 --- a/src/Widgets/AppButton.vala +++ b/src/Widgets/AppButton.vala @@ -33,10 +33,6 @@ public class Slingshot.Widgets.AppButton : Gtk.Button { } construct { - Gtk.TargetEntry dnd = {"text/uri-list", 0, 0}; - Gtk.drag_source_set (this, Gdk.ModifierType.BUTTON1_MASK, {dnd}, - Gdk.DragAction.COPY); - tooltip_text = app.description; get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT); @@ -97,17 +93,20 @@ public class Slingshot.Widgets.AppButton : Gtk.Button { return Gdk.EVENT_PROPAGATE; }); - this.drag_begin.connect ((ctx) => { - this.dragging = true; - Gtk.drag_set_icon_gicon (ctx, app.icon, 16, 16); - app_launched (); + Gtk.TargetEntry dnd = {"text/uri-list", 0, 0}; + Gtk.drag_source_set (this, BUTTON1_MASK, {dnd}, COPY); + + drag_begin.connect ((ctx) => { + dragging = true; + Gtk.drag_set_icon_gicon (ctx, app.icon, 32, 32); }); - this.drag_end.connect ( () => { - this.dragging = false; + drag_end.connect (() => { + dragging = false; + app_launched (); }); - this.drag_data_get.connect ( (ctx, sel, info, time) => { + drag_data_get.connect ((ctx, sel, info, time) => { sel.set_uris ({File.new_for_path (app.desktop_path).get_uri ()}); });