Bug 160731 - Navigate By Recency (aka Navigation toolbar) does not work under gtk3 + Wayland
Summary: Navigate By Recency (aka Navigation toolbar) does not work under gtk3 + Wayland
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Jim Raykowski
URL:
Whiteboard: target:24.8.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Wayland GTK3 Navigate-By
  Show dependency treegraph
 
Reported: 2024-04-19 12:56 UTC by Stéphane Guillou (stragu)
Modified: 2024-05-02 10:38 UTC (History)
3 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 Stéphane Guillou (stragu) 2024-04-19 12:56:03 UTC
Steps:
1. Open Writer, enter two sample paragraphs
2. Click somewhere inside the first paragraph, then inside the second paragraph
3. Expand the Navigator sidebar deck, click on the Navigate By listbox, select "Recency"
4. Click on the "Go back" arrow several times

Result: cycles between only two positions: the last position and the beginning of that sentence. "Go forward" does not become available.

Expected: goes through whole history of actual cursor positions.

Reproduced on Wayland with:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bdf3b5ce49b0e4ee1b4525d344cfb037ef473059
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3

And in 7.3.0.3.

- Not reproduced in 7.2.0.4 -> regression
- Not reproduced with kf5 (cairo+wayland) -> gtk3-only
- Not reproduced in a MetaWindowXwayland launched with:

GDK_BACKEND=x11 soffice --writer

Bibisected with linux-64-7.3 repo to first bad build [db4632fcc1515743c13addf2d6dbad98df160386] which points to:

commit cf8de077f885b7632967c8bdfde98279d98f4cce
author	Jim Raykowski 	Mon Oct 18 21:49:45 2021 -0800
committer	Jim Raykowski 	Wed Oct 20 02:42:57 2021 +0200
tdf#74604 tdf#54412 Make recency work for hyperlink, field and footnote
cursor position changes
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123793

Jim, can you please have a look?
Caolán, maybe you have an idea?
Comment 1 Jim Raykowski 2024-04-19 17:44:37 UTC
Quickly commenting out these two lines of code seems to make the recency work as expected using gtk3 under wayland.

bool SwCursorShell::CallCursorShellFN( FNCursorShell fnCursor )
{
//    if (SwWrtShell* pWrtSh = dynamic_cast<SwWrtShell*>(this))
//        pWrtSh->addCurrentPosition();
Comment 2 Commit Notification 2024-04-22 18:52:36 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5740d3fa83e9725a2771e5f00ba4aaf9965f0be2

Resolves tdf#160731 Navigate by recency does not work under gtk3 +

It will be available in 24.8.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 3 Stéphane Guillou (stragu) 2024-05-02 10:38:46 UTC
Thanks Jim, fix verified in:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ce454f382d0d005dd3de021c7820be3ffa0bb582
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded