Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!rpi!uupsi!sunic!ugle.unit.no!news From: Harald.Eikrem@delab.sintef.no Newsgroups: comp.windows.x Subject: twm/tvtwm popup menu fix Message-ID: <1991Mar16.184456*Harald.Eikrem@delab.sintef.no> Date: 16 Mar 91 17:44:56 GMT Sender: news@ugle.unit.no Organization: SINTEF DELAB (was ELAB-RUNIT), Trondheim, Norway. Lines: 49 Always being annoyed that popup menus in these window managers tend to show up at unwanted times when sliding down menu panes, I came up with the following simple fix. Instead of switching to the popup menu left to the half of the menu width, this fix makes them switch left of 9/10'th of the width. It also (I think) solves the problem of unstable menu areas, in which popup menus show up and diappear at high frequency. The following diff is from tvtwm rev. 8.0 PL4 menus.c, but applies eqally well to X11R4 twm (using `patch' of course). I would like to see something like this done to the twm and tvtwm distributions. --Harald E Save the following to e.g. /tmp/twmpatch, then run "patch < /tmp/twmpatch" in the tvtwm (or twm) source directory. *** menus.c.ORIG Fri Nov 16 04:13:12 1990 --- menus.c Thu Mar 14 03:28:16 1991 *************** *** 566,570 **** /* now check to see if we were over the arrow of a pull right entry */ if (ActiveItem->func == F_MENU && ! ((ActiveMenu->width - x) < (ActiveMenu->width >> 1))) { MenuRoot *save = ActiveMenu; --- 566,570 ---- /* now check to see if we were over the arrow of a pull right entry */ if (ActiveItem->func == F_MENU && ! ((ActiveMenu->width - x) < (ActiveMenu->width /10))) { MenuRoot *save = ActiveMenu; *************** *** 573,579 **** if (MenuDepth < MAXMENUDEPTH) { ! PopUpMenu (ActiveItem->sub, (savex + (ActiveMenu->width >> 1)), (savey + ActiveItem->item_num * Scr->EntryHeight + ! (Scr->EntryHeight >> 1)), False); } else if (!badItem) { XBell (dpy, 0); --- 573,579 ---- if (MenuDepth < MAXMENUDEPTH) { ! PopUpMenu (ActiveItem->sub, (savex + (ActiveMenu->width *8/10)), (savey + ActiveItem->item_num * Scr->EntryHeight + ! (Scr->EntryHeight /10)), False); } else if (!badItem) { XBell (dpy, 0);