raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=892f4abe3742736dbb02817449da1dd52056ac7f

commit 892f4abe3742736dbb02817449da1dd52056ac7f
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sun Nov 27 22:50:03 2016 +0900

    efl ui win - stop trying to get data of non-image icons
    
    x11 updates trying to update x properties from image data when icon is
    not an image is causing lots of error spam. fix this to check type
    first before getting data.
---
 src/lib/elementary/efl_ui_win.c | 57 ++++++++++++++++++++++-------------------
 1 file changed, 30 insertions(+), 27 deletions(-)

diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 499e2d8..7a61c70 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -3127,42 +3127,45 @@ _elm_win_xwin_update(Efl_Ui_Win_Data *sd)
      {
         void *data;
 
-        data = evas_object_image_data_get(sd->icon, EINA_FALSE);
-        if (data)
+        if (efl_isa(sd->icon, EFL_CANVAS_IMAGE_CLASS))
           {
-             Ecore_X_Icon ic;
-             int w = 0, h = 0, stride, x, y;
-             unsigned char *p;
-             unsigned int *p2;
-
-             evas_object_image_size_get(sd->icon, &w, &h);
-             stride = evas_object_image_stride_get(sd->icon);
-             if ((w > 0) && (h > 0) &&
-                 (stride >= (int)(w * sizeof(unsigned int))))
+             data = evas_object_image_data_get(sd->icon, EINA_FALSE);
+             if (data)
                {
-                  ic.width = w;
-                  ic.height = h;
-                  ic.data = malloc(w * h * sizeof(unsigned int));
-
-                  if (ic.data)
+                  Ecore_X_Icon ic;
+                  int w = 0, h = 0, stride, x, y;
+                  unsigned char *p;
+                  unsigned int *p2;
+
+                  evas_object_image_size_get(sd->icon, &w, &h);
+                  stride = evas_object_image_stride_get(sd->icon);
+                  if ((w > 0) && (h > 0) &&
+                      (stride >= (int)(w * sizeof(unsigned int))))
                     {
-                       p = (unsigned char *)data;
-                       p2 = (unsigned int *)ic.data;
-                       for (y = 0; y < h; y++)
+                       ic.width = w;
+                       ic.height = h;
+                       ic.data = malloc(w * h * sizeof(unsigned int));
+
+                       if (ic.data)
                          {
-                            for (x = 0; x < w; x++)
+                            p = (unsigned char *)data;
+                            p2 = (unsigned int *)ic.data;
+                            for (y = 0; y < h; y++)
                               {
-                                 *p2 = *((unsigned int *)p);
-                                 p += sizeof(unsigned int);
-                                 p2++;
+                                 for (x = 0; x < w; x++)
+                                   {
+                                      *p2 = *((unsigned int *)p);
+                                      p += sizeof(unsigned int);
+                                      p2++;
+                                   }
+                                 p += (stride - (w * sizeof(unsigned int)));
                               }
-                            p += (stride - (w * sizeof(unsigned int)));
+                            ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
+                            free(ic.data);
                          }
-                       ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
-                       free(ic.data);
                     }
+                  evas_object_image_data_set(sd->icon, data);
                }
-             evas_object_image_data_set(sd->icon, data);
           }
      }
 

-- 


Reply via email to