From: <enl...@li...> - 2002-09-10 21:58:56
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : apps/e Dir : e17/apps/e/src Modified Files: Tag: SPLIT border.c border.h Log Message: Fix for updating the titles on borders. There are some extra shape events coming through now, which I'll track down later. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/border.c,v retrieving revision 1.72.2.6 retrieving revision 1.72.2.7 diff -u -3 -r1.72.2.6 -r1.72.2.7 --- border.c 8 Sep 2002 04:56:18 -0000 1.72.2.6 +++ border.c 10 Sep 2002 21:58:55 -0000 1.72.2.7 @@ -772,7 +772,7 @@ b = e_border_find_by_window(e->win); if (b) { - e_border_flush_evas(b, e->x, e->y, e->w, e->h); + e_border_redraw_region(b, e->x, e->y, e->w, e->h); } } current_ev = NULL; @@ -2121,7 +2121,7 @@ } void -e_border_flush_evas(E_Border * b, int x, int y, int w, int h) +e_border_redraw_region(E_Border * b, int x, int y, int w, int h) { GC gc; Evas_List *windows; @@ -2157,9 +2157,10 @@ e_border_update_render(E_Border * b) { GC gc1, gc2; - Evas_List *up; + Evas_List *up, *hp; Window window; Pixmap pmap, mask, temp; + int pl, pr, pt, pb; Evas_Engine_Info_Software_X11 *info; pmap = ecore_pixmap_new(b->win.b, b->current.w, b->current.h, 0); @@ -2176,7 +2177,17 @@ e_border_cleanup_window_list(b->windows); b->windows = NULL; - up = evas_render_updates(b->evas); + ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb); + + /* First get the shape masks for the outer border */ + evas_obscured_clear(b->evas); + evas_obscured_rectangle_add(b->evas, pl, pt, + b->current.w - pl - pr, + b->current.h - pt - pb); + + evas_damage_rectangle_add(b->evas, 0, 0, b->current.w, b->current.h); + hp = up = evas_render_updates(b->evas); + evas_obscured_clear(b->evas); while (up) { @@ -2212,14 +2223,15 @@ up = up->next; } - evas_render_updates_free(up); + evas_render_updates_free(hp); + ecore_gc_free(gc1); ecore_gc_free(gc2); ecore_pixmap_free(pmap); ecore_pixmap_free(mask); - e_border_flush_evas(b, 0, 0, b->current.w, b->current.h); + e_border_redraw_region(b, 0, 0, b->current.w, b->current.h); } void @@ -2335,10 +2347,6 @@ if (b->bits.b) { ebits_resize(b->bits.b, b->current.w, b->current.h); - evas_obscured_clear(b->evas); - evas_obscured_rectangle_add(b->evas, pl, pt, - b->current.w - pl - pr, - b->current.h - pt - pb); } e_icccm_move_resize(b->win.client, @@ -2350,24 +2358,42 @@ if ((b->client.title) && (b->bits.b)) { double tx, ty, tw, th; + double ox, oy, ow, oh; ebits_get_named_bit_geometry(b->bits.b, "Title_Area", &tx, &ty, &tw, &th); if (b->obj.title) { - e_text_set_text(b->obj.title, b->client.title); - e_text_move(b->obj.title, tx, ty); + if (strcmp(b->client.title, b->obj.title->text)) + { + e_text_set_text(b->obj.title, b->client.title); + b->shape_changed = 1; + } + e_text_get_geometry(b->obj.title, &ox, &oy, &ow, &oh); + if (tx != ox || ty != oy) + { + e_text_move(b->obj.title, tx, ty); + b->shape_changed = 1; + } if (b->current.selected) e_text_set_state(b->obj.title, "selected"); else e_text_set_state(b->obj.title, "normal"); } - evas_object_move(b->obj.title_clip, tx, ty); - evas_object_resize(b->obj.title_clip, tw, th); + evas_object_geometry_get(b->obj.title_clip, &ox, &oy, &ow, &oh); + if (tx != ox || ty != oy || tw != ow || th != oh) + { + evas_object_move(b->obj.title_clip, tx, ty); + evas_object_resize(b->obj.title_clip, tw, th); + b->shape_changed = 1; + } - if (b->obj.title) - e_text_set_layer(b->obj.title, 1); + if (b->obj.title && b->obj.title->layer != 1) + { + e_text_set_layer(b->obj.title, 1); + b->shape_changed = 1; + } } if (visibility_changed) { =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/border.h,v retrieving revision 1.19.2.4 retrieving revision 1.19.2.5 diff -u -3 -r1.19.2.4 -r1.19.2.5 --- border.h 8 Sep 2002 04:56:18 -0000 1.19.2.4 +++ border.h 10 Sep 2002 21:58:55 -0000 1.19.2.5 @@ -224,8 +224,8 @@ E_Border *e_border_new(void); void e_border_update_borders(void); -void e_border_flush_evas(E_Border *b, int x, int y, - int w, int h); +void e_border_redraw_region(E_Border *b, int x, int y, + int w, int h); void e_border_update_render(E_Border * b); void e_border_apply_border(E_Border * b); void e_border_reshape(E_Border * b); |