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:
@@ -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 */
|
||||||
|
|||||||
Reference in New Issue
Block a user