Skip Menu |

This queue is for tickets about the Curses-UI-POE CPAN distribution.

Report information
The Basics
Id: 19681
Status: resolved
Worked: 2 hours (120 min)
Priority: 0/
Queue: Curses-UI-POE

People
Owner: tag [...] cpan.org
Requestors: MSCHILLI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.02801
Fixed in: (no value)



I needed to apply a patch to get this running on my Linux box. Would be great if you could apply the attached patch to the CPAN distribuion. Here's the details: It appears that at startup, there's always 2-3 garbage characters in STDIN, which confuse Curses so that it's always one character behind what the user types. I found that if I throw away the garbage characters at startup (only in the non-forced gpm mode, btw., otherwise test case t/12gpm_handler.t fails), the GUI works fine. Patch attached. Thanks for a great module! -- Mike Schilli
Subject: patch.txt
diff -Naur Curses-UI-POE-0.02801/POE.pm Curses-UI-POE-0.02801.patched/POE.pm --- Curses-UI-POE-0.02801/POE.pm 2004-06-24 13:16:18.000000000 -0700 +++ Curses-UI-POE-0.02801.patched/POE.pm 2006-06-03 12:39:08.475459392 -0700 @@ -63,6 +63,12 @@ set_read_timeout($ModalObject[TOP]); + unless($Curses::UI::gpm_mouse) { + while (my $key = $_[HEAP]->get_key(0) != -1) { + # ignoring stdin garbage at startup + } + } + $_[HEAP] = $RootObject; $Options{inline_states}{_start}(@_)
Subject: Update to patch - please apply to trunk
From: antony.gelberg [...] wayforth.com
I've updated the patch for trunk. Scott - can it be applied? Antony
--- /home/antony/src/debian/perl/trunk/libcurses-ui-poe-perl/POE.pm 2008-11-20 12:57:50.000000000 +0000 +++ /usr/share/perl5/Curses/UI/POE.pm 2008-12-01 15:39:40.000000000 +0000 @@ -97,6 +97,13 @@ # $self, although if we're not in a dialog $self is what this actually is. set_read_timeout($modal_objects[TOP]); + + unless($Curses::UI::gpm_mouse) { + while (my $key = $_[HEAP]->get_key(0) != -1) { + # ignoring stdin garbage at startup + } + } + # Unmask... $self->{__start_callback}(@_) if defined $self->{__start_callback};
Subject: Fixed in 0.034
And subsequent 0.035 will call ->flushkeys() to fix this problem.