Fix crash on large client windows (dimension > 8192 pixels).
SVN revision: 15273
This commit is contained in:
parent
36b37ccb62
commit
fe30ae4d57
4
src/E.h
4
src/E.h
|
@ -754,6 +754,7 @@ struct _ewin
|
|||
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 EwinBorderUpdateInfo(EWin * ewin);
|
|||
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,
|
||||
|
|
|
@ -418,13 +418,19 @@ EwinBorderSelect(EWin * ewin)
|
|||
{
|
||||
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 @@ EwinBorderSetTo(EWin * ewin, const Border * b)
|
|||
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 @@ EwinSetBorder(EWin * ewin, const Border * b, int apply)
|
|||
}
|
||||
|
||||
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 *
|
||||
|
|
|
@ -546,7 +546,7 @@ EWMH_GetWindowType(EWin * ewin)
|
|||
#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)
|
||||
|
|
|
@ -389,7 +389,7 @@ EHintsGetInfo(EWin * ewin)
|
|||
|
||||
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))
|
||||
|
|
17
src/iclass.c
17
src/iclass.c
|
@ -1044,7 +1044,8 @@ ITApply(Window win, ImageClass * ic, ImageState * is, int w, int h, int state,
|
|||
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 @@ ImageclassApplyCopy(ImageClass * ic, Window win, int w, int h, int active,
|
|||
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 @@ ImageclassApplyCopy(ImageClass * ic, Window win, int w, int h, int active,
|
|||
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 @@ ImageclassApplyCopy(ImageClass * ic, Window win, int w, int h, int active,
|
|||
/* 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 */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1436,7 +1436,7 @@ SnapshotEwinMatch(EWin * ewin)
|
|||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue