Bug 54169

Summary: LibreOffice doesn’t obey OS setting “only show the accelerator underline when the Alt key is being pressed”
Product: LibreOffice Reporter: Samuel Mehrbrodt <s.mehrbrodt>
Component: UIAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: minor    
Priority: medium CC: fitojb, jbfaure, libreoffice, qubit, s.mehrbrodt, valentin.stn
Version: 4.0.0.0.alpha0+ Master   
Hardware: All   
OS: All   
See Also: https://bugzilla.gnome.org/show_bug.cgi?id=588554
Whiteboard: EasyHack SkillCpp DifficultyInteresting
i915 platform: i915 features:

Description Samuel Mehrbrodt 2012-08-28 21:13:18 UTC
On Ubuntu, acceleators (underlined characters to access with the keyboard) on Buttons, checkboxes and in the Menu are only shown when pressing the [ALT] key.

Libreoffice always shows the accelerators and this is inconsistent with the Ubuntu Design.
Comment 1 Jean-Baptiste Faure 2012-08-29 05:45:49 UTC
I do not reproduce with Version 3.7.0.0.alpha0+ (Build ID: 96fb245)
Which build did you use? Your own build or a daily build?
If it is your own build, I suggest you to make a fresh build (make clean the make dev-install) and try again.

Best regards. JBF
Comment 2 Samuel Mehrbrodt 2012-09-03 19:31:48 UTC
It is my own build.

I did a fresh build last night and I still have this behavior.
Comment 3 Michael Meeks 2012-11-01 14:45:51 UTC
I guess we would need to add some VCL support for underline accelerators appearing only on alt keypress. I assume it's fine to continue to write Ctrl+O in the File menu against Open (eg.) ? :-)

I guess that something like:

void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
                                 xub_StrLen nIndex, xub_StrLen nLen,
                                 sal_uInt16 nStyle, MetricVector* pVector, String* pDisplayText )

Which has a nStyle that controls whether the mnemonic text is rendered or not would need some hackery - and clearly we'd need to trigger a re-draw of any controls that include such text as/when the user hits the Alt button in various dialogs.

And we'd need a style-setting from the gtk+ backend / theme to detect whether or not to do that. It's quite do-able;

Patches more than welcome :-)
Comment 4 Samuel Mehrbrodt 2013-01-29 07:25:19 UTC
The method mentioned is here:
http://opengrok.libreoffice.org/xref/core/vcl/source/gdi/outdev3.cxx#7088

Marking as ProposedEasyHack.
Comment 5 Samuel Mehrbrodt 2013-02-13 19:51:24 UTC
Here's how GTK did this: https://bugzilla.gnome.org/show_bug.cgi?id=588554
Comment 6 Samuel Mehrbrodt 2013-02-14 08:25:00 UTC
*** Bug 58418 has been marked as a duplicate of this bug. ***
Comment 7 Samuel Mehrbrodt 2013-02-14 08:33:14 UTC
Windows, Mac OS X and Gnome have this setting as default. I have seen only KDE that has the accelerator underline always there.
Comment 8 Björn Michaelsen 2013-10-04 18:47:05 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 9 Robinson Tryon (qubit) 2013-10-19 01:02:13 UTC
Removing comma from whiteboard (please use a space to delimit values in this field)
https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Whiteboard#Getting_Started

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.