offset(menu.select), XtRCallback, (XtPointer)NULL},
{XtNhighlightCallback, XtCCallback, XtRCallback, sizeof(XtPointer),
offset(menu.highlight), XtRCallback, (XtPointer)NULL},
+ {XtNenterCallback, XtCCallback, XtRCallback, sizeof(XtPointer),
+ offset(menu.enter), XtRCallback, (XtPointer)NULL},
+ {XtNleaveCallback, XtCCallback, XtRCallback, sizeof(XtPointer),
+ offset(menu.leave), XtRCallback, (XtPointer)NULL},
{XtNmenu, XtCMenu, XtRPointer, sizeof(XtPointer),
offset(menu.contents), XtRImmediate, (XtPointer)NULL},
{XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor),
{
if (val->enabled)
*hit_return = val;
- else
- no_return = 1;
+ else
+ no_return = 1;
+ if (mw->menu.inside_entry != val)
+ {
+ if (mw->menu.inside_entry)
+ XtCallCallbackList ((Widget)mw, mw->menu.leave,
+ (XtPointer) mw->menu.inside_entry);
+ mw->menu.inside_entry = val;
+ XtCallCallbackList ((Widget)mw, mw->menu.enter,
+ (XtPointer) mw->menu.inside_entry);
+ }
}
if (horizontal_p)
relative_pos->x = ev->x_root - x;
relative_pos->y = ev->y_root - y;
return (x - shadow < ev->x_root && ev->x_root < x + ws->width
- && y - shadow < ev->y_root && ev->y_root < y + ws->height);
+ && y - shadow < ev->y_root && ev->y_root < y + ws->height);
}
static Boolean
int i;
XPoint relative_pos;
window_state* ws;
+ int inside = 0;
*val = NULL;
ws = &mw->menu.windows [i];
if (ws && motion_event_is_in_menu (mw, ev, i, &relative_pos))
{
+ inside = 1;
display_menu (mw, i, True, NULL, &relative_pos, val, NULL, NULL);
if (*val)
}
}
}
+
+ if (!inside)
+ {
+ if (mw->menu.inside_entry != NULL)
+ XtCallCallbackList ((Widget)mw, mw->menu.leave,
+ (XtPointer) mw->menu.inside_entry);
+ mw->menu.inside_entry = NULL;
+ }
+
return False;
}
next_release_must_exit = 0;
+ mw->menu.inside_entry = NULL;
XtCallCallbackList ((Widget)mw, mw->menu.open, NULL);
if (XtIsShell (XtParent ((Widget)mw)))