cosmic-panel icon indicating copy to clipboard operation
cosmic-panel copied to clipboard

Hold-to-Drag Pinned Icons

Open samexner opened this issue 1 year ago • 9 comments

I frequently pull pinned icons off of the dock by mistake because I have motor control issues. Instead of instantly unpinning and removing icons, they should only be unpinned if you hold the mouse for a few seconds. This might even include some kind of visual feedback like the icons filling the space.

samexner avatar Aug 19 '24 20:08 samexner

I would personally prefer that pinned apps weren't removable with dragging (only rearranged), and could only be unpinned in the App Tray and App Library context menu. But not sure if that would be desirable behavior for everyone.

git-f0x avatar Aug 27 '24 16:08 git-f0x

Have had this problem too aswell as @BrodieRobertson

bittin avatar Mar 01 '25 15:03 bittin

Obviously not the be all, end all correct way to do it, but at least in KDE you can't drag the icons out. They can only be removed by explicitly "unpinning" them from the context menu

BrodieRobertson avatar Mar 04 '25 04:03 BrodieRobertson

For people looking to tackle this issue I tried messing with it a bit myself. After looking into the code for the cosmic-app-list applet it seems that there is code for handling an icon being dragged out and back in. The problem is that the drag and drop seems inconsistent where sometimes the icon seems to just drop from my cursor and then its a lost cause. Either there is some kind of DND handler that should be set to handle this case (maybe this "icon disappearance" is due to a drag cancel message and that needs a special handler) or my current best guess is that this is actually an issue in libcosmic and how it handles drag and drop and less so an issue with the app list applet within the dock.

BanceDev avatar Mar 05 '25 07:03 BanceDev

ofc if the desired solution is to just prevent the ability for icons to be dragged out of the applet such a solution would be easier just wanted to mention the potential for a larger underlying issue.

BanceDev avatar Mar 05 '25 07:03 BanceDev

It is intentional that apps can be dragged off the app tray, but it would be fine to add a setting that can disable that. It wouldn't be exposed in the settings app, but could be available as a config option.

wash2 avatar Mar 05 '25 13:03 wash2

You previously did add a config option that disables drag and drop for the App Tray (after I reported this issue previously), but it disables all drag and drop, rather than just unpinning by dragging. I'm not sure if that option is still needed if an option to disable drag unpinning is available.

But IMO, being able unpin by dragging seems like a sub-optimal default UX. Though if touchscreen interfaces are considered, it might be desirable, but it could instead be a click/tap and hold for the icon to pop up from the tray (both with a mouse and touch), which would make it a lot harder to accidentally unpin. But that might also have accessibility issues for people that can't let go of a button quickly enough (and not sure if detecting tap/click and hold is possible currently).

It could also possibly be made more dynamic (and possibly have an increased threshold), in that it's only possible to unpin if dragging outside of the inner panel edge (away from the screen edge), since dragging e.g. in a bottom-anchored panel, dragging down, or left/right beyond the applet bounds can also unpin (the latter being an issue if the panel is extended, or if there are other applets in those directions). And possibly a small "x" appearing in the icon corner to indicate what will happen.

git-f0x avatar Mar 05 '25 13:03 git-f0x

In my comment above I'm less concerned with an opinion for how the dock should behave but rather in looking into this issue I found a set of related bugs. I've attached a video below to demonstrate. First you will see that when I drag the icon out it does the expected behavior and lets me drag back in. Then there is a following time where it does not let me drag back in at all. There is also an issue where if I drag out an active app it is not displayed in the active apps list. Then I show that due to this after opening a second instance of the app it shows up in the active app list but the dock deems the app inactive after closing that instance even though a second instance is open.

The bug with active apps is very easily repeatable but the bug with not being able to drag back into the dock is horribly inconsistent and leads me to question if its less of an issue with the applet and more of an issue with the drag and drop implementation.

https://github.com/user-attachments/assets/a3347983-620f-45d2-b554-e9db8842fb9c

BanceDev avatar Mar 05 '25 14:03 BanceDev

Here's an additional issue that is more repeatable. If you drag an icon below the screen and then outside the dock you cannot drag back in. Additionally the icon stays on the dock but it does not function for launching apps. It also indicated that the app is open even after closing it.

https://github.com/user-attachments/assets/1d7ae1af-28bb-487f-9324-51dac4342810

BanceDev avatar Mar 05 '25 14:03 BanceDev

I would personally prefer that pinned apps weren't removable with dragging (only rearranged), and could only be unpinned in the App Tray and App Library context menu. But not sure if that would be desirable behavior for everyone.

Maybe display a Trash icon inside a small circle somewhere on the screen, which upon being dragged onto applets get removed.

itu-itis22-gokalpay22 avatar Dec 03 '25 21:12 itu-itis22-gokalpay22