|
From: Tatsuro M. <tma...@ya...> - 2015-08-31 00:54:41
|
----- Original Message -----
> From: sfeam
> To: gnuplot-beta
> Cc: Allin Cottrell Tatsuro MATSUOKA
> Date: 2015/8/29, Sat 00:34
> Subject: Re: wxt term + osx
>
> On Friday, 28 August 2015 08:07:11 AM Allin Cottrell wrote:
>> On Fri, 28 Aug 2015, Tatsuro MATSUOKA wrote:
>>
>> >> Patch 2 prevents loss of a character from the input stream after
>> >> waiting for a mouse click.
>> >> I am not sure if this is needed or even safe on Windows.
>> >>
>> >> --- a/src/wxterminal/wxt_gui.cpp 2015-07-13 10:54:44.000000000
> -0700
>> >> +++ b/src/wxterminal/wxt_gui.cpp 2015-08-27
> 12:26:12.000000000 -0700
>> >> @@ -3716,7 +3716,8 @@ bool wxt_exec_event(int type, int mx, in
>> >> event.winid = id;
>> >> #if defined(WXT_MONOTHREADED) || defined(_Windows)
>> >> - wxt_process_one_event(&event);
>> >> + if (wxt_process_one_event(&event))
>> >> + ungetc('\n',stdin); /* FIXME: OK on
> Windows? */
>> >> return true;
>> >> #else
>> >> if (!wxt_handling_persist)
>> >
>> > I have complied patch 2 attached wxt_gui.cpp.
>> > Compile itself have passed on gnuplot.exe and wgnuplot.exe.
>> >
>> > However
>> >
>> > ungetc('\n',stdin);
>> >
>> > perhaps only works on console mode (gnuplot.exe) (untested.)
>> >
>> > The function ungetc is not redefined in wtext.h.
>>
>> It's defined in stdio.h.
>
> Does the problem exist on Windows?
> Test case before patch:
>
> gnuplot> plot sin(x)
> gnuplot> pause mouse
> print "type this before interacting with the plot"
> <now click on the plot>
> gnuplot>rint "type this before interacting with the plot"
> ^
> invalid command
> gnuplot>
>
> On linux + single-thread option the 'p' of the "print"
> is lost. The patch fixes this. But is it lost on OSX
> and Windows also? If not, they do not need the patch.
>
I have checked out the source (ChangeLog 2015-08-28).
The second patch is not applied for windows. (ungetc)
gnuplot> plot sin(x)
gnuplot> pause mouse
print "type this before interacting with the plot"
<now click on the plot>
gnuplot>print "type this before interacting with the plot"
Therefore the second patch is not required for windows.
Tatsuro
|