Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_hints.c 


Log Message:


be patient and wait for the previous e to be cleaned up with a loops checking
for the old e.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_hints.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -3 -r1.91 -r1.92
--- e_hints.c   1 Sep 2006 22:42:11 -0000       1.91
+++ e_hints.c   10 Dec 2006 03:55:18 -0000      1.92
@@ -92,15 +92,51 @@
 
        for (i = 0; i < num; i++)
          {
-            Ecore_X_Window win;
+            Ecore_X_Window win, twin;
+            int nwins;
+            char *name;
+            double ts;
+            
+            /* check for previous netwm wm and wait for it to die */
+            ts = ecore_time_get();
+            nwins = ecore_x_window_prop_window_get(roots[i], 
+                                                   
ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK, 
+                                                   &win, 1);
+            if (nwins > 0)
+              {
+                 for (;;)
+                   {
+                      nwins = ecore_x_window_prop_window_get(win, 
+                                                             
ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK, 
+                                                             &twin, 1);
+                      if (nwins < 1) break;
+                      if (twin != win) break;
+                      if (ecore_x_netwm_name_get(win, &name))
+                        {
+                           if (strcmp(name, "Enlightenment"))
+                             {
+                                free(name);
+                                break;
+                             }
+                           free(name);
+                        }
+                      ecore_x_sync();
+                      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);
+                        }
+                   }
+              }
 
             win = ecore_x_window_new(roots[i], -200, -200, 5, 5);
 /*          
- * I don't FUCKING believe it. if we PRETENT we are Kwin - java is happy.
+ * I don't FUCKING believe it. if we PRETEND we are Kwin - java is happy.
  * why? it expects a double reparenting wm then. java insists on finding this
  * out when it should be irrelevant! stupid code! I can't believe the time we
  * just wasted hunting a bug that wasn't and that is due to sheer stupid
- * coding.
+ * coding (in java's awt layer that swing also uses).
  */
 /* Now for more stupidity... Openoffice.org will change its look and feel 
  * depending on what wm it thinks there is... so if we pretend to be Kwin...



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to