ecore: fix removal of windows from ignore_list with ecore_x_window_ignore_set
authorjeffdameth <jeffdameth@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 11 Apr 2011 12:10:59 +0000 (12:10 +0000)
committerjeffdameth <jeffdameth@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 11 Apr 2011 12:10:59 +0000 (12:10 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@58549 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_x/xlib/ecore_x_window.c

index f8e730b..f13652b 100644 (file)
@@ -308,7 +308,7 @@ ecore_x_window_free(Ecore_X_Window win)
 EAPI void
 ecore_x_window_ignore_set(Ecore_X_Window win, int ignore)
 {
-   int i, j;
+   int i, j, cnt;
    Ecore_X_Window *t;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -339,13 +339,14 @@ ecore_x_window_ignore_set(Ecore_X_Window win, int ignore)
         if (!ignore_list)
            return;
 
-        for (i = 0, j = 0; i < ignore_num; i++)
+        for (cnt = ignore_num, i = 0, j = 0; i < cnt; i++)
           {
              if (win != ignore_list[i])
-                ignore_list[i] = ignore_list[j++];
+              ignore_list[j++] = ignore_list[i];
              else
-                ignore_num--;
+              ignore_num--;
           }
+
         if (ignore_num <= 0)
           {
              free(ignore_list);