Dear Andreas

Thank you very much for coming up already with a solution to your problem.

I would not be surprised that this portion of code is buggy, because
querying hasPendingEvents() inside a thread is already a weird way to
decide to drop an event. Your patch looks simple but would need to be
reviewed by somebody with some experience with threading in Qt
applications to be sure it does not risk making things weirder. (I have
some project to revisit this code for 2.3.0 because it looks like a fun
thing to learn, but now is not really the moment for me...)

In case your patch does not make it in time for 2.2 (because as far as I
understand the next step is a release candidate), can we try to see
where your issue comes from? I am thinking about the fact that there
already were issues of input methods interfering (here IBus:
<http://www.lyx.org/trac/ticket/9362>). Your bug is certainly not #9362
though because one of its symptoms is that the message "system is busy"
is not displayed (and the event not dropped). I wonder whether it could
be something else. For this reason could you please try to see if you
can reproduce your issue when you run LyX with the following command line?
  XMODIFIERS= lyx

Also, since you suspect that interfering events might be coming from
timers: do you have the source view open when the bug occurs?

I am sceptical that the age of your laptop is the (sole) issue here,
because when I use valgrind to profile LyX, it also goes very slowly,
and I have never experienced issues of this sort (unless I had IBus
running).


Sincerely
Guillaume


Le 07/03/2016 01:13, Andreas Amann a écrit :
Hi,

when I use lyx-2.1.4 on an older laptop (Celeron 550, arch-linux) I
cannot use the cursor left and right keys in the usual way.  They get
stuck after moving by just one character, even if I keep the key
pressed, and then I get a staggered irregular cursor motion. The problem
is also present on the current master branch.
(Interestingly I do not see this issue with a faster computer with
otherwise similar setup).

when starting lyx with

lyx -dbg key

error messages of the form

GuiWorkArea.cpp (1053): system is busy: scroll key event ignored

appear.

The reason seems to be that there are other unrelated events pending in
the Qt eventloop (possibly timer events for cursor blinking?). This
causes lyx to drop the cursor motion events.

The attached patch against the current master branch fixes the problem
for me.  It first processes all events which are not caused by user
input, and only if this does not clear the event queue proceeds to drop
the current event.

Would you consider applying this to master (and possibly backport to
2.1.x)?

Thanks,
Andreas




Reply via email to