From 740bc8913adb83ffea652c982a73226ad28f7452 Mon Sep 17 00:00:00 2001 From: glewis Date: Fri, 26 Jul 2002 04:10:23 +0000 Subject: . Add a patch to prevent crashes which occur when using XIM and certain (e.g. Asian) character sets. . Bump PORTREVISION to reflect this fix. PR: 30421 Submitted by: Fuyuhiko Maruyama Reviewed by: steve (the patch) Approved by: steve --- x11-toolkits/open-motif/Makefile | 2 +- x11-toolkits/open-motif/files/patch-XmIm.c | 49 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 x11-toolkits/open-motif/files/patch-XmIm.c (limited to 'x11-toolkits/open-motif') diff --git a/x11-toolkits/open-motif/Makefile b/x11-toolkits/open-motif/Makefile index b5032ddd785f..23112c554855 100644 --- a/x11-toolkits/open-motif/Makefile +++ b/x11-toolkits/open-motif/Makefile @@ -8,7 +8,7 @@ PORTNAME= open-motif PORTVERSION= 2.1.30 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= x11-toolkits MASTER_SITES= ftp://openmotif.opengroup.org/pub/openmotif/R${PORTVERSION}/tars/ \ ftp://ftp.opengroup.org/pub/openmotif/R${PORTVERSION}/tars/ \ diff --git a/x11-toolkits/open-motif/files/patch-XmIm.c b/x11-toolkits/open-motif/files/patch-XmIm.c new file mode 100644 index 000000000000..3f13c4b641df --- /dev/null +++ b/x11-toolkits/open-motif/files/patch-XmIm.c @@ -0,0 +1,49 @@ +--- lib/Xm/XmIm.c.orig Fri Sep 7 10:11:01 2001 ++++ lib/Xm/XmIm.c Sat Sep 8 03:44:14 2001 +@@ -479,6 +479,7 @@ + im_info->current_widget = w; + XtVaGetValues(w, XmNbackground, &bg, NULL); + XtVaSetValues(p, XmNbackground, bg, NULL); ++ ImGeoReq(p); + draw_separator(p); + } + _XmAppUnlock(app); +@@ -1272,6 +1273,7 @@ + XtAddEventHandler(p, (EventMask)mask, False, null_proc, NULL); + } + if (XtIsRealized(p)) { ++ im_info->current_widget = w; + if (XmIsDialogShell(p)) { + for (i = 0; + i < ((CompositeWidget)p)->composite.num_children; +@@ -1282,7 +1284,6 @@ + } + } else + ImGeoReq(p); +- im_info->current_widget = w; + } + /* Is this new XIC supposed to be shared? */ + switch (input_policy) +@@ -2047,10 +2048,18 @@ + rect_preedit.height = icp->sp_height; + } else if ((use_plist = (icp->input_style & XIMPreeditPosition)) != 0) + { +- unsigned int margin = ((XmPrimitiveWidget)im_info->current_widget) +- ->primitive.shadow_thickness +- + ((XmPrimitiveWidget)im_info->current_widget) +- ->primitive.highlight_thickness; ++ unsigned int margin; ++ /* ++ * im_info->current_widget eventually contains NULL, ++ * for example, when widget having XIC focus is disposed. ++ * Thus, we should check this and prevent from touching NULL pointer. ++ */ ++ if (im_info->current_widget == NULL) ++ break; ++ margin = ((XmPrimitiveWidget)im_info->current_widget) ++ ->primitive.shadow_thickness ++ + ((XmPrimitiveWidget)im_info->current_widget) ++ ->primitive.highlight_thickness; + + rect_preedit.width = MIN(icp->preedit_width, + XtWidth(im_info->current_widget) - 2*margin); -- cgit