raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=04265d3b9fe3cd0817c3fa562c77adf7dd2bbded

commit 04265d3b9fe3cd0817c3fa562c77adf7dd2bbded
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Mon Jan 27 08:21:28 2014 +0900

    bugfix: potential/maybe fix of e checking for itself on startup
    
    unknown if this fixes the issue as i can't reproduce it.
---
 src/bin/e_hints.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c
index d32c7f0..e0986ce 100644
--- a/src/bin/e_hints.c
+++ b/src/bin/e_hints.c
@@ -134,35 +134,47 @@ e_hints_init(Ecore_Window root, Ecore_Window propwin)
         twin = win;
         for (;; )
           {
+             Ecore_X_Window selfwin = 0;
+             
+             /* check that supporting wm win points to itself to be valid */
+             nwins = ecore_x_window_prop_window_get(twin,
+                                                    
ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
+                                                    &selfwin, 1);
              if (nwins < 1) break;
-             if (twin != win) break;
+             if (selfwin != twin) break;
+             /* check the wm is e */
              if (ecore_x_netwm_name_get(twin, &name))
                {
                   if (name)
                     {
+                       /* if it is NOT e - don't care here as all this code is 
dealing with e restarts */
                        if (strcmp(name, "Enlightenment"))
                          {
                             free(name);
                             break;
                          }
-                       nwins = ecore_x_window_prop_window_get(root,
-                                                              
ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
-                                                              &twin, 1);
-                       if (nwins < 1) break;
                        free(name);
                     }
+                  /* no name - not e - don't care */
+                  else
+                    break;
                }
              else
-               if (ecore_x_error_code_get()) break; //some dead window
+               /* can't get name - obviously not e */
+               break;
+             /* have we been spinning too long? 2 sec */
              if ((ecore_time_get() - ts) > 2.0)
                {
                   e_error_message_show(_("A previous instance of Enlightenment 
is still active\n"
                                          "on this screen. Aborting 
startup.\n"));
                   exit(1);
                }
+             /* get/check agan */
              nwins = ecore_x_window_prop_window_get(root,
                                                     
ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
                                                     &twin, 1);
+             if (nwins < 1) break;
+             if (twin != win) break;
           }
      }
 

-- 


Reply via email to