Hola,

I don't think this code should be removed (no mierda aquí).

It's purpose is to add an animation (when enabled from WPrefs) to appicon.
If the dock contains already that application, there is a animation
from the appicon window created on the left-botton to the position in
the dock.

I first thought the code was buggy in the src/misc.c SlideWindows() function,
but in fact it's just the default DELAY value which is set to 0.

So the code below runs too fast for our poor eyes, sleep 10
microseconds between each move steps...

241 if (slide_delay > 0) {
242 wusleep(slide_delay * 1000L);
243 } else {
244 wusleep(10);
245 }


Change the 10 to 10000, and move your dock on the right side.
You should be able to see something ;)

Anyway, maybe the default delay value should be updated ?



saludos,
david

On Tue, Aug 26, 2014 at 3:58 AM, Rodolfo García Peñas (kix) <[email protected]> wrote:
> This is test-patch only. It show the possition for this temporal icon.
>
> Probably, the old idea was show the icon in the minimized icon list and
> then move the icon to the Dock/Clip/Drawer possition for that icon.
>
> To test it:
>
> - Appicon are painted left-bottom
> - Clip is used
> - Apply the patch, compile, install and restart wmaker.
>
> 1. Launch a xcalc
> 2. Move the appicon to the Clip and attach to it
> 3. Close the xcalc
> 4. Open a terminal
> 5. Exec "xcalc" in the terminal -> The icon is painted in the next
>    possion in the appicon list "x - 10"x"y + 10" using this line:
>      wAppIconMove(aicon, x0 - 10, y0   10);
> 6. The icon is destroyed after the sleep.
>
> Then, we have two options:
>
> 1. Remove this code
> 2. Change the code to animate it and move to the Dock/Drawer/Clip.
>
> IMO, this code is shit (mierdaza in spanish) and could be removed.
> We spent a lot of calls, make the icon functions harder, the code
> abstration is worse, because we are creating and painting, unpainting
> and destroying an icon ONLY to show how the icon is moved from one
> possition in the screen to other possition.
>
> Thanks for reading.
> kix
>
> PS. I added an small piece of song to make the patch more beatiful ;-)
> ---
>  src/dock.c | 53 +++++++++++++++++++++++++++++++++--------------------
>  1 file changed, 33 insertions(+), 20 deletions(-)
>
> diff --git a/src/dock.c b/src/dock.c
> index e837280..c9248bf 100644
> --- a/src/dock.c
> +++ b/src/dock.c
> @@ -3195,6 +3195,38 @@ WAppIcon *wDockFindIconForWindow(WDock *dock, Window 
> window)
>         return NULL;
>  }
>
> +void mierdaza(WDock *dock, WAppIcon *icon, char *wm_class, char *wm_instance)
> +{
> +       WAppIcon *aicon;
> +       int x0, y0;
> +
> +       icon->launching = 1;
> +       dockIconPaint(icon);
> +
> +       aicon = wAppIconCreateForDock(dock->screen_ptr, NULL,
> +                                     wm_instance, wm_class, TILE_NORMAL);
> +       /* XXX: can: aicon->icon == NULL ? */
> +       PlaceIcon(dock->screen_ptr, &x0, &y0, 
> wGetHeadForWindow(aicon->icon->owner));
> +       wAppIconMove(aicon, x0 - 10, y0   10); /* kix: changed for testing */
> +
> +       /* Should this always be lowered? -Dan */
> +       if (dock->lowered)
> +               wLowerFrame(aicon->icon->core);
> +
> +       printf("Solía hablarle de tí y de tus ojos anochecer.\n");
> +       printf("Jamás pensamos en ser, nada más que jóvenes.\n");
> +       printf("Vimos los barcos partir, sin despedirnos de ella,\n");
> +       printf("como si fuésemos sueños dentro de botellas.\n");
> +       XMapWindow(dpy, aicon->icon->core->window);
> +       XSync(dpy, 0); /* kix: added for testing */
> +       sleep(5); /* kix: added for testing */
> +       aicon->launching = 1;
> +       wAppIconPaint(aicon);
> +       SlideWindow(aicon->icon->core->window, x0, y0, icon->x_pos, 
> icon->y_pos);
> +       XUnmapWindow(dpy, aicon->icon->core->window);
> +       wAppIconDestroy(aicon);
> +}
> +
>  void wDockTrackWindowLaunch(WDock *dock, Window window)
>  {
>         WAppIcon *icon;
> @@ -3252,26 +3284,7 @@ void wDockTrackWindowLaunch(WDock *dock, Window window)
>                         found = True;
>                         if (!wPreferences.no_animations && !icon->launching &&
>                             !dock->screen_ptr->flags.startup && 
> !dock->collapsed) {
> -                               WAppIcon *aicon;
> -                               int x0, y0;
> -
> -                               icon->launching = 1;
> -                               dockIconPaint(icon);
> -
> -                               aicon = 
> wAppIconCreateForDock(dock->screen_ptr, NULL,
> -                                                             wm_instance, 
> wm_class, TILE_NORMAL);
> -                               /* XXX: can: aicon->icon == NULL ? */
> -                               PlaceIcon(dock->screen_ptr, &x0, &y0, 
> wGetHeadForWindow(aicon->icon->owner));
> -                               wAppIconMove(aicon, x0, y0);
> -                               /* Should this always be lowered? -Dan */
> -                               if (dock->lowered)
> -                                       wLowerFrame(aicon->icon->core);
> -                               XMapWindow(dpy, aicon->icon->core->window);
> -                               aicon->launching = 1;
> -                               wAppIconPaint(aicon);
> -                               SlideWindow(aicon->icon->core->window, x0, 
> y0, icon->x_pos, icon->y_pos);
> -                               XUnmapWindow(dpy, aicon->icon->core->window);
> -                               wAppIconDestroy(aicon);
> +                               mierdaza(dock, icon, wm_class, wm_instance);
>                         }
>                         wDockFinishLaunch(icon);
>                         break;
> --
> 2.0.1
>
>
> --
> To unsubscribe, send mail to [email protected].


--
To unsubscribe, send mail to [email protected].

Reply via email to