Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: E.h borders.c ewmh.c hints.c iclass.c snaps.c Log Message: Fix crash on large client windows (dimension > 8192 pixels). =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v retrieving revision 1.453 retrieving revision 1.454 diff -u -3 -r1.453 -r1.454 --- E.h 12 Jun 2005 07:56:28 -0000 1.453 +++ E.h 12 Jun 2005 13:09:10 -0000 1.454 @@ -754,6 +754,7 @@ unsigned vroot:1; /* Virtual root window */ unsigned inhibit_iconify:1; unsigned autosave:1; + unsigned no_border:1; /* Never apply border */ } props; struct { @@ -1249,8 +1250,7 @@ void EwinBorderUpdateState(EWin * ewin); void EwinBorderEventsConfigure(EWin * ewin, int mode); void EwinSetBorder(EWin * ewin, const Border * b, int apply); -void EwinSetBorderByName(EWin * ewin, const char *name, - int apply); +void EwinSetBorderByName(EWin * ewin, const char *name); void BorderWinpartChange(EWin * ewin, int i, int force); int BorderWinpartIndex(EWin * ewin, Window win); Border *BorderCreateFiller(int left, int right, int top, =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v retrieving revision 1.263 retrieving revision 1.264 diff -u -3 -r1.263 -r1.264 --- borders.c 2 Jun 2005 19:01:55 -0000 1.263 +++ borders.c 12 Jun 2005 13:09:11 -0000 1.264 @@ -418,13 +418,19 @@ { const Border *b; - /* Quit if we allready have a border that isn't an internal one */ +#if 0 /* Handled in iclass.c */ + /* Imlib2 will not render pixmaps with dimensions > 8192 */ + if (ewin->client.w > 8000 || ewin->client.h > 8000) + ewin->props.no_border = 1; +#endif + + /* Quit if we already have a border that isn't an internal one */ b = ewin->border; - if (b && strncmp(b->name, "__", 2)) + if (b && strncmp(b->name, "__", 2) && !ewin->props.no_border) goto done; - if ((!ewin->client.mwm_decor_title && !ewin->client.mwm_decor_border) || - (Conf.dock.enable && ewin->docked)) + if (ewin->props.no_border || ewin->docked || + (!ewin->client.mwm_decor_title && !ewin->client.mwm_decor_border)) b = FindItem("BORDERLESS", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER); else b = WindowMatchEwinBorder(ewin); @@ -567,7 +573,7 @@ void EwinSetBorder(EWin * ewin, const Border * b, int apply) { - if (!b || ewin->border == b) + if (!b || ewin->border == b || ewin->props.no_border) return; if (apply) @@ -590,13 +596,13 @@ } void -EwinSetBorderByName(EWin * ewin, const char *name, int apply) +EwinSetBorderByName(EWin * ewin, const char *name) { Border *b; b = (Border *) FindItem(name, 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER); - EwinSetBorder(ewin, b, apply); + EwinSetBorder(ewin, b, 0); } Border * =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -3 -r1.72 -r1.73 --- ewmh.c 12 Jun 2005 08:03:19 -0000 1.72 +++ ewmh.c 12 Jun 2005 13:09:11 -0000 1.73 @@ -546,7 +546,7 @@ #endif ewin->skipfocus = 1; ewin->fixedpos = 1; - EwinSetBorderByName(ewin, "BORDERLESS", 0); + EwinSetBorderByName(ewin, "BORDERLESS"); ewin->props.donthide = 1; } else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/hints.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -3 -r1.42 -r1.43 --- hints.c 2 Jun 2005 17:30:07 -0000 1.42 +++ hints.c 12 Jun 2005 13:09:11 -0000 1.43 @@ -389,7 +389,7 @@ str = ecore_x_window_prop_string_get(ewin->client.win, aa); if (str) - EwinSetBorderByName(ewin, str, 0); + EwinSetBorderByName(ewin, str); Efree(str); if (EventDebug(EDBUG_TYPE_SNAPS)) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/iclass.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -3 -r1.67 -r1.68 --- iclass.c 11 Jun 2005 13:00:22 -0000 1.67 +++ iclass.c 12 Jun 2005 13:09:11 -0000 1.68 @@ -1044,7 +1044,8 @@ if (is->im == NULL && is->im_file) ImagestateRealize(is); - if (is->im) + /* Imlib2 will not render pixmaps with dimensions > 8192 */ + if (is->im && w <= 8192 && h <= 8192) { PmapMask pmm; int decache = 1; @@ -1145,7 +1146,8 @@ if (is->im == NULL && is->im_file) ImagestateRealize(is); - if (is->im) + /* Imlib2 will not render pixmaps with dimensions > 8192 */ + if (is->im && w <= 8192 && h <= 8192) { ImagestateMakePmapMask(is, win, pmm, make_mask, w, h, image_type); @@ -1193,12 +1195,8 @@ imlib_free_image(); is->im = NULL; } - - return; } - - /* if there is a bevel to draw, draw it */ - if (is->bevelstyle != BEVEL_NONE) + else { Pixmap pmap; @@ -1214,8 +1212,11 @@ /* bg color */ XSetForeground(disp, gc, is->bg.pixel); XFillRectangle(disp, pmap, gc, 0, 0, w, h); - ImagestateDrawBevel(is, pmap, gc, w, h); + /* if there is a bevel to draw, draw it */ + if (is->bevelstyle != BEVEL_NONE) + ImagestateDrawBevel(is, pmap, gc, w, h); EFreeGC(gc); + /* FIXME - No text */ } } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/snaps.c,v retrieving revision 1.90 retrieving revision 1.91 diff -u -3 -r1.90 -r1.91 --- snaps.c 24 Mar 2005 23:38:11 -0000 1.90 +++ snaps.c 12 Jun 2005 13:09:11 -0000 1.91 @@ -1436,7 +1436,7 @@ ewin->shaded = sn->shaded; if (sn->use_flags & SNAP_USE_BORDER) - EwinSetBorderByName(ewin, sn->border_name, 0); + EwinSetBorderByName(ewin, sn->border_name); if (sn->groups) { ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs