mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtwm: To avoid a segfault, allocate gadget rectangles when regenerate
window frame. A typical case, create a frameless window then regenerate it's frame.
This commit is contained in:
parent
8fa32b3db5
commit
f05bc54ceb
2 changed files with 4 additions and 2 deletions
|
@ -989,7 +989,8 @@ int IdentifyFramePart (ClientData *pCD, int x, int y)
|
||||||
|
|
||||||
if (decor & MWM_DECOR_TITLE)
|
if (decor & MWM_DECOR_TITLE)
|
||||||
{
|
{
|
||||||
if ( (x >= pCD->titleRectangle.x) &&
|
if ( pCD->pTitleGadgets &&
|
||||||
|
(x >= pCD->titleRectangle.x) &&
|
||||||
(x < (int)pCD->titleRectangle.x + (int)pCD->titleRectangle.width) &&
|
(x < (int)pCD->titleRectangle.x + (int)pCD->titleRectangle.width) &&
|
||||||
(y >= pCD->titleRectangle.y) &&
|
(y >= pCD->titleRectangle.y) &&
|
||||||
(y < (int)pCD->titleRectangle.y + (int)pCD->titleRectangle.height) )
|
(y < (int)pCD->titleRectangle.y + (int)pCD->titleRectangle.height) )
|
||||||
|
@ -1002,7 +1003,7 @@ int IdentifyFramePart (ClientData *pCD, int x, int y)
|
||||||
|
|
||||||
/* try resize border */
|
/* try resize border */
|
||||||
|
|
||||||
if (decor & MWM_DECOR_RESIZEH)
|
if (decor & MWM_DECOR_RESIZEH && pCD->pTitleGadgets)
|
||||||
{
|
{
|
||||||
rval = GadgetID(x, y, pCD->pResizeGadgets, STRETCH_COUNT);
|
rval = GadgetID(x, y, pCD->pResizeGadgets, STRETCH_COUNT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2335,6 +2335,7 @@ void RegenerateClientFrame (ClientData *pcd)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* recreate gadget rectangles */
|
/* recreate gadget rectangles */
|
||||||
|
AllocateGadgetRectangles (pcd);
|
||||||
ComputeGadgetRectangles (pcd);
|
ComputeGadgetRectangles (pcd);
|
||||||
|
|
||||||
/* regenerate the graphics */
|
/* regenerate the graphics */
|
||||||
|
|
Loading…
Reference in a new issue