fthx / babar

Task bar. GNOME Shell extension
GNU General Public License v3.0
41 stars 14 forks source link

Drag-and-drop windows across workspaces #6

Closed Magean0 closed 3 years ago

Magean0 commented 3 years ago

Hey,

Thank you very much for your contribution to the GNOME ecosystem. Lightweight extensions that restore functionality to the mostly empty top panel, without deeply altering the shell nature, are very welcome.

One feature I like in the workspace list panel applet from other desktop environments such as Xfce, MATE or (unless I'm mistaken) KDE is reorganizing windows by moving them across workspaces. Simply drag and drop the corresponding icon and you're done. In GNOME, you need to enter the Overview to do that, and window thumbnails from the workspace list on the right are not always as legible as application icons.

To my knowledge, the only GNOME extension offering that feature was Workspaces to Dock, and it's unfortunately unmaintained now.

So, do you think that would be much work for you to incorporate that into BaBar?

Thanks in advance for considering my suggestion.

fthx commented 3 years ago

Yes it's clearly a missing feature. Same for favorites menu but less important.

It needs a lot of work, you're right. I looked a the implementation in Dash to Panel and it's quite hard work, having a look at my average GJS skills of course!

Magean0 commented 3 years ago

As far as I know this feature doesn't exist in Dash to Panel. You can reorder windows in the panel but not across workspaces (unless I missed something?).

The only example I'm aware of in the GNOME ecosystem is Workspaces to Dock.

fthx commented 3 years ago

Ok but the problem is not to use dnd on workspaces or tasks ordering, but the dnd implementation itself.

Magean0 commented 3 years ago

I see. Thanks for your replying anyway, you did a great job.

fthx commented 3 years ago

Ok. I've got a solution: buttons to change workspace. It works quite well. It's too late now, I'll publish that here later (friday...).

Magean0 commented 3 years ago

Awesome, thanks a lot! I won't be near my Linux desktop for a few days; I'll give the new version a test in a week from now, if you still need feedback.

fthx commented 3 years ago

I always need feedback :-) .

So make the arrows buttons to move windows to another workspace is done and it works well. But I try in the same time 1) to test it some days (the extension v23 is now online and is quite ok now) and 2) to make two new options to show/hide dash and workspaces thumbnails in overview. Easy (I did this in another of my extensions) for dash, harder for thumbnails (the existing extension about this does not work).

fthx commented 3 years ago

Ok, that's uploaded, everything seems to work as intended and without hidden errors. You can find the extension folder here: https://extensions.gnome.org/review/download/22325.shell-extension.zip

bernardelli commented 3 years ago

Hey, you mentioned that you don't know how implement to drag an drop.

But this extension you made forked has this functionality. How is it any different now?

( I'd love to, but in the next few months I won't be able to contribute. I am just curious :rofl: )

fthx commented 3 years ago

That's because you did not read the description. :-p Edit: now you have read it!! It's just a very tiny 1 line fork of official Workspace Indicator from fmuellner. The workspace indicator (somewhat useless) can be more useful by turning the direction indicator to horizontal. Of course I asked first GNOME team to make this, but no way. So, that's not MY Dnd!

fthx commented 3 years ago

To be serious this time, the dnd in BaBar should not be as difficult as in GNOME dash or Dash to Panel extension. We do not have to make a place for the dragged app icon, just put it in right workspace when dragging is released over this workspace place.

Unfortunately, I will have way more work these coming weeks. I mean, a real work that brings me money for. ;-)

bernardelli commented 3 years ago

No hurry!

bernardelli commented 3 years ago

Changing the subject, I've tested the arrows and they work fine. I think it would be neat (and perhaps make DnD superfluous), if the arrows were to be placed at both sides of the active icon. Making them tiny could keep the "design regularity".

image

Pardon my half-assed example

fthx commented 3 years ago

Ok I just did that. I did not before for some reasons but you convinced me to try.

  1. this feature is useful only if you can use this on any icon, not only the focused one, so I did this
  2. you cannot make arrows on each side of the icon, because it moves the icon itself on hover and it's very annoying when you just want to click on the icon (I tried, of course)
  3. so I placed the arrows on the right of the icon, and it looks much better
  4. though, it's quite annoying when you hover horizontally some icons, if the arrows appears too quick

At the moment, the extension is fully working but I get some silent errors in logs and I do not like that. So I'll probably make all this an option and keep the old global arrows too as another option.

fthx commented 3 years ago

I got a soluuuution. ;-) I check all that and make new options and I'll tell you.

fthx commented 3 years ago

It's ready! Here or here: https://extensions.gnome.org/review/download/22357.shell-extension.zip

fthx commented 3 years ago

Hovering definitely does not fit what I want, so I did this through a right-click. You have middle-click to close option too.

bernardelli commented 3 years ago

Clever solution :) It's working fine for me

fthx commented 3 years ago

Lol I just found the guy who asked me to have a middle-click-to-close option. image Happy to see that I'm not that tired, that was real. ;-)

Do you have any errors in GNOME Logs (search for "fthx" in "All" tab) ? Thanks again. I don't have any, but as you know, programming does show some nasty surprises sometimes.

bernardelli commented 3 years ago

No log entries for fthx. Edit: gnome-shell[6367]: Can't update stage views actor Gjs_babar_fthx_extension_WorkspacesBar is on because it needs an allocation.

I just noticed a little hiccup: the icon doesn't always switch workspaces right after the arrow is clicked (but the window does). Sometimes I had to go back and forth to some other window/workspace for the icon to move.

⁽ʸᵉᵖ. ᵗʰᵃᵗ'ˢ ᵐᵉ⁾

fthx commented 3 years ago

I never had this info log. Good that is not an error nor warning. But now that the extension has reached a good % of its initial goals, I'll just check all the glitches.

I never had the icon issue. I'll check that too. If you have a way to reproduce, tell me. What distribution and GNOME version do you use ? Do you have any other extension installed ?

No hurry. Thanks again and again.

fthx commented 3 years ago

DONE!! :-) The code is uploaded in this GitHub but I wait for some feedback to push it to GS extensions website. Tell me. @wooque @frandieguez @Feichtmeier

fthx commented 3 years ago

Now you can DnD favorites menu items too. :-)