Bug 116384 - Drag-select email address grabs & moves first letter (gtk2 and gtk3)
Summary: Drag-select email address grabs & moves first letter (gtk2 and gtk3)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All Linux (All)
: medium minor
Assignee: Caolán McNamara
URL: https://ask.libreoffice.org/t/disable...
Whiteboard: target:7.2.0 target:7.1.4
Keywords: preBibisect, regression
: 46710 119401 (view as bug list)
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2018-03-13 16:31 UTC by Simon Dedman
Modified: 2023-10-21 07:03 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Dedman 2018-03-13 16:31:04 UTC
Description:
Drag-select (click & hold left mouse button, drag to end of word/selection, release) works fine on standard text selections but for email addresses it grabs the first letter only and moves it around.

Steps to Reproduce:
1. Drag-select an email address

Actual Results:  
First letter moves, rather than selection expanding as you move your mouse

Expected Results:
selection expanding as you move your mouse


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 6.0.2.1
Build ID: 1:6.0.2~rc1-0ubuntu0.17.10.1~lo1
CPU threads: 16; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: en-GB (en_US.UTF-8); Calc: CL

glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 1080 Ti/PCIe/SSE2
OpenGL core profile version string: 4.5.0 NVIDIA 384.111
OpenGL core profile shading language version string: 4.50 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5.0 NVIDIA 384.111
OpenGL shading language version string: 4.50 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 384.111
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0
Comment 1 Buovjaga 2018-03-14 19:25:31 UTC
Repro, but only with gtk2 and gtk3.
3.3 does not have the problem, but 3.6 already has.
Not seen on Windows.

Simon: you can launch from the command line with
SAL_USE_VCLPLUGIN=gen libreoffice

to use a generic backend that does not have this problem.

Arch Linux 64-bit
Version: 6.1.0.0.alpha0+
Build ID: 6a9326803c01f4c9bc7da855053ce4e80646fad8
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on March 14th 2018

Arch Linux 64-bit
Version 3.6.7.2 (Build ID: e183d5b)

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

Version: 6.1.0.0.alpha0+
Build ID: 5b87abe06da35ca3a11628674af23460349b439a
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-03-12_23:45:38
Locale: fi-FI (fi_FI); Calc: group
Comment 2 Simon Dedman 2018-03-14 19:52:16 UTC
Thanks Buovjaga. I just tried that; oddly enough this bugs out differently: without completing the drag it automatically grabs the whole email address. It's not obvious what has been grabbed until you drop it somewhere.
Comment 3 Buovjaga 2018-03-15 07:01:41 UTC
(In reply to Simon Dedman from comment #2)
> Thanks Buovjaga. I just tried that; oddly enough this bugs out differently:
> without completing the drag it automatically grabs the whole email address.
> It's not obvious what has been grabbed until you drop it somewhere.

It only behaves that way, if I hold the mouse button and drag *beyond the email*. It works just fine, if I release the hold at the end of the email.
Comment 4 Simon Dedman 2018-03-15 16:23:48 UTC
It seems for me it grabs the whole email address if you start the click on the email or at/in front of the first character (using SAL_USE_VCLPLUGIN=gen libreoffice). If I don't use that then wherever I start the click within the email, it grabs that letter.
Comment 5 QA Administrators 2019-03-16 03:56:40 UTC Comment hidden (obsolete)
Comment 6 Babak Razmjoo 2019-03-27 15:05:00 UTC
It is present in
Version: 6.2.2.2
Build ID: 2b840030fec2aae0fd2658d8d4f9548af4e3518d
CPU threads: 1; OS: Linux 5.0; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

Even when using X11 for VCL, but only its behaviour differs a little . It is more depending on the zoom level and whether the cursor overlapped by the first letter of the email.
Comment 7 Buovjaga 2019-05-19 18:56:19 UTC
Tried with the oldest commit of 43all bibisect repo and sadly this is reproducible, so we can't bibisect.
Comment 8 Justin L 2021-03-26 16:09:22 UTC
repro 7.2+
Comment 9 Justin L 2021-03-31 17:58:13 UTC
Without any code pointers, this probably needs Caolan's knowledge.
Comment 10 Caolán McNamara 2021-04-28 15:38:28 UTC
The difference between gen and gtk3 is that in gen the default mnStartDragWidth value is 2, so if the mouse moves 2 pixels from the click site it turns into a drag event but under gtk it comes from the system gtk-dnd-drag-threshold setting which is 8 pixels for me. The gtk one is large enough to allow the first letter of the draggable hyperlink to be selected before it turns into a "drag".

If I change the gen one to be 8 the same effect occurs, and if I change the gtk one to be 2 it behaves the same as how gen works with 2. Under windows this comes from SM_CXDRAG/SM_CYDRAG system settings so I guess its possible this occurs on windows too under some customization possibilities
Comment 11 Caolán McNamara 2021-04-28 16:18:38 UTC
When the drag kicks in for normal text then we don't do the drag if we are still in the actively-selecting mode in writer, it seems sensible to do the same for hyperlinks so if we're still selecting then don't drag it
Comment 12 Commit Notification 2021-04-28 18:48:52 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9f46ae1ab572b62af01119dcd473f99184e4760c

tdf#116384 only drag hyperlink if user's not currently setting the selection

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Caolán McNamara 2021-04-28 18:50:17 UTC
that always bugged me, good to find out why is was happening. Backport to 7-1 in gerrit.
Comment 14 Simon Dedman 2021-04-28 21:33:13 UTC
(In reply to Caolán McNamara from comment #13)
> that always bugged me, good to find out why is was happening. Backport to
> 7-1 in gerrit.

Brilliant stuff - cheers Col!
Comment 15 Commit Notification 2021-04-29 09:30:46 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/a559e6e6574b84c061fb5a90291276819f3b0c33

tdf#116384 only drag hyperlink if user's not currently setting the selection

It will be available in 7.1.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Buovjaga 2021-04-29 17:33:55 UTC
Verified

Arch Linux 64-bit
Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 9224109de3cf2b620ff1165d31e9fb2a4cd680cf
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 29 April 2021
Comment 17 Stéphane Guillou (stragu) 2023-10-19 13:22:17 UTC
*** Bug 119401 has been marked as a duplicate of this bug. ***
Comment 18 Stéphane Guillou (stragu) 2023-10-21 05:26:16 UTC
*** Bug 46710 has been marked as a duplicate of this bug. ***