Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques About Scooby-do's focus's smooth movement
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)
Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] About Scooby-do's focus's smooth movement
eastfire English 2 eastfire [Read]
04 June 2010 à 04:53

eastfire, Tuesday 01 June 2010 à 05:24


Subscription date : 10 May 2010
Messages : 22
I see Scooby-do's code, in file applet-icon-finder.c there is:
if (1||myData.pCurrentDock != pDock)
                {
                        
cairo_dock_emit_motion_signal (pDock,
                                
x,
                                
y);
                }
                else
                {
                        
myData.iPrevMouseX myData.iMouseX;
                        
myData.iPrevMouseY myData.iMouseY;
                        
myData.iMotionCount 10;
                }



I try remove "1||" and found out focus icon move quiet well, but then I found out it didn't work well when in sub-dock.

So I try my own code:

typedef struct
{
        
guint iCount;
        
gfloat fX;
        
gfloat fY;
        
gfloat fDx;
        
gfloat fDy;
        
CairoDock *pDock;
        
IconpIcon;
movement_s;

static 
gboolean __movement(gpointer data)
{
        
movement_s= (movement_s*)(data);

        
m->fX += m->fDx;
        
m->fY += m->fDy;
        
cairo_dock_emit_motion_signal (m->pDock,
                                (
gint)(m->fX),
                                (
gint)(m->fY));

        
m->iCount--;
        if (
m->iCount == )
        {
                
/*cairo_dock_request_icon_animation (m->pIcon, m->pDock, myConfig.cIconAnimation, 1e6);  // interrompt l'animation de "mouse over".
                cairo_dock_launch_animation (CAIRO_CONTAINER (m->pDock));*/
                
                
g_free(m);
                return 
FALSE;
        }else return 
TRUE;
}




                
if (/*1||*/myData.pCurrentDock != pDock)
                {
                        
cairo_dock_emit_motion_signal (pDock,
                                
x,
                                
y);
                }
                else
                {
                      
/*myData.iPrevMouseX = myData.iMouseX;
                        myData.iPrevMouseY = myData.iMouseY;
                        myData.iMotionCount = 10;*/

                        
movement_spMove g_new0(movement_s,1);
                        
pMove->fX = (gfloat)(myData.iMouseX);
                        
pMove->fY = (gfloat)(myData.iMouseY);
                        
pMove->pDock pDock;
                        
pMove->pIcon pIcon;
                        
pMove->iCount 10;
                        
pMove->fDx = (x-(gfloat)(myData.iMouseX))/(gfloat)(pMove->iCount);
                        
pMove->fDy = (y-(gfloat)(myData.iMouseY))/(gfloat)(pMove->iCount);
                        
g_timeout_add(20,__movement,pMove);
                }


Then movement work well both in dock and sub-dock now, although movement between dock and sub-dock still shaking.

Another problem is icon animation stop after show once.
If I put launch animation code in timeout callback, animation will block later movement.

fabounet, Tuesday 01 June 2010 à 17:22


Subscription date : 30 November 2007
Messages : 17118
icon animation stop after show once

this is because the applet simulate the mouse's movement on the dock.
and you have set up the animation on mouse hover to not repeat itself.

eastfire, Friday 04 June 2010 à 04:53


Subscription date : 10 May 2010
Messages : 22
Ok, I get it.

Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] About Scooby-do's focus's smooth movement
eastfire English 2 eastfire [Read]
04 June 2010 à 04:53


Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques About Scooby-do's focus's smooth movement 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.