32
32
if (bRedrawSurface) // group has changed -> update the icon and label
34
if (! cShortGroupName)
36
cShortGroupName = myData.cShortGroupName;
40
g_free (myData.cShortGroupName);
41
myData.cShortGroupName = g_strdup (cShortGroupName);
45
cGroupName = myData.cGroupName;
49
g_free (myData.cGroupName);
50
myData.cGroupName = g_strdup (cGroupName);
53
34
//\__________________ On sauvegarde l'ancienne surface/texture.
54
35
cairo_dock_free_image_buffer (myData.pOldImage);
55
36
myData.pOldImage = myData.pCurrentImage;
56
37
myData.pCurrentImage = NULL;
38
/**if (myData.pOldSurface != NULL)
39
cairo_surface_destroy (myData.pOldSurface);
40
if (myData.pOldImage->iure != 0)
41
_cairo_dock_delete_texture (myData.pOldImage->iure);
42
myData.pOldSurface = myData.pCurrentSurface;
43
myData.pOldImage->iure = myData.pCurrentImage->iure;
44
myData.pOldImage->iWidth = myData.pCurrentImage->iWidth;
45
myData.pOldImage->iHeight = myData.pCurrentImage->iHeight;*/
58
47
//\__________________ On cree la nouvelle surface (la taille du texte peut avoir change).
59
48
int iWidth, iHeight;
60
49
CD_APPLET_GET_MY_ICON_EXTENT (&iWidth, &iHeight);
61
50
if (iWidth <= 1 && iHeight <= 1) // peut arriver au lancement en mode desklet.
52
/**myData.pCurrentSurface = NULL;
53
myData.pCurrentImage->iure = 0;
54
myData.pCurrentImage->iWidth = 0;
55
myData.pCurrentImage->iHeight = 0;*/
71
64
myData.pCurrentImage = g_new0 (CairoDockImageBuffer, 1);
72
65
cairo_dock_load_image_buffer_from_surface (myData.pCurrentImage, pSurface, w, h);
66
/**myData.pCurrentSurface = cairo_dock_create_surface_from_text_full (cShortGroupName,
67
&myConfig.textDescription,
70
&myData.pCurrentImage->iWidth, &myData.pCurrentImage->iHeight);
71
cd_debug ("KEYBOARD: %dx%d / %dx%d", myData.pCurrentImage->iWidth, myData.pCurrentImage->iHeight, myIcon->image.iWidth, myIcon->image.iHeight);
74
myData.pCurrentImage->iure = cairo_dock_create_texture_from_surface (myData.pCurrentSurface);
74
77
//\__________________ On lance une transition entre ancienne et nouvelle surface/texture, ou on dessine direct.
75
78
if (myConfig.iTransitionDuration != 0 && myData.pOldImage != NULL)