Bug Hunting Session
Bug 93096 - Selecting text with keyboard (partially outside current view) results in wrong highlighting and mangled text
Summary: Selecting text with keyboard (partially outside current view) results in wron...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.0.5 release
Hardware: x86 (IA32) Windows (All)
: high critical
Assignee: Miklos Vajna
URL:
Whiteboard: target:5.1.0 target:5.0.2 target:5.0.1
Keywords: bibisected, bisected, regression
: 93338 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-08-03 09:21 UTC by David Burleigh
Modified: 2016-10-25 19:20 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
A few paragraphs of text to test text selection (24.54 KB, application/vnd.oasis.opendocument.text)
2015-08-03 09:21 UTC, David Burleigh
Details
Bad Highlighting selection (159.62 KB, image/png)
2015-08-03 11:05 UTC, Jacques Guilleron
Details
PDF with screen shots showing various steps and broken selection result (197.97 KB, application/pdf)
2015-08-04 08:36 UTC, Cor Nouws
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Burleigh 2015-08-03 09:21:57 UTC
Created attachment 117622 [details]
A few paragraphs of text to test text selection

In the attached sample document, with cursor at the beginning of the title of the document, do: Ctrl-Shift Down-Arrow (three clicks) and you will see that the highlighting of the selected text goes awry.

This is also a problem with RC5, which isn't yet a choice in your Version menu.
Comment 1 Jacques Guilleron 2015-08-03 11:05:14 UTC
Created attachment 117623 [details]
Bad Highlighting selection
Comment 2 Jacques Guilleron 2015-08-03 11:16:41 UTC
Hi David,

I reproduce with 
LO 5.1.0.0.alpha1+ Build ID: 8cfdd81b70ef37927b40497ffd10034f28335034
TinderBox: Win-x86@39, Branch:master, Time: 2015-07-24_02:47:18
LO 5.0.0.3 Build ID: f79b5ba13f5e6cbad23f8038060e556217e66632
& Windows 7 Home Premium
but not with 
LO 5.0.0.2 Build ID: a26d58f11b99b6aeddf7f7884effea188cc6e512
Right display is achieved by Ctrl+Maj+Up arrow and again Ctrl+Maj+Down arrow.
I join a screenshot.

Thanks for the report.
Comment 3 Cor Nouws 2015-08-04 08:33:57 UTC
Additionally: 
- open the side bar so that text is partially covered;
- select a paragraph with Ctrl+Shft+Down;
 > Highighted text is mangled

Will add screen shots
Comment 4 Cor Nouws 2015-08-04 08:36:10 UTC
Created attachment 117639 [details]
PDF with screen shots showing various steps and broken selection result
Comment 5 Cor Nouws 2015-08-04 08:46:25 UTC
Hmm, find no duplicates (at least not in component Writer).

Cannot test with OpenGL enabled, because that setting is not kept (opening Options > General > View again does not show it selected).
Comment 6 Cor Nouws 2015-08-04 08:51:02 UTC
(In reply to Cor Nouws from comment #5)

(
 > Cannot test with OpenGL enabled, because that setting is not kept (opening
 > Options > General > View again does not show it selected).
 
 this is tdf#91549  )
Comment 7 Cor Nouws 2015-08-11 07:30:06 UTC
*** Bug 93338 has been marked as a duplicate of this bug. ***
Comment 8 Matthew Francis 2015-08-16 13:53:47 UTC
This seems to have begun at the below commit.
Adding Cc: to vmiklos@collabora.co.uk; Could you possibly take a look at this one? Thanks

commit c9175a1bd3249ad573ae6827bf19963a3ebe2fbc
Author: Miklos Vajna <vmiklos@collabora.co.uk>
Date:   Fri Jul 3 17:52:44 2015 +0200

    SwViewShell::ImplEndAction: avoid direct PaintDesktop()
    
    With double-buffering enabled and typing quickly, one saw blinks in the
    text sometimes. The reason was that PaintDesktop() painted directly
    outside SwViewShell::Paint().
    
    The problem is more visible with VCL_DOUBLEBUFFERING_AVOID_PAINT=1,
    loading a simple document + pressing a key draw an unexpected white
    rectangle.
    
    Given that InvalidateWindows() already calls PaintDesktop() inside
    Paint() implicitly (via SwViewShell::Paint()), fix the problem by just
    avoiding the DLPrePaint2() + PaintDesktop() + DLPostPaint2() calls.
    
    Change-Id: Ib8ce26a0bdd526bf85d362f0e865dd61d29f6d11
Comment 9 GABORIT Jean-Luc 2015-08-16 17:38:02 UTC
I reproduce with LO 5.0.0.5
Build ID: 1b1a90865e348b492231e1c451437d7a15bb262b
Windows 7 Edition Familliale Premium Service Pack1
Comment 10 Miklos Vajna 2015-08-17 20:56:59 UTC
Could you please check if starting LO with 'VCL_DOUBLEBUFFERING_FORCE_ENABLE=1 soffice' results in no such problem, i.e. the problem is specific to the non-double-buffering case?

Quickly checking I think this is the case, but double-checking would be appreciated.
Comment 11 Matthew Francis 2015-08-18 01:49:03 UTC
(In reply to Miklos Vajna from comment #10)
> Could you please check if starting LO with
> 'VCL_DOUBLEBUFFERING_FORCE_ENABLE=1 soffice' results in no such problem,
> i.e. the problem is specific to the non-double-buffering case?

Yes, enabling that seems to stop the issue
Comment 12 Commit Notification 2015-08-18 08:22:46 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=222f10e773ba51a19880be1b798990260c198147

tdf#93096 sw: fix selection with keyboard outside current view

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Miklos Vajna 2015-08-18 08:26:31 UTC
Resolved on master, will backport.
Comment 14 Commit Notification 2015-08-18 12:16:13 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a56cda359b45a900d0b5d017693efccf3b5b2e59&h=libreoffice-5-0

tdf#93096 sw: fix selection with keyboard outside current view

It will be available in 5.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2015-08-20 14:58:39 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-5-0-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5c1b030d82dd9db2728724341db901d0bf680ba1&h=libreoffice-5-0-1

tdf#93096 sw: fix selection with keyboard outside current view

It will be available in 5.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Robinson Tryon (qubit) 2015-12-17 10:30:09 UTC Comment hidden (obsolete)