Bug 157467 - Area background: right-clicking on image to delete or rename should target the clicked one and not the selected one
Summary: Area background: right-clicking on image to delete or rename should target th...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
5.3 all versions
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:25.2.0
Keywords: implementationError
Depends on:
Blocks: Area-Fill-Tab-Image 125969 163824
  Show dependency treegraph
 
Reported: 2023-09-27 07:10 UTC by Buovjaga
Modified: 2024-11-12 14:57 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 Buovjaga 2023-09-27 07:10:49 UTC
1. Writer, Format - Page Style
2. Area - Image
3. Select an image, right-click its neighbour, Rename

See that you are renaming the selected one and not the one you clicked.

Noticed while testing bug 157236.

UX: what do you think?
Comment 1 Heiko Tietze 2023-09-27 08:12:56 UTC
Meaning right click also selects the item (the same applies to Delete; and not only the image tab but all presets). Sounds reasonable.
Comment 2 Justin L 2024-11-11 14:12:03 UTC
I'm trying to fix bug 163824 and bug 125969 (which would greatly increase the chances that someone will wish to delete or rename a pre-defined area fill), so hopefully I can solve this first.

(In reply to Heiko Tietze from comment #1)
> Meaning right click also selects the item
Of course, we don't actually want to select the item. Or perhaps better said, we need to cache the currently selected item before making any right-click changes.
Comment 3 Justin L 2024-11-11 19:38:26 UTC
Since SvxPresetListBox : public ValueSet
probably the code for this is in svtools/source/control/valueset.cxx with FocusRect being the key.

We need to use mnHighItemId instead of mnSelItemId (except that the pop-up window sets mnHighItemId to zero).
Comment 4 Justin L 2024-11-12 00:09:50 UTC
proposed fix at https://gerrit.libreoffice.org/c/core/+/176447
Comment 5 Commit Notification 2024-11-12 13:53:37 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/006541afcf9cf68425ad3eea466c5d9e129f3b63

tdf#157467 SvxPresetListBox: contextmenu must affect item under mouse

It will be available in 25.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 6 Buovjaga 2024-11-12 14:39:36 UTC
Verified, thanks

Arch Linux 64-bit
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 006541afcf9cf68425ad3eea466c5d9e129f3b63
CPU threads: 8; OS: Linux 6.11; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 12 November 2024
Comment 7 Justin L 2024-11-12 14:57:05 UTC
P.S. I didn't notice any way to activate the context menu via the keyboard. I expect that in theory that the item will still be the "highlighted" one, and so my change ought to still work if keyboard access is ever hooked up.