Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_border.c e_border.h e_container.c Log Message: Another netwm hint down! =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.234 retrieving revision 1.235 diff -u -3 -r1.234 -r1.235 --- e_border.c 3 Jun 2005 06:43:23 -0000 1.234 +++ e_border.c 3 Jun 2005 11:41:19 -0000 1.235 @@ -1430,8 +1430,35 @@ e_object_del(E_OBJECT(bd)); } -void e_border_icon_add(E_Border *bd, Evas *e) +/* FIXME: Prefer app icon or own icon? */ +Evas_Object * +e_border_icon_add(E_Border *bd, Evas *evas) { + Evas_Object *o; + + o = NULL; + if (bd->client.netwm.icon.data) + { + printf("icon size: %d %d\n", bd->client.netwm.icon.width, bd->client.netwm.icon.height); + o = e_icon_add(evas); + e_icon_data_set(o, bd->client.netwm.icon.data, + bd->client.netwm.icon.width, + bd->client.netwm.icon.height); + e_icon_alpha_set(o, 1); + } + else if ((bd->client.icccm.name) && (bd->client.icccm.class)) + { + E_App *a; + + a = e_app_window_name_class_find(bd->client.icccm.name, + bd->client.icccm.class); + if (a) + { + o = edje_object_add(evas); + edje_object_file_set(o, a->path, "icon"); + } + } + return o; } void @@ -2889,44 +2916,7 @@ if (pname) free(pname); if (pclass) free(pclass); if (nc_change) - { - E_App *a; - - a = NULL; - if (bd->icon_object) - { - evas_object_del(bd->icon_object); - bd->icon_object = NULL; - } - if ((bd->client.icccm.name) && (bd->client.icccm.class)) - { - printf("name: %s, class: %s\n", bd->client.icccm.name, bd->client.icccm.class); - a = e_app_window_name_class_find(bd->client.icccm.name, - bd->client.icccm.class); - if (a) - { - bd->icon_object = edje_object_add(bd->bg_evas); - edje_object_file_set(bd->icon_object, a->path, "icon"); - if (bd->bg_object) - { - evas_object_show(bd->icon_object); - edje_object_part_swallow(bd->bg_object, "icon_swallow", bd->icon_object); - } - else - { - evas_object_hide(bd->icon_object); - } - } - } - { - E_Event_Border_Icon_Change *ev; - - ev = calloc(1, sizeof(E_Event_Border_Icon_Change)); - ev->border = bd; - e_object_ref(E_OBJECT(bd)); - ecore_event_add(E_EVENT_BORDER_ICON_CHANGE, ev, _e_border_event_border_icon_change_free, NULL); - } - } + bd->changes.icon = 1; bd->client.icccm.fetch.name_class = 0; } if (bd->client.icccm.fetch.icon_name) @@ -2943,7 +2933,6 @@ bd->client.netwm.fetch.icon_name = 0; } - /* if (bd->client.netwm.fetch.icon) { if (bd->client.netwm.icon.data) free(bd->client.netwm.icon.data); @@ -2952,30 +2941,38 @@ &bd->client.netwm.icon.data, &bd->client.netwm.icon.size)) printf("ERROR: Fetch icon from client\n"); else + bd->changes.icon = 1; + bd->client.netwm.fetch.icon = 0; + } + if (bd->changes.icon) + { + if (bd->icon_object) + { + evas_object_del(bd->icon_object); + bd->icon_object = NULL; + } + + bd->icon_object = e_border_icon_add(bd, bd->bg_evas); + if (bd->bg_object) + { + evas_object_show(bd->icon_object); + edje_object_part_swallow(bd->bg_object, "icon_swallow", bd->icon_object); + } + else { - if (bd->icon_object) - { - evas_object_del(bd->icon_object); - bd->icon_object = NULL; - } - bd->icon_object = e_icon_add(bd->bg_evas); - e_icon_data_set(bd->icon_object, bd->client.netwm.icon.data, - bd->client.netwm.icon.width, bd->client.netwm.icon.height); - e_icon_alpha_set(bd->icon_object, 1); + evas_object_hide(bd->icon_object); + } - if (bd->bg_object) - { - evas_object_show(bd->icon_object); - edje_object_part_swallow(bd->bg_object, "icon_swallow", bd->icon_object); - } - else - { - evas_object_hide(bd->icon_object); - } + { + E_Event_Border_Icon_Change *ev; + + ev = calloc(1, sizeof(E_Event_Border_Icon_Change)); + ev->border = bd; + e_object_ref(E_OBJECT(bd)); + ecore_event_add(E_EVENT_BORDER_ICON_CHANGE, ev, _e_border_event_border_icon_change_free, NULL); } - bd->client.netwm.fetch.icon = 0; + bd->changes.icon = 0; } - */ if (bd->client.icccm.fetch.machine) { if (bd->client.icccm.machine) free(bd->client.icccm.machine); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.h,v retrieving revision 1.64 retrieving revision 1.65 diff -u -3 -r1.64 -r1.65 --- e_border.h 3 Jun 2005 06:43:23 -0000 1.64 +++ e_border.h 3 Jun 2005 11:41:19 -0000 1.65 @@ -252,16 +252,17 @@ Evas_List *pending_move_resize; struct { - unsigned int visible : 1; - unsigned int pos : 1; - unsigned int size : 1; - unsigned int stack : 1; - unsigned int prop : 1; - unsigned int border : 1; - unsigned int reset_gravity : 1; - unsigned int shading : 1; - unsigned int shaded : 1; - unsigned int shape : 1; + unsigned char visible : 1; + unsigned char pos : 1; + unsigned char size : 1; + unsigned char stack : 1; + unsigned char prop : 1; + unsigned char border : 1; + unsigned char reset_gravity : 1; + unsigned char shading : 1; + unsigned char shaded : 1; + unsigned char shape : 1; + unsigned char icon : 1; } changes; struct { @@ -408,7 +409,7 @@ EAPI void e_border_act_close_begin(E_Border *bd); EAPI void e_border_act_kill_begin(E_Border *bd); -EAPI void e_border_icon_add(E_Border *bd, Evas *e); +EAPI Evas_Object *e_border_icon_add(E_Border *bd, Evas *evas); EAPI void e_border_button_bindings_ungrab_all(void); EAPI void e_border_button_bindings_grab_all(void); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_container.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -3 -r1.65 -r1.66 --- e_container.c 3 Jun 2005 08:42:43 -0000 1.65 +++ e_container.c 3 Jun 2005 11:41:19 -0000 1.66 @@ -208,7 +208,10 @@ return con; } /* If noone is available, return the first */ - return (E_Container *)man->containers->data; + if (!man->containers) + return NULL; + l = man->containers; + return (E_Container *)l->data; } void ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs