Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_border.c e_border.h e_config.c e_config.h e_desk.c e_desk.h 


Log Message:


make click to focus behave a bit better - previously focused windwo gets the
focus now always - even in pointer focus. if flippign desktosp last window
focused on that desktop is focused bakc when u flip - they are options too :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.329
retrieving revision 1.330
diff -u -3 -r1.329 -r1.330
--- e_border.c  12 Jul 2005 08:57:02 -0000      1.329
+++ e_border.c  12 Jul 2005 11:07:57 -0000      1.330
@@ -576,13 +576,6 @@
        _e_border_resize_end(bd);
      }
    
-   if (!bd->need_reparent)
-     {
-       if (bd->focused)
-//       ecore_x_window_focus(bd->zone->container->manager->root);
-         e_grabinput_focus(bd->zone->container->bg_win, 
E_FOCUS_METHOD_PASSIVE);
-       ecore_x_window_hide(bd->client.win);
-     }
    e_container_shape_hide(bd->shape);
    /* FIXME: If the client unmaps itself, the border should be
     * withdrawn, not iconic */
@@ -592,6 +585,17 @@
    bd->visible = 0;
    bd->changes.visible = 1;
 
+   if (!bd->need_reparent)
+     {
+       if (bd->focused)
+         {
+            e_border_focus_set(bd, 0, 1);
+            if (e_config->focus_revert_on_hide_or_close)
+              e_desk_last_focused_focus(bd->desk);
+         }
+       ecore_x_window_hide(bd->client.win);
+     }
+   
    visible = 0;
    ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_MAPPED, &visible, 1);
    if (!manage)
@@ -853,6 +857,12 @@
    E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
    if ((focus) && (!bd->focused))
      {
+       if ((bd->visible) && (bd->changes.visible))
+         {
+            bd->want_focus = 1;
+            bd->changed = 1;
+            return;
+         }
        if (!e_winlist_active_get())
          {
             focus_stack = evas_list_remove(focus_stack, bd);
@@ -1901,6 +1911,11 @@
 static void
 _e_border_free(E_Border *bd)
 {
+   if (bd->focused)
+     {
+       if (e_config->focus_revert_on_hide_or_close)
+         e_desk_last_focused_focus(bd->desk);
+     }
    if (resize == bd)
      _e_border_resize_end(bd);
    if (move == bd)
@@ -2908,10 +2923,7 @@
 
    e = ev;
    if (!move) return 1;
-
-   printf("warp: %d %d %d %d\n", e->curr.x, e->prev.x, e->curr.y, e->prev.y);
    e_border_move(move, move->x + (e->curr.x - e->prev.x), move->y + (e->curr.y 
- e->prev.y));
-
    return 1;
 }
 
@@ -4709,16 +4721,15 @@
          }
        bd->need_shape_export = 0;
      }
-   
-   if (bd->take_focus)
+
+   if ((bd->take_focus) || (bd->want_focus))
      {
-       if (e_config->focus_setting == E_FOCUS_NEW_WINDOW)
+       if ((e_config->focus_setting == E_FOCUS_NEW_WINDOW) ||
+           (bd->want_focus))
          {
             if (!bd->lock_focus_out)
-              {
-                 printf("noo\n");
-                 e_border_focus_set(bd, 1, 1);
-              }
+              e_border_focus_set(bd, 1, 1);
+            bd->want_focus = 0;
          }
        else
          {
@@ -4732,7 +4743,6 @@
                    {
                       if (!bd->lock_focus_out)
                         {
-                           printf("noo2\n");
                            e_border_focus_set(bd, 1, 1);
                         }
                    }
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.h,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -3 -r1.93 -r1.94
--- e_border.h  11 Jul 2005 09:19:17 -0000      1.93
+++ e_border.h  12 Jul 2005 11:07:57 -0000      1.94
@@ -285,6 +285,7 @@
    unsigned int    ping_ok : 1;
    unsigned int    hung : 1;
    unsigned int    take_focus : 1;
+   unsigned int    want_focus : 1;
    unsigned int    user_skip_winlist : 1;
    E_Maximize      maximized;
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -3 -r1.79 -r1.80
--- e_config.c  10 Jul 2005 23:26:50 -0000      1.79
+++ e_config.c  12 Jul 2005 11:07:57 -0000      1.80
@@ -244,8 +244,10 @@
    E_CONFIG_VAL(D, T, transition_desk, STR); /**/
    E_CONFIG_VAL(D, T, transition_change, STR); /**/
    E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd);
-   E_CONFIG_VAL(D, T, move_info_follows, INT); /**/
-   E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
+   E_CONFIG_VAL(D, T, move_info_follows, INT);
+   E_CONFIG_VAL(D, T, resize_info_follows, INT);
+   E_CONFIG_VAL(D, T, focus_last_focused_per_desktop, INT);
+   E_CONFIG_VAL(D, T, focus_revert_on_hide_or_close, INT);
    
    e_config = e_config_domain_load("e", _e_config_edd);
    if (e_config)
@@ -348,6 +350,9 @@
        e_config->transition_change = strdup("crossfade");
        e_config->move_info_follows = 1;
        e_config->resize_info_follows = 1;
+       e_config->focus_last_focused_per_desktop = 1;
+       e_config->focus_revert_on_hide_or_close = 1;
+       
          {
             E_Config_Module *em;
 
@@ -877,6 +882,10 @@
    E_CONFIG_LIMIT(e_config->kill_timer_wait, 0.0, 120.0);
    E_CONFIG_LIMIT(e_config->ping_clients, 0, 1);
    E_CONFIG_LIMIT(e_config->ping_clients_wait, 0.0, 120.0);
+   E_CONFIG_LIMIT(e_config->move_info_follows, 0, 1);
+   E_CONFIG_LIMIT(e_config->resize_info_follows, 0, 1);
+   E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1);
+   E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1);
 
    /* apply lang config - exception because config is loaded after intl setup 
*/
    
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- e_config.h  9 Jul 2005 15:37:28 -0000       1.40
+++ e_config.h  12 Jul 2005 11:07:57 -0000      1.41
@@ -47,7 +47,7 @@
  * defaults for e to work - started at 100 when we introduced this config
  * versioning feature
  */
-#define E_CONFIG_FILE_VERSION 118
+#define E_CONFIG_FILE_VERSION 119
 
 #define E_EVAS_ENGINE_DEFAULT      0
 #define E_EVAS_ENGINE_SOFTWARE_X11 1
@@ -137,6 +137,8 @@
    Evas_List  *remembers;
    int         move_info_follows;
    int         resize_info_follows;
+   int         focus_last_focused_per_desktop;
+   int         focus_revert_on_hide_or_close;
 };
 
 struct _E_Config_Module
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_desk.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- e_desk.c    1 Jul 2005 11:05:48 -0000       1.42
+++ e_desk.c    12 Jul 2005 11:07:57 -0000      1.43
@@ -83,6 +83,7 @@
    int                was_zone = 0;
    int                x, y;
    E_Event_Desk_Show *ev;
+   Evas_List         *l;
 
    E_OBJECT_CHECK(desk);
    E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE);
@@ -118,7 +119,10 @@
          }
      }
    e_container_border_list_free(bl);
-   
+
+   if (e_config->focus_last_focused_per_desktop)
+     e_desk_last_focused_focus(desk);
+       
    desk->zone->desk_x_current = desk->x;
    desk->zone->desk_y_current = desk->y;
    if (desk->fullscreen)
@@ -142,6 +146,26 @@
 }
 
 void
+e_desk_last_focused_focus(E_Desk *desk)
+{
+   Evas_List *l;
+   E_Border *bd;
+   
+   for (l = e_border_focus_stack_get(); l; l = l->next)
+     {
+       bd = l->data;
+       if ((!bd->iconic) && (bd->visible) &&
+           (((bd->desk == desk) ||
+             ((bd->sticky) && (bd->zone == desk->zone)))))
+         {
+            /* this was the window last focused in this desktop */
+            e_border_focus_set(bd, 1, 1);
+            break;
+         }
+     }
+}
+
+void
 e_desk_fullscreen_set(E_Desk *desk, E_Border *bd)
 {
    if ((!desk->fullscreen) && (bd))
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_desk.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- e_desk.h    1 Jul 2005 10:07:25 -0000       1.17
+++ e_desk.h    12 Jul 2005 11:07:57 -0000      1.18
@@ -39,6 +39,7 @@
 EAPI E_Desk      *e_desk_new(E_Zone *zone, int x, int y);
 EAPI void         e_desk_name_set(E_Desk *desk, const char *name);
 EAPI void         e_desk_show(E_Desk *desk);
+EAPI void         e_desk_last_focused_focus(E_Desk *desk);
 EAPI void         e_desk_fullscreen_set(E_Desk *desk, E_Border *bd);
 EAPI E_Desk      *e_desk_current_get(E_Zone *zone);
 EAPI E_Desk      *e_desk_at_xy_get(E_Zone *zone, int x, int y);




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to