Bug 128285 - Navigator heading selection jumps when context menu is open
Summary: Navigator heading selection jumps when context menu is open
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.4.0
Keywords: bibisectRequest, regression
: 120281 (view as bug list)
Depends on:
Blocks: Navigator
  Show dependency treegraph
 
Reported: 2019-10-21 04:21 UTC by Jim Raykowski
Modified: 2019-10-31 12:03 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
headings test file (19.00 KB, application/vnd.oasis.opendocument.text)
2019-10-21 04:21 UTC, Jim Raykowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Raykowski 2019-10-21 04:21:43 UTC
Created attachment 155174 [details]
headings test file

Headings are tracked in the Navigator when content navigation view is in Headings root mode. When the context menu is activated for a heading entry in the Navigator which is not the heading of current cursor position in the document the selected heading will jump to the heading entry in the Navigator content list that has cursor position focus in the document.

Steps to repro:
1) Open the attached headings test file
2) Open the Navigator - Menu > View > Navigator or F5
3) Toggle to Headings root mode - Click the Content Navigation View button in the tool box above the content tree. It's the first button on the second line.
4) Right click on any heading other than the focused heading

Results: After the context menu is displayed focus jumps to heading entry in list that has focus in the document.

Expected results: Focus remains on heading entry which right click was done to access the context menu.
Comment 1 Dieter 2019-10-21 05:45:59 UTC
I confirm it with

Version: 6.4.0.0.alpha0+ (x64)
Build ID: 758516295e5f69393bd78bb4af6e7214d48ece0b
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: GL; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded
Comment 2 Xisco Faulí 2019-10-23 11:19:09 UTC
Reproduced in

Version: 5.2.0.0.alpha1+
Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.15; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8

but not in

Version: 4.4.0.0.alpha0+
Build ID: 9835a5823e0f559aabbc0e15ea126c82229c4bc7
Comment 3 Jim Raykowski 2019-10-26 05:11:29 UTC
I bibisect the change of behavior to this commit:

commit a0c700b1493c7b51540d1e77b44d1edd9bf920f0
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Tue Feb 23 15:57:11 2016 +0000

    gtk3: implement native context menus
    
    This reuses lots of the unity machinery which is similar
    to the mac concept of a single toplevel menubar.
    
    So to drive popup menus, part of this is a rework that does away with the idea
    that the "menubar" is the controller of the hierarchy, and instead the top
    element becomes the controller
    
    Change-Id: I4336391718844bc73cfc47c1043f99f0e3b812d8

Version: 5.2.0.0.alpha0+
Build ID: a0c700b1493c7b51540d1e77b44d1edd9bf920f0
CPU Threads: 4; OS Version: Linux 5.0; UI Render: default; 
Locale: en-US (en_US.UTF-8)

----

I think the changes that were made in this commit require a change to how the headings are tracked. Instead of not tracking only when the content tree has focus, only track when the document has focus. This solves the problem of selection changing when the content tree loses focus to the context menu.
Comment 4 Jim Raykowski 2019-10-26 05:51:13 UTC
Here is a patch for review and comments:
https://gerrit.libreoffice.org/#/c/81539/
Comment 5 Commit Notification 2019-10-26 10:40:49 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#128285 Only update Navigator heading tracking if document has focus

It will be available in 6.4.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 6 Buovjaga 2019-10-29 08:47:39 UTC
*** Bug 120281 has been marked as a duplicate of this bug. ***
Comment 7 Xisco Faulí 2019-10-31 12:03:04 UTC
Verified in

Version: 6.4.0.0.alpha1+
Build ID: 2d0a4182712673d8f7a5abe919cd2a1d5ece4a77
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Jim Raykowski, thanks for fixing this issue!