Bug 158179 - Layer tab popup menu in Draw shows layer visibility setting of previous selected tab
Summary: Layer tab popup menu in Draw shows layer visibility setting of previous selec...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0
Keywords:
Depends on:
Blocks: Layers
  Show dependency treegraph
 
Reported: 2023-11-11 22:07 UTC by Jim Raykowski
Modified: 2023-11-27 08:06 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
file for use to repro bug (8.13 KB, application/vnd.oasis.opendocument.graphics)
2023-11-11 22:07 UTC, Jim Raykowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Raykowski 2023-11-11 22:07:14 UTC
Created attachment 190792 [details]
file for use to repro bug

Steps to repro this bug:

1. Open the attached Draw file.

2. Right-click on the Layer5 blue colored text tab.

Results: Show Layer (Shift+Click) menu item is checked.

Expected Results: Show Layer menu item is not checked because it is set not visible (indicated by the tabs blue text color).

3. With the popup menu still showing, right-click on the Layer4 tab.

Results: Popup menu closes as expected.

4. Right-click again on the Layer4 tab.

Results: Show Layer menu item is not checked.

Expected Results: Show Layer menu item is checked because it is set visible.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e70f5d3db3ad64c3d6a21de998b238bd5d4ac8b5
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

The cause seems to be an issue with how the layer switch command is dispatched in void LayerTabBar::Select()[1]. Changing the dispatcher execute call mode parameter argument from SfxCallMode::ASYNCHRON to SfxCallMode::SYNCHRON produces expected Show Layer menu item results for me.

Including Heiko who did the work for enhancement bug 113439 that added the Show Layer menu item.

[1] https://opengrok.libreoffice.org/xref/core/sd/source/ui/dlg/LayerTabBar.cxx?r=9b9159aa#137
Comment 1 Heiko Tietze 2023-11-13 09:32:15 UTC
Wouldn't it be easy to just rename the command to "Hide Layer"? Usually labels should be phrased positively but in this case it is about explicitly hiding. Nothing to say against change the internal logic, although it involves more effort.
Comment 2 Jim Raykowski 2023-11-14 23:18:20 UTC
(In reply to Heiko Tietze from comment #1)
> Wouldn't it be easy to just rename the command to "Hide Layer"? Usually
> labels should be phrased positively but in this case it is about explicitly
> hiding. Nothing to say against change the internal logic, although it
> involves more effort.
In this case it seems to me better to use "Hide Layer". The effort to rename and change the internal logic isn't so much. Here's a link to a patch that renames/reworks the menu item and fixes the reported bug:
https://gerrit.libreoffice.org/c/core/+/159427
Comment 3 Commit Notification 2023-11-16 03:48:28 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7f79b0caf194ff9d7dfa2f85379a5c752c905476

tdf#158179 Fix layer tab menu layer visibility check menu item

It will be available in 24.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.