scrollbar handling by X11

Looking up scrollbars did not work as intended.  The code wanted an
ancestor widget that had both horizontal and vertical scrollbars,
but menus either have none or just vertical.  The lookup code found
some top level widget and returned bad data.
This commit is contained in:
PatR
2021-03-12 18:06:43 -08:00
parent 015380fecf
commit 160344feaa
5 changed files with 23 additions and 14 deletions
+2 -4
View File
@@ -1814,16 +1814,14 @@ ec_key(Widget w, XEvent *event, String *params, Cardinal *num_params)
ec_active = FALSE;
return;
} else if (ch == MENU_FIRST_PAGE || ch == MENU_LAST_PAGE) {
hbar = vbar = (Widget) 0;
find_scrollbars(w, &hbar, &vbar);
find_scrollbars(w, (Widget) 0, &hbar, &vbar);
if (vbar) {
top = (ch == MENU_FIRST_PAGE) ? 0.0 : 1.0;
XtCallCallbacks(vbar, XtNjumpProc, &top);
}
return;
} else if (ch == MENU_NEXT_PAGE || ch == MENU_PREVIOUS_PAGE) {
hbar = vbar = (Widget) 0;
find_scrollbars(w, &hbar, &vbar);
find_scrollbars(w, (Widget) 0, &hbar, &vbar);
if (vbar) {
XtSetArg(arg[0], nhStr(XtNshown), &shown);
XtSetArg(arg[1], nhStr(XtNtopOfThumb), &top);