Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Git Version | Version Git Animation of the launcher until the application opens
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Git Version | Version Git

Subjects Author Language Messages Last message
[Locked] Animation of the launcher until the application opens
Page : 1 2
matttbe English 28 matttbe [Read]
20 September 2013 à 19:09

matttbe, Thursday 18 July 2013 à 15:55


Subscription date : 24 January 2009
Messages : 12573
Hello,

I just added (rev 1573) a new option (enabled by default) to animate the launcher until the corresponding application opens. Feel free to test it and report any bug

here when launching 'sleep 3 && gnome-calcultor'


It's a tiny tiny feature but I hope you'll like it (I like it so I'm fine )

It will be available on our Weekly ppa soon

@fabounet: I added a new variable in the Icon structure (iSidAnimationOpening) but I didn't bump Cairo-Dock version because we're still in alpha
When opening a new application (user-interraction.c - I hope it's the good place ), the dock launch a new g_timeout_add_seconds and it will modify iSidAnimationOpening which is used by Animated-icons to check if the animation can continue or not.
This option is only enabled if "mix launcher appli" option is enabled too.
If the application is not launched after 10 seconds (it's hardcoded, should I add an option?), the animation stop.
When the application opens, the animation will be stopped (in class-manager.c [cairo_dock_prevent_inhibited_class] - I hope it's the good place too ).

Note: the plugins need to be recompiled

taiebot65, Thursday 18 July 2013 à 20:50


Subscription date : 26 October 2008
Messages : 1904
Does that mean you are blocking the same application launch during this time frame?
I have got a very old touchpad which is very sensitive and i always end up with two or more window of the same type (quite annoying) because i triple click without knowing it.
That would be a nice addition as well

matttbe, Thursday 18 July 2013 à 22:01


Subscription date : 24 January 2009
Messages : 12573
No but we can add another feature.

But I think that blocking the same application launch during this time frame is maybe a too long time if you want to launch more that one application BUT if you want to launch 2 applications, you should use "SHIFT" + Clic which is not the case here.
@fabounet: what do you think about that? (I no longer see you on IRC )

matttbe, Thursday 18 July 2013 à 22:34


Subscription date : 24 January 2009
Messages : 12573
And it's easy to implement it:
=== modified file 'src/cairo-dock-user-interaction.c'
--- src/cairo-dock-user-interaction.c    2013-07-18 17:00:13 +0000
+++ src/cairo-dock-user-interaction.c    2013-07-18 20:38:57 +0000
@@ -180,+180,@@
     }
 }
 
-static 
gboolean _launch_icon_command (Icon *iconCairoDock *pDock)
+static 
gboolean _launch_icon_command (Icon *iconCairoDock *pDockgboolean bForce)
 {
     if (
icon->cCommand == NULL)
         return 
GLDI_NOTIFICATION_LET_PASS;
@@ -
191,+191,12 @@
         if (
CAIRO_DOCK_IS_APPLET (pMainIcon))
             return 
GLDI_NOTIFICATION_LET_PASS;
     }
-    
+
+    
// do not launch it twice (avoid wrong double click)
+    // => if we want 2 apps, we have to use Shift + Click
+    if (! bForce && icon->iSidAnimationOpening != 0)
+        return 
GLDI_NOTIFICATION_INTERCEPT;
+
     
gboolean bSuccess FALSE;
     if (*
icon->cCommand == '<')  // shortkey
     
{
@@ -
224,+229,@@
         || 
CAIRO_DOCK_ICON_TYPE_IS_APPLI (icon)
         || 
CAIRO_DOCK_ICON_TYPE_IS_CLASS_CONTAINER (icon))
         {
-            return 
_launch_icon_command (iconpDock);
+            return 
_launch_icon_command (iconpDockTRUE);
         }
         return 
GLDI_NOTIFICATION_LET_PASS;
     }
@@ -
269,+274,@@
     }
     else if (
CAIRO_DOCK_ICON_TYPE_IS_LAUNCHER (icon))  // finally, launcher being none of the previous cases -> launch the command
     
{
-        return 
_launch_icon_command (iconpDock);
+        return 
_launch_icon_command (iconpDockFALSE);
     }
     else
     {

taiebot65, Friday 19 July 2013 à 09:06


Subscription date : 26 October 2008
Messages : 1904
+10000

taiebot65, Monday 22 July 2013 à 16:12


Subscription date : 26 October 2008
Messages : 1904
Thanks. I like it

matttbe, Monday 22 July 2013 à 17:06


Subscription date : 24 January 2009
Messages : 12573
Oops, this modif is also in the Weekly ppa
(Arf, I forgot it...)

matttbe, Monday 22 July 2013 à 18:06


Subscription date : 24 January 2009
Messages : 12573
@fabounet: can I add a new DBus method to launch the application which is linked to the launcher with this feature?
Many Third-party applets control an application.

matttbe, Thursday 22 August 2013 à 00:09


Subscription date : 24 January 2009
Messages : 12573
@fabounet: According to the latest rev on BZR, the support of the StartupNotify protocol has been added. I have a few questions about that
  1. If I understand well, if the .desktop file of an application contains this line 'StartupNotify=true', it means that the corresponding application will send a signal (remove:(...)) when its window is shown. Is it right?
  2. But why do we need to support it (by checking all ClientMessage events from X11)? We already know when a window is shown
  3. But maybe if we know that this application supports StartupNotify:
    1. we could add a longer timeout (iSidOpeningTimeout).
    2. But we can only know when an application is launched if we launch it by ourself (or maybe by listening DBus messages? It seems Zeitgeist do that (e.g. here) => org.gtk.gio.DesktopAppInfo)
    3. GMenu could directly create a new icon (if this application is not linked to a launcher) and launch this new opening animation.
  4. I see that you added 'bHasStartupNotify' variable in the structure of 'CairoDockClassAppli' but it's not used. Does it mean that the implementation is not complete and that you prepare other nice things?

PS: I no longer see you on IRC, do you still (want to) use it?

fabounet, Thursday 22 August 2013 à 16:23


Subscription date : 30 November 2007
Messages : 17118
We already know when a window is shown

not all the time
for instance, consider lanching pidgin twice; it will just pop the existing window and quit, and if pidgin is already the active window, you get no clue to stop the animation
if the program supports the protocol correctly, it will send the "remove" message before quitting (counter-example: gedit does not and it's a bug)

see http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt for the details (Hint: the "launchee" is us )

I've added bHasStartupNotify in the process of writing the code, but finally I think we may not need it

the implementation is indeed not complete, but is enough for us

I no longer see you on IRC

yes sorry, not so much time since I got my new job, so I prefer coding when I can (but IRC is still nice for us or even users who'd like to contact us)

matttbe, Thursday 22 August 2013 à 20:15


Subscription date : 24 January 2009
Messages : 12573
not all the time
for instance, consider lanching pidgin twice; it will just pop the existing window and quit, and if pidgin is already the active window, you get no clue to stop the animation
if the program supports the protocol correctly, it will send the "remove" message before quitting (counter-example: gedit does not and it's a bug)

see http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt for the details (Hint: the "launchee" is us )
Ok, thank you for these details!

And what do you think about the 3th item?
But maybe if we know that this application supports StartupNotify:
  • we could add a longer timeout (iSidOpeningTimeout).
  • But we can only know when an application is launched if we launch it by ourself (or maybe by listening DBus messages? It seems Zeitgeist do that (e.g. here) => org.gtk.gio.DesktopAppInfo)
  • GMenu could directly create a new icon (if this application is not linked to a launcher) and launch this new opening animation.
Especially about GMenu

yes sorry, not so much time since I got my new job, so I prefer coding when I can (but IRC is still nice for us or even users who'd like to contact us)
You don't have to say "sorry", I understand
It's just that if you're coding on your pc, don't hesitate to open XChat/Pidgin (but note that I'm not regularly connected too )

fabounet, Friday 23 August 2013 à 17:00


Subscription date : 30 November 2007
Messages : 17118
could add a longer timeout

no need I think, even if the application supports the protocol, it can stil fail to launch (and therefore not send the "remove")

But we can only know when an application is launched if we launch it by ourself

indeed, but we don't need really more (at least not for the click animation; and we rarely launch a program from GMenu that is already in the dock)

GMenu could directly create a new icon

hmm, when ?

matttbe, Saturday 24 August 2013 à 00:10


Subscription date : 24 January 2009
Messages : 12573
no need I think, even if the application supports the protocol, it can stil fail to launch (and therefore not send the "remove")
Yes, but if we know that this application supports this protocol, there is more chances that the signal is sent and then we could use a longer timeout (e.g. 20-25 sec) but it's a details

GMenu could directly create a new icon

hmm, when ?

I think it can be interesting that GMenu (or the core) creates an icon as soon as possible and animate it until the corresponding application appears
With this behaviour, the user sees that his application is loading, "something happens", no need to check that he has launched the right application (if the application takes a few time). I think it can be a interesting feature, more integration with other apps, we see what's happening and it's a good thing!

Note that it seems we can detect when an application is launched with GIO (zeitgeist detects when an application is launched from GMenu applet by listening DBus signals: have a look here).
What do you think about that?

fabounet, Tuesday 27 August 2013 à 17:00


Subscription date : 30 November 2007
Messages : 17118
zeitgeist is not very widespread so we can't rely on it

Note that on KDE, a small icon of the launching application will bounce under the mouse.
this may actually be better than animating an icon in the dock without having clicked it

matttbe, Tuesday 27 August 2013 à 17:37


Subscription date : 24 January 2009
Messages : 12573
zeitgeist is not very widespread so we can't rely on it
No but we can do like zeitgeist: by listening DBus signals: a gio-launch-listener => https://code.launchpad.net/~mhr3/zeitgeist-datahub/gdbus-update/+merge/49032

this may actually be better than animating an icon in the dock without having clicked it
I don't know
We can see that an application is launching, where the icon will be and I'm sure that the user will know that click will do nothing (and it's better to see something than nothing...)

fabounet, Thursday 29 August 2013 à 17:38


Subscription date : 30 November 2007
Messages : 17118
We can see that an application is launching, where the icon will be and I'm sure that the user will know that click will do nothing

well maybe

by listening DBus signals: a gio-launch-listener

I don't know if gio-launch-listener really notifies applications launching or just sends a signal when "gio_launch" (approximate name) is called in a program
I think we should rely on the StartupNotify protocol

matttbe, Thursday 29 August 2013 à 18:02


Subscription date : 24 January 2009
Messages : 12573
well maybe


I don't know if gio-launch-listener really notifies applications launching or just sends a signal when "gio_launch" (approximate name) is called in a program
According to dbus-monitor, it's the first signal that we receive after having launched an application with GIO.
It's linked with GDesktopAppInfo and it seems there are a lot of info according to the source code of GDesktopAppInfo: desktop file, pid, display, uri + extras (info about the origin (the launcher I guess): pid, desktop file, program name, etc.)

I think we should rely on the StartupNotify protocol
But with this protocol, we are not notified when an application is launched, no?

fabounet, Friday 30 August 2013 à 16:47


Subscription date : 30 November 2007
Messages : 17118
of course we are, that's the sole purpose of this protocol

after having launched an application with GIO

which means only the applications that use it will send a signal, which makes it useless for us

matttbe, Saturday 31 August 2013 à 00:49


Subscription date : 24 January 2009
Messages : 12573
of course we are, that's the sole purpose of this protocol
oh ok, I thought we only receive a signal when the windows were just displayed (when we have to stop the animation) and not when the application was launched (when launching an application from GMenu)

which means only the applications that use it will send a signal, which makes it useless for us
No, this signal is send when we launch an application with GIO (e.g. GMenu uses GIO)

matttbe, Sunday 01 September 2013 à 11:18


Subscription date : 24 January 2009
Messages : 12573
With the latest version, it seems I have a few problems:
  • At startup, when I launch Firefox and my music player (by clicking on MP applet in order to launch Clementine), icons are animated until the dock hides (not until the application opens). These windows are maximised (and I used Global-Menu to remove the decorations).
  • If I click on MP to stop the player, it works fine but if I click a second time the icon is animated until the dock hides.


EDIT: I confirm that I only this bug when the dock is launched at startup. If I close Firefox and Clementine windows, relaunch the dock and reopen Firefox and Clementine, I don't have these problems.
Is it possible that the protocol is "not ready" when launching the dock at startup??

Git Version | Version Git

Subjects Author Language Messages Last message
[Locked] Animation of the launcher until the application opens
Page : 1 2
matttbe English 28 matttbe [Read]
20 September 2013 à 19:09


Glx-Dock / Cairo-Dock List of forums Git Version | Version Git Animation of the launcher until the application opens Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.