From: Ethan A M. <me...@uw...> - 2020-03-18 03:32:18
|
On Saturday, 14 March 2020 23:12:24 PDT Dima Kogan wrote: > Hi. > > I've been working on fixing broken "pause mouse close" behavior on the > x11 terminal while x-forwarding. This is > > https://sourceforge.net/p/gnuplot/bugs/2208/ > > In the process I discovered that I already encountered weirdness in this > area previously: > > https://sourceforge.net/p/gnuplot/mailman/message/36440354/ > > I just fixed all the issues, I think. These are in 2 patches on this > branch: > > https://github.com/dkogan/gnuplot/commits/fixed-x11-waitforinput > > The first patch improves diagnostic printing in this area. Instead of > printing enums as NUMBERS, it prints the enum NAMES. This is infinitely > more useful. > > The second patch contains the actual fixes. It looks more invasive than > it is. 99% of the modifications are in X11_waitforinput(). And much of > it is indentation. > > There were several issues, all of them caused by hoaky input > multiplexing. I'm attaching two very simple gnuplot scripts that tickled > the bug. To observe the problems you need to slow down the X connection > by ssh-ing to any server, and trying to plot through x-forwarding. > Before any of the fixes this would happen: > > $ gnuplot < mild.pause.mouse.close.broken.gp > > gnuplot> ause mouse close > ^ > line 0: invalid command > > [...snip...] > It works for me so far, but this is an error-prone area. Can somebody > take a look? The new approach is much better, I think, but more testing > would be good. It has been a long time since I looked at the x11 input multiplexing code but I remember that it was a mess and many observed problems were dealt with by slapping a special case in rather than rethinking the design. So yes, a re-write is a good thing. Your revised code works well in all the tests that I ran, but I am sure that there are people with use-cases I didn't test. If you are reading this and find a problem with the new code, let us know. Anyhow, I've imported your fixes into the main code repository. Keep up the good work. Ethan |