[fltk.bugs] [MOD] STR #2233: Using F2/F3 keys in fluid can cause selected item to disappear

2009-08-05 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2233
Version: 1.3-current


When many items are in the fluid browser, selecting the second item down
from the top, and hitting the F2 key to 'move it up' to the top causes the
item to seem to 'disappear'.

The item is really 'at the top', but the scrollbar won't let you scroll up
to see it.

However, if you scroll down, then up again, then you can see it.

It's a weird hiccup, probably something to do with Fl_Browser's scrollbar
calculations.. not sure.

To replicate, basically fill the browser with items until a scrollbar
appears, scroll to the top, select the second item, and try to 'move it
up' to the top with the F2 key.


Link: http://www.fltk.org/str.php?L2233
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [HIGH] STR #2232: FLTK1/2 X11 keyboard handling broken if using a soft keyboard

2009-08-05 Thread dima
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2232
Version: 1.3-current





Link: http://www.fltk.org/str.php?L2232
Version: 1.3-current#include stdio.h
#include Xlib.h
#include XTest.h

int main(void)
{
Display *display;
int i;
KeyCode keycode;

/* Connect to the server specified in the DISPLAY evironment variable */
display = XOpenDisplay(NULL);
if (display == NULL)
{
fprintf (stderr, Cannot connect to X server %s.\n, 
XDisplayName(NULL));
return;
}
if (!XQueryExtension (display, XTEST, i, i, i))
{
fprintf (stderr, Extension XTest unavailable on display '%s'.\n, 
XDisplayName(NULL));
XCloseDisplay (display);
return;
}


unsigned char keycodes[] = {0x3a, 0x20, 0x1b, 0x39, 0x1f, 0x39, 0x2a, 0x41};

for(i=0; isizeof(keycodes); i++)
{
XTestFakeKeyEvent(display, keycodes[i], 1, 0);
XTestFakeKeyEvent(display, keycodes[i], 0, 0);
}
XCloseDisplay (display);
}
___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


[fltk.bugs] [HIGH] STR #2232: FLTK1/2 X11 keyboard handling broken if using a soft keyboard

2009-08-05 Thread dima
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2232
Version: 1.3-current


I'm seeing a problem with the low-level keyboard handling in both
FLTK1 and FLTK2. If using a program that artificially generates
X11 keystrokes to type any word with non-consecutive, repeated
letters into an FLTK app, FLTK transposes the letters. An example
of such a keystroke-generating application is a soft keyboard,
such as those used on touchscreen phones. A keyboard that uses a
dictionary to type a word-at-a-time types the letters in a quick
succession, triggering this bug. I'm attaching 2 test programs to
demonstrate the issue, one in C and another in Perl. Both use
XTest to type morning (assuming a standard keyboard). This
works fine when typing into an app not built with FLTK, but FLTK
often produces mornnig instead. This is sensitive to timing, so
the bug doesn't occur 100% of the time, but quite often on my
computer.

The cause of the issue is code in FLTK to handle key
repeats. When a key is held down, X sends repeated press and
release events. FLTK fights this by looking into the X event
queue to detect this condition, and to pull out press events to
process them earlier. Thus, the second n in morning moves up
in the queue to produce the error. In FLTK1, this behavior was
introduced in revision 2937 (this revision has no other
changes). In FLTK2, almost-identical behavior was introduced in
revision 2944.

I must admit I don't understand why FLTK doesn't want to handle
repeated press and release events that X generates. A quick test
with that code pulled out didn't reveal any breakage, but I
didn't try for very long. We can pull out this code permanently
if the issue no longer exists (the code was written in
2003). Otherwise, we can make fake_keyup_test() smarter by
preventing it from triggering if different keys are seen in the
queue in-between the repeating keys.


Link: http://www.fltk.org/str.php?L2232
Version: 1.3-current

type_morning.pl
Description: Binary data
___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs