two unrelated little fixes: bottomwin: if bottom was used a few times, rio lost track of the window ordering, because w->topped was zero for several windows. setting it to a lower (negative) number each time fixes that. deleting windows: a change so that if you point to a window to delete it, releasing the button off the window aborts the action. yes, it is possible to do this by chording with another button, but i feel this way is more intuitive and less easy to muck up (important when you might lose important info). BTW, i think the cursor when deleting a window should be distinguished, as it was in 8½ - i'll submit a patch to reinstitute the old bones cursor, if it's not considered a bad idea. Reference: /n/sources/patch/applied/riotopped.delete Date: Thu Mar 9 18:36:02 CET 2006 --- /sys/src/cmd/rio/rio.c Thu Mar 9 18:26:04 2006 +++ /sys/src/cmd/rio/rio.c Thu Mar 9 18:25:51 2006 @@ -517,7 +517,7 @@ scrolling = mouse->buttons; else scrolling = mouse->buttons && ptinrect(xy, winput->scrollr); - /* topped will be zero if window has been bottomed */ + /* topped will be zero or less if window has been bottomed */ if(sending == FALSE && !scrolling && winborder(winput, mouse->xy) && winput->topped>0){ moving = TRUE; }else if(inside && (scrolling || winput->mouseopen || (mouse->buttons&1))) @@ -566,7 +566,7 @@ cornercursor(w, mouse->xy, 0); /* we're not sending the event, but if button is down maybe we should */ if(mouse->buttons){ - /* w->topped will be zero if window has been bottomed */ + /* w->topped will be zero or less if window has been bottomed */ if(w==nil || (w==winput && w->topped>0)){ if(mouse->buttons & 1){ ; @@ -1018,6 +1018,8 @@ w = nil; } readmouse(mousectl); + if(w != nil && wpointto(mouse->xy) != w) + w = nil; } cornercursor(input, mouse->xy, 0); moveto(mousectl, mouse->xy); /* force cursor update; ugly */ --- /sys/src/cmd/rio/wind.c Thu Mar 9 18:27:10 2006 +++ /sys/src/cmd/rio/wind.c Thu Mar 9 18:26:47 2006 @@ -1268,7 +1268,7 @@ if(w!=nil && w->i!=nil && !w->deleted){ bottomwindow(w->i); flushimage(display, 1); - w->topped = 0; + w->topped = - (++topped); } }