1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-22 20:41:26 +00:00

. 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 <fuyuhik8@is.titech.ac.jp>
Reviewed by:	steve (the patch)
Approved by:	steve
This commit is contained in:
Greg Lewis 2002-07-26 04:10:23 +00:00
parent 73e8662630
commit f86655b574
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=63583
2 changed files with 50 additions and 1 deletions

View File

@ -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/ \

View File

@ -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);