From 31e5c8d15f881c49f500e2eac6f899ffbdcd370b Mon Sep 17 00:00:00 2001 From: Leonhard Kargl Date: Thu, 23 Jan 2025 19:33:21 +0100 Subject: [PATCH 1/2] Allow locking launchers --- data/dock.gschema.xml | 6 ++++++ src/Launcher.vala | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/data/dock.gschema.xml b/data/dock.gschema.xml index 6b50086d..72d62e12 100644 --- a/data/dock.gschema.xml +++ b/data/dock.gschema.xml @@ -26,6 +26,12 @@ An ordered array of app id's to show as launchers An ordered array of app id's to show as launchers + + + false + Whether to lock launchers to the dock. + Locking launchers prohibits unpinning apps by dragging them off the dock + diff --git a/src/Launcher.vala b/src/Launcher.vala index c2798948..a92518bd 100644 --- a/src/Launcher.vala +++ b/src/Launcher.vala @@ -406,7 +406,7 @@ public class Dock.Launcher : Gtk.Box { } private bool on_drag_cancel (Gdk.Drag drag, Gdk.DragCancelReason reason) { - if (app.pinned && reason == NO_TARGET) { + if (app.pinned && reason == NO_TARGET && !settings.get_boolean ("lock-launchers")) { var popover = new PoofPopover (); unowned var window = (MainWindow) get_root (); From 0470dadb3a8136ec61511e38f562e16a64de03a8 Mon Sep 17 00:00:00 2001 From: Leonhard Kargl Date: Sun, 9 Feb 2025 17:28:35 +0100 Subject: [PATCH 2/2] Use enum --- data/dock.gschema.xml | 13 +++++++++---- src/Launcher.vala | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/data/dock.gschema.xml b/data/dock.gschema.xml index 72d62e12..17d02a53 100644 --- a/data/dock.gschema.xml +++ b/data/dock.gschema.xml @@ -8,6 +8,11 @@ + + + + + 'overlapping-focus-window' @@ -27,10 +32,10 @@ An ordered array of app id's to show as launchers - - false - Whether to lock launchers to the dock. - Locking launchers prohibits unpinning apps by dragging them off the dock + + 'unpin' + What to do when a launcher is dragged off the dock. + What happens when a launcher is dragged off the dock and released there diff --git a/src/Launcher.vala b/src/Launcher.vala index a92518bd..161bd376 100644 --- a/src/Launcher.vala +++ b/src/Launcher.vala @@ -406,7 +406,7 @@ public class Dock.Launcher : Gtk.Box { } private bool on_drag_cancel (Gdk.Drag drag, Gdk.DragCancelReason reason) { - if (app.pinned && reason == NO_TARGET && !settings.get_boolean ("lock-launchers")) { + if (app.pinned && reason == NO_TARGET && settings.get_enum ("drag-off-dock-behavior") == 1) { var popover = new PoofPopover (); unowned var window = (MainWindow) get_root ();