--- e_border.c.~1.215.~	2005-05-20 08:22:31.000000000 +0200
+++ e_border.c	2005-05-20 11:04:50.000000000 +0200
@@ -6,6 +6,8 @@
 //#define INOUTDEBUG_MOUSE 1
 //#define INOUTDEBUG_FOCUS 1
 
+#define FOCUS_SETTING 0
+
 #define RESIZE_NONE 0
 #define RESIZE_TL   1
 #define RESIZE_T    2
@@ -305,6 +307,21 @@
    bd->changes.size = 1;
    bd->changes.shape = 1;
 
+   bd->take_focus = 0;
+   if (FOCUS_SETTING == 1) {
+       bd->take_focus = 1;
+   }
+   else if (FOCUS_SETTING == 2) {
+       if (ecore_x_icccm_transient_for_get(win))
+           bd->take_focus = 1;
+   }
+   else if (FOCUS_SETTING == 3) {
+       Ecore_X_Window owner = ecore_x_icccm_transient_for_get(win);
+
+       if (owner && owner == ecore_x_window_focus_get())
+           bd->take_focus = 1;
+   }
+
    printf("##- ON MAP CLIENT 0x%x SIZE %ix%i\n",
 	  bd->client.win, bd->client.w, bd->client.h);
 
@@ -3397,6 +3414,11 @@
 	bd->need_shape_export = 0;
      }
 
+   if (bd->take_focus) {
+       bd->take_focus = 0;
+       e_border_focus_set(bd, 1, 1);
+   }
+
    bd->changed = 0;
 
    bd->changes.stack = 0;
