multiple insertion point images on BeOS

Daniel Joseph Berlin (db003g@mail.rochester.edu)
Thu, 4 Nov 1999 12:25:10 -0500


On BeOS, if you hold down the right or left key, you can get more than one
insertion point image (IE multiple vertical bars). It's amazingly
annoying.

At first I thought it was a screwup in our xoring, but it's not.
It's actually a thread issue.
It appears the autopointerupdate, since it's running in a seperate thread,
usually xors the old insertion point right before it gets updated by the
other thread, and since the point was just updated, the old point doesn't
get erased, because _eraseInsertionPoint already has the new coordinates.

The insertion point image will sit there until something else causes that
part of the view to get invalidated, and thus redrawn (at which point it
goes away, because nothing draws it, because it's not really the insertion
point).
The stopping of the timer doesn't help cause it may be too late already,
or by the time the thread gets suspended, may be too late as well.

This presents an interesting problem.

On BeOS, what we would do is use semaphores to guard both routines, so the
pointer update and auto-pointer update couldn't happen at the exact same
time, and cause this problem.
AbiWord isn't multi-threaded yet (at least, not intentionally. :P), so i
don't see cross-platform semaphores.
This problem is very annoying.
What can i do to make it go away?
I can't make the timers not happen in a seperate thread, it's impossible.
Erasing the insertion point in the autopointerupdate won't help (right now
it's xor'ed, rather than removed/reset), because the real problem is the
insertion point changed, and the autopointerupdate doesn't know it.

The only thing i can think of is to have a fake semaphore of some sort in
the autopointer/drawinsertionpoint routines (I.E. set a variable when we
enter, check the variable in the autopointer to make sure it's not
set,don't update the pointer if it is).
Any other cross-platform compatible ideas out there?
--Dan



This archive was generated by hypermail 1.03b2.