Skip to content

Conversation

@leolost2605
Copy link
Member

@leolost2605 leolost2605 commented Mar 15, 2025

Fixes #381
Requires elementary/gala#2320

A few things:

  • when dragging and dropping the badge and progress are now attached to the icon which is IMO a bit cooler but can be easily changed back
  • we use Gee.List because it's more suitable for the vala way of doing things. also use arraylist because we do a bunch of random access
  • move all of the file dnd handling to the single file drop target in item manager. This prevents some races between multiple drop targets where the drop sometimes would be done on the one for the launchers and sometimes on the big one.

@leolost2605 leolost2605 marked this pull request as ready for review March 16, 2025 14:45
@leolost2605 leolost2605 requested a review from a team March 16, 2025 14:45
Copy link
Member

@lenemter lenemter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DynamicWorkspaceItem probably shouldn't support drag, dragging it does nothing as it can't be moved

@leolost2605
Copy link
Member Author

Fixed

@leolost2605 leolost2605 requested a review from lenemter March 22, 2025 16:42
Comment on lines 154 to 159
var drop_target = new Gtk.DropTarget (get_type (), MOVE) {
preload = true
};
add_controller (drop_target);
drop_target.enter.connect (on_drop_enter);
drop_target.drop.connect (on_drop);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still want to add drop target even when dran-and-drop isn't allowed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm why?

Copy link
Member

@lenemter lenemter Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because dragging a workspace to the left of dynamic workspace icon doesn't do anything, while doing so on icon groups makes space for the dragged workspace

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah but just adding the drop target wont fix it since it only accepts drops from the same type

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok we support now a drag to the dynamic workspace icon.

@lenemter
Copy link
Member

There is a new visual glitch when dragging items:

new.bug.mp4

@leolost2605
Copy link
Member Author

Should be fixed now. Turns out the fancy calculation never actually did anything lol

@leolost2605 leolost2605 requested a review from lenemter March 25, 2025 19:52
@lenemter lenemter merged commit bbaa79a into main Mar 25, 2025
4 checks passed
@lenemter lenemter deleted the leolost/reorder-workspaces branch March 25, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rearrange workspaces with drag and drop

3 participants