elementary / dock

A quick app launcher and window switcher for Pantheon and elementary OS
https://elementary.io
GNU General Public License v3.0
87 stars 24 forks source link

Icon animation or other feedback during slow launch #171

Open jeremypw opened 1 year ago

jeremypw commented 1 year ago

Problem

With a modestly equipped machine, with spinning disk, some apps , in particular Flatpaks, take several seconds to open a window after clicking on the dock item. During this time there is no visual feedback unless the pointer is over the item (when the cursor becomes a spinner). As I for one habitually move the pointer away from the item immediately after clicking in preparation for the window appearing, it is irritating to have to move the pointer back to discover whether the application is still launching or has closed for some reason.

Proposal

It would be better to have the item itself show a "launching" status with an animation or otherwise.

Prior Art (Optional)

No response

vjr commented 1 year ago

@jeremypw would you be able to see whether #172 works? I tried introducing a few seconds sleep in the startup of Tasks app and while the spinner persists, the bounce animation does not because the appinfo launch seems to return immediately. It might just work on a real system with slow spinning disk though, if you or someone else can test?

vjr commented 1 year ago

@jeremypw do you know what/where that spinner is drawn? If the PR does not work, then if that spinner code can be reused to keep the bounce animation going, it would fix this issue.

jeremypw commented 1 year ago

@vjr That PR seems to be targeted at main i.e. io.elementary.dock which is frankly in too early a state of development to reproduce the conditions under which the issue occurs - only a limited set of dock items appear and I cannot seem to add any new ones pointing to a Flatpak app like org.gnome.Evince which are slow to start.

Horus is still using plank which I believe is in the master branch? Depends how far off io.elementary.dock is for real world use whether it is worth fixing this in Plank.

vjr commented 1 year ago

@jeremypw oops lol ok let me look at the master branch

jeremypw commented 1 year ago

@vjr Thanks! Maybe I'll try to progress the main branch a little in the near future. I'd like to work on something different.

vjr commented 1 year ago

I wonder if the complete signal of the mutter Meta.StartupSequence obtained from Meta.StartupNotification which in turn comes from Meta.Display (if my reading of code in the gala repo is somewhat right) will be a proper fix for this issue. I'm unable to figure out how to include mutter deps/vapi etc though.

jeremypw commented 1 year ago

I think the best solution would involve detecting when the app window actually appears (or the app fails), presumably via signal from the window manager. I noticed that in some cases even if you hover over the dock item, the spinner disappears significantly in advance of the window appearing.