Text selection does not work as expected
Scott Kostyshak
skostysh at lyx.org
Sat Jul 4 15:16:37 UTC 2020
On Sat, Jul 04, 2020 at 12:27:04PM +0200, Yu Jin wrote:
> Am Fr., 3. Juli 2020 um 17:09 Uhr schrieb Yu Jin <yu_jin at lyx.org>:
>
> > Am Fr., 3. Juli 2020 um 11:12 Uhr schrieb Daniel <xracoonx at gmx.de>:
> >
> >> On 2/7/20 16:27, Jean-Marc Lasgouttes wrote:
> >> > Le 02/07/2020 à 15:43, Daniel a écrit :
> >> >> When I double (triple) click on text, instead of the word (line), only
> >> >> the word (line) left to the cursor is selected. I don't remember
> >> >> seeing this before. Can someone reproduce?
> >> >
> >> > I cannot reproduce. Master or 2.3?
> >> >
> >> > JMarc
> >>
> >> I see. So, here is some more info and testing:
> >>
> >> LyX Version 2.3.5.2
> >> (25 June 2020)
> >> Qt Version (run-time): 5.12.5
> >> Qt Version (compile-time): 5.12.5
> >>
> >> Windows 10 1909.
> >>
> >> I noticed that the selection works fine when I use an external mouse
> >> instead of the intrernal trackpad (Surface Pro). The problem is
> >> restricted to LyX's work area. No other program I tested exhibits the
> >> problem, including Scribus (Qt 5.9.7).
> >>
> >> I attached a screen recording just to make sure we talk about the same
> >> thing. (Unfortunately, the mouse cursor and clicks are not recorded.)
> >>
> >
> > I can reproduce on my notebook, also with master and Qt 5.15.0. I will
> > investigate.
> >
>
> Looks like GuiWorkArea::mouseMoveEvent(QMouseEvent*) is called falsely, I
> get status messages like these when I do a double tap on the touchpad:
>
> Cursor.cpp (781): Cursor::dispatch: cmd: action: 206 [] arg: '' x: 102 y:
> 69
>
> insets\InsetText.cpp (293): InsetText::doDispatch(): cmd: action: 206 []
> arg: '' x: 102 y: 69
> Text3.cpp (631): Text::dispatch: cmd: action: 206 [] arg: '' x: 102 y: 69
> Cursor.cpp (781): Cursor::dispatch: cmd: action: 208 [] arg: '' x: 102 y:
> 69
>
> insets\InsetText.cpp (293): InsetText::doDispatch(): cmd: action: 208 []
> arg: '' x: 102 y: 69
> Text3.cpp (631): Text::dispatch: cmd: action: 208 [] arg: '' x: 102 y: 69
> Cursor.cpp (781): Cursor::dispatch: cmd: action: 209 [] arg: '' x: 102 y:
> 69
>
> insets\InsetText.cpp (293): InsetText::doDispatch(): cmd: action: 209 []
> arg: '' x: 102 y: 69
> Text3.cpp (631): Text::dispatch: cmd: action: 209 [] arg: '' x: 102 y: 69
> Cursor.cpp (781): Cursor::dispatch: cmd: action: 207 [] arg: '' x: 102 y:
> 69
>
> insets\InsetText.cpp (293): InsetText::doDispatch(): cmd: action: 207 []
> arg: '' x: 102 y: 69
> Text3.cpp (631): Text::dispatch: cmd: action: 207 [] arg: '' x: 102 y: 69
> Cursor.cpp (781): Cursor::dispatch: cmd: action: 208 [] arg: '' x: 102 y:
> 69
>
> insets\InsetText.cpp (293): InsetText::doDispatch(): cmd: action: 208 []
> arg: '' x: 102 y: 69
> Text3.cpp (631): Text::dispatch: cmd: action: 208 [] arg: '' x: 102 y: 69
>
> the position of cursor does not change, but the MouseMoveEvent is called
> anyway, which is "action: 207" above. I don't think it's LyX's fault though.
> Well there are many possible solutions, I went for the easiest one, patch
> attached, is it ok for commit?
Thanks for looking into this, Eugene. Just to make sure I understand,
you think this is a Qt bug, right? I don't know anything about this
stuff, so hopefully a different LyX developer takes a look. Don't spend
time making a new patch based on my comments (wait for another LyX dev
first), but if you do get a +1 to commit, it would be nice to mark
exactly what parts of the code are in there because of a workaround for
a Qt bug, and how to test that the bug is no longer relevant (e.g., "to
test if this workaround is still needed, try to select a word by
double-clicking in LyX on Windows 10. For more information, see the
following ML thread...").
Taking a step back, what changed that triggered this bug? I'm guessing that it is because we compiled LyX 2.3.5 with a newer Qt version. Is that correct? Is it worth compiling 2.3.4 on your machine to double-check that you *can* reproduce the bug (since using a newer Qt version)? What Qt version was 2.3.4 compiled with? I personally would support putting the added lines in preprocessor guards but I don't know how other LyX developers feel about that. Here is the flavor of preprocessor checking that I think is easiest:
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
// code here...
#endif
Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200704/ce020308/attachment.asc>
More information about the lyx-devel
mailing list