Enlightenment CVS committal

Author  : handyande
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/pager


Modified Files:
        e_mod_main.c e_mod_main.h 


Log Message:
Pager updates
 - a few patches, leak fixes
 - reset click detection for desk selection - should be better behaved now
 - added a small bit of themeing
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/pager/e_mod_main.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_mod_main.c        10 Jan 2005 11:01:45 -0000      1.4
+++ e_mod_main.c        10 Jan 2005 18:59:04 -0000      1.5
@@ -177,7 +177,9 @@
    free(e->conf);
    E_CONFIG_DD_FREE(e->conf_edd);
 
+   evas_object_hide(e->base);
    evas_object_free(e->base);
+   evas_object_hide(e->screen);
    evas_object_free(e->screen);
 
    while(e->desks)
@@ -208,7 +210,6 @@
    
    mi = e_menu_item_new(mn);
    e_menu_item_label_set(mi, "(Unused)");
-/*   e_menu_item_callback_set(mi, _pager_cb_scale, e);*/
    e->config_menu = mn;
    
    return mn;
@@ -243,7 +244,7 @@
    Evas_List   *clients;
 
    Evas_Object *desk_obj, *win_obj;
-   int          desks_x, desks_y, x, y;
+   int          desks_x, desks_y, x, y, top, toptmp;
    Evas_Coord   px, py, pw, ph, ww, hh;
    double       scalex, scaley;
 
@@ -280,8 +281,6 @@
          desk = e_desk_at_xy_get(zone, x, y);
          px = e->fx + (x * pw);
          py = e->fy + (y * ph);
-         if (desk == current)
-           evas_object_move(e->screen, px, py);
          desk_obj = edje_object_add(e->evas);
          edje_object_file_set(desk_obj,
                               /* FIXME: "default.eet" needs to come from conf 
*/
@@ -292,6 +291,7 @@
          evas_object_move(desk_obj, px, py);
 
          evas_object_show(desk_obj);
+         top = evas_object_layer_get(desk_obj);
          e->desks = evas_list_append(e->desks, desk_obj);
 
          clients = desk->clients;
@@ -314,10 +314,18 @@
               evas_object_move(win_obj, px + winx, py + winy);
 
               evas_object_show(win_obj);
+              toptmp = evas_object_layer_get(win_obj);
+              if (toptmp > top)
+                top = toptmp;
               e->wins = evas_list_append(e->wins, win_obj);
 
               clients = clients->next;
            }
+         if (desk == current)
+           {
+              evas_object_move(e->screen, px, py);
+              evas_object_layer_set(e->screen, top + 1);
+           }
        }
 }
 
@@ -345,6 +353,8 @@
        p->move = 1;
      }
    evas_pointer_canvas_xy_get(p->evas, &p->xx, &p->yy);
+   p->clickhackx = p->xx;
+   p->clickhacky = p->yy;
 }
 
 static void
@@ -352,18 +362,14 @@
 {
    Evas_Event_Mouse_Up *ev;
    Pager     *p;
-   Evas_Coord ww, hh;
-   double     newx, newy;
+   Evas_Coord xx, yy, ww, hh;
    
    ev = event_info;
    p = data;
 
    evas_output_viewport_get(p->evas, NULL, NULL, &ww, &hh);
    /* if we clicked, not moved - FIXME, this is a hack */
-   newx = (double)p->fx / (double)(ww - p->fw);
-   newy = (double)p->fy / (double)(hh - p->fh);
-printf("saving %g, %g\n", newx, newy);
-   if (p->move && (p->conf->x == newx) && (p->conf->y == newy))
+   if (p->move && (p->xx == p->clickhackx) && (p->yy == p->clickhacky))
      {
        int     x, y, w, h, xcount, ycount, cx, cy;
        E_Zone *zone;
@@ -397,8 +403,8 @@
 
    p->conf->width = p->fw;
    p->conf->height = p->fh;
-   p->conf->x = newx;
-   p->conf->y = newy;
+   p->conf->x = (double)p->fx / (double)(ww - p->fw);
+   p->conf->y = (double)p->fy / (double)(hh - p->fh);
    e_config_save_queue();
 
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/pager/e_mod_main.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_mod_main.h        9 Jan 2005 23:39:19 -0000       1.2
+++ e_mod_main.h        10 Jan 2005 18:59:04 -0000      1.3
@@ -25,6 +25,9 @@
    Ecore_Event_Handler *ev_handler_container_resize;
    Evas_Coord    fx, fy, fw, fh;
    Evas_Coord    xx, yy;
+
+   /* FIXME: want to fix click detection once leftdrag is not used */
+   Evas_Coord    clickhackx, clickhacky;
 };
 
 EAPI void *init     (E_Module *m);




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to