summaryrefslogtreecommitdiff
path: root/lwlib/lwlib-Xm.c
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-11-30 12:50:08 +0000
committerGerd Moellmann <gerd@gnu.org>2000-11-30 12:50:08 +0000
commit924e171446d7fc27352afc336da80be6a2bfaca3 (patch)
tree7cdf0b9b910b3e3f0ba5e4ea55cb1ff6f2b560a2 /lwlib/lwlib-Xm.c
parent3e40ba92a5d834f327b3b202dde44677ca1c41ed (diff)
downloademacs-924e171446d7fc27352afc336da80be6a2bfaca3.tar.gz
(xm_arm_callback): Handle case that W is null;
also see comment there.
Diffstat (limited to 'lwlib/lwlib-Xm.c')
-rw-r--r--lwlib/lwlib-Xm.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index b33a53e43fc..4a3f097a867 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -265,26 +265,32 @@ xm_arm_callback (w, client_data, call_data)
widget_value *wv = (widget_value *) client_data;
widget_instance *instance;
- /* Get the id of the menu bar or popup menu this widget is in. */
- while (1)
+ /* During the pretest of 21.1, there was a case where this callback
+ was called with a null widget on hpux 10.2. I think that's
+ likely a bug in the Motif lib there. */
+ if (w != None)
{
- if (XmIsRowColumn (w))
+ /* Get the id of the menu bar or popup menu this widget is in. */
+ while (1)
{
- unsigned char type = 0xff;
+ if (XmIsRowColumn (w))
+ {
+ unsigned char type = 0xff;
- XtVaGetValues (w, XmNrowColumnType, &type, NULL);
- if (type == XmMENU_BAR || type == XmMENU_POPUP)
- break;
- }
+ XtVaGetValues (w, XmNrowColumnType, &type, NULL);
+ if (type == XmMENU_BAR || type == XmMENU_POPUP)
+ break;
+ }
- w = XtParent (w);
- }
+ w = XtParent (w);
+ }
- instance = lw_get_widget_instance (w);
- if (instance && instance->info->highlight_cb)
- {
- call_data = cbs->reason == XmCR_DISARM ? NULL : wv;
- instance->info->highlight_cb (w, instance->info->id, call_data);
+ instance = lw_get_widget_instance (w);
+ if (instance && instance->info->highlight_cb)
+ {
+ call_data = cbs->reason == XmCR_DISARM ? NULL : wv;
+ instance->info->highlight_cb (w, instance->info->id, call_data);
+ }
}
}