|
From: sfeam <sf...@us...> - 2018-10-14 18:24:11
|
On Saturday, 13 October 2018 17:01:03 Dima Kogan wrote:
> Hi.
>
> A debugging question. I have a trivial gnuplot script; the specific
> script doesn't matter. For instance this in tst.gp:
>
> plot x
> pause mouse close
>
> What I'd like to happen is to run
>
> load "tst.gp"
>
> then an interactive plot pops up (x11 or qt or wxt terminals in my
> case). When I close the interactive plot (by pressing 'q' for instance)
> I'd like the 'pause mouse close' command to exit, and I'd like to get
> back to the "gnuplot>" prompt. In my case this doesn't happen. With 'q'
> the interactive plot window does go away, but gnuplot doesn't go back to
> looking for input. I can press "enter", and I get the prompt back then.
I have been chasing a similar problem with the wxt terminal built in
"monothreaded" mode. The code sequence after receiving a "window closed"
event is confusing and may not be the same for different terminal types.
wxt: I think I found and fixed this yesterday for 5.3.
If it works for everyone this should be back-ported to 5.2
x11: In theory a terminal driver can see the window close event either
as a GE_keypress event with the 1st parameter set to GP_Cancel
or as a GE_reset event. x11 handled the first case but failed to
catch the second case. Patch below.
qt: May need a similar addition fix
Ethan
%%%%%
diff --git a/term/x11.trm b/term/x11.trm
index 366cc0c..11556f1 100644
--- a/term/x11.trm
+++ b/term/x11.trm
@@ -954,6 +954,11 @@ AGAIN:
return '\0';
}
}
+ if (ge.type == GE_reset) {
+ /* Error or window close */
+ paused_for_mouse = 0;
+ return '\0';
+ }
}
} else if (options == TERM_ONLY_CHECK_MOUSING) {
return '\0';
%%%%%
>
> Some minor debugging tells me that after 'q' I still have a gnuplot_x11
> helper process. Both gnuplot_x11 and gnuplot are sitting in select()
> waiting for input, and I need to kick the selects with another "enter"
> to get a prompt back. My gnuplot comes vanilla from Debian. Is this what
> people are observing? Any obvious causes? I'd like to ask before diving
> into a debugging session.
>
> dima
|