Bug 160462 - F10 key is marked reserved, but doesn't do anything (qt5/kf5)
Summary: F10 key is marked reserved, but doesn't do anything (qt5/kf5)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.0 all versions
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:25.2.0 target:24.8.0.0.beta2
Keywords: accessibility
Depends on:
Blocks: Shortcuts-Accelerators KDE, KF5
  Show dependency treegraph
 
Reported: 2024-04-01 17:55 UTC by Tyler
Modified: 2024-06-13 20:36 UTC (History)
4 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 Tyler 2024-04-01 17:55:32 UTC
Version: 7.6.5.2 (X86_64) / LibreOffice Community
Build ID: 38d5f62f85355c192ef5f1dd47c5c0c0c6d6598b
CPU threads: 16; OS: Linux 5.10; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded

Hi,

in the Tools->Customize->Keyboard dialog, F10 is shown as reserved (gray, on both "LibreOffice" and "Writer" levels), but pressing F10 has no effect.

F10 should be either available for user assignment or the intended hard-coded function (if there is one) should be fixed.

BR,
Tyler
Comment 1 V Stuart Foote 2024-04-01 20:32:50 UTC
F10 should take your from anywhere in the UI to the main menu landing on the File menu. 

It and the UI component advance <F6> (with <Shift>+F6 backward movements) are "reserved" in LibreOffice as core keyboard "accessibility", so appear greyed out in the Customize dialog.

Can't confirm as both keyboard reservations work as expected.

Version: 24.2.2.1 (X86_64) / LibreOffice Community
Build ID: bf759d854b5ab45b6ef0bfd22e51c6dc4fb8b882
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c9d4f99b2bb54ac7735b3e0d0cadbafbd0279518
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 2 V Stuart Foote 2024-04-01 20:54:11 UTC
The F10, F6 and F4 key sequences are reserved for internal VCL use as here, most if not all have a defined function of some sort:

https://opengrok.libreoffice.org/xref/core/vcl/source/app/svapp.cxx?r=324f2e13#99
Comment 3 Tyler 2024-04-02 23:54:32 UTC
Yes, I found the ReservedKeys table, too, but didn't find any special treatment of plain F10.

Shift+F10 works (toggle sidebar docking).
F6 and Shift+F6 also work in the sense that the keys are recognized,
but the focus cycles only between document canvas, docked sidebar, toolbars. Menubar and floating (i.e. undocked, top-level) windows are left out.

Probably Linux-specific.
PS: I've checked that F10 isn't gobbled up by the DE.
Comment 4 Stéphane Guillou (stragu) 2024-05-16 16:02:25 UTC
Ilmari recently clarified reserved shortcuts with:

commit e1c59fd539222973410dc6adcb8eac4abeeb9e6a
author	Ilmari Lauhakangas Tue Apr 23 14:02:00 2024 +0300
committer	Ilmari Lauhakangas Thu Apr 25 11:01:17 2024 +0200
Improve documentation on reserved shortcuts

For F10 we now have:

vcl::KeyCode(KEY_F10,0)     // Activate the first menu

...which matches the Help: https://help.libreoffice.org/latest/en-US/text/shared/04/01010000.html

But it's true that for me, F10 does not do anything in a recent daily build:

Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 658a212585c56540a17c41111e6829716d4ef4e3
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

... and already in 6.2.0.3 (gtk3 as well).

It used to work with the gtk2 VCL plugin, e.g. in:

Version: 6.1.0.3
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group threaded

And still works with gen.
Comment 5 Buovjaga 2024-05-16 16:56:28 UTC
F10 opens the first menu for me with gtk3. With gen, it moves the focus there, but doesn't open. With kf5/kf6, it seems this never worked (tested with 7.0).

Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 98142886f21e40d0f7052f18108d9586f4b2fbc5
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Comment 6 Buovjaga 2024-05-17 06:53:44 UTC
F10 does move the focus to the first menu on Windows as well (so you can hit Down arrow to open the menu).

Somewhat interesting is this handling of alternate keycodes found only in gen and gtk3 plugins:
https://opengrok.libreoffice.org/xref/core/vcl/unx/generic/window/salframe.cxx?r=10831c8b#2613
https://opengrok.libreoffice.org/xref/core/vcl/unx/gtk3/gtkframe.cxx?r=bee080ab#337

// F10 means either KEY_F10 or KEY_MENU, which has to be decided
// in the independent part.

This leads to the way more interesting
https://opengrok.libreoffice.org/xref/core/vcl/source/window/menubarwindow.cxx?r=f0977206#750

if ( nCode == KEY_MENU && !rKEvent.GetKeyCode().IsShift() ) // only F10, not Shift-F10
{
    mbAutoPopup = false;
    if ( m_nHighlightedItem == ITEMPOS_INVALID )
    {
        ChangeHighlightItem( 0, false );
        GrabFocus();
    }
    else
    {
        ChangeHighlightItem( ITEMPOS_INVALID, false );
        m_xSaveFocusId = nullptr;
    }
    bDone = true;
}

and another special case:
https://opengrok.libreoffice.org/xref/core/vcl/source/window/menufloatingwindow.cxx?r=f0977206#1144

Then there is this for Windows:
https://opengrok.libreoffice.org/xref/core/vcl/win/window/salframe.cxx?r=d4a110f8#5130
// Process here KeyMenu events only for Alt to activate the MenuBar

Indeed, Left Alt on Windows acts just like F10 in that it moves the focus into the first menu.
Comment 7 Stéphane Guillou (stragu) 2024-06-11 04:24:02 UTC
(In reply to Buovjaga from comment #5)
> F10 opens the first menu for me with gtk3.
Which GNOME version?
With 42.9, focus doesn't leave the document for me.
And then we've got someone using 46.2 reporting first menu being focused but not able to move to the next one with arrows: https://listarchives.libreoffice.org/global/accessibility/msg01145.html
Comment 8 Buovjaga 2024-06-11 07:47:43 UTC
(In reply to Stéphane Guillou (stragu) from comment #7)
> (In reply to Buovjaga from comment #5)
> > F10 opens the first menu for me with gtk3.
> Which GNOME version?
> With 42.9, focus doesn't leave the document for me.
> And then we've got someone using 46.2 reporting first menu being focused but
> not able to move to the next one with arrows:
> https://listarchives.libreoffice.org/global/accessibility/msg01145.html

Not GNOME, but KDE. GTK version is 3.24.42
Comment 9 Michael Weghorn 2024-06-13 07:19:21 UTC
Pending Gerrit change for kf5 and other Qt-based VCL plugins:
https://gerrit.libreoffice.org/c/core/+/168765


(In reply to Stéphane Guillou (stragu) from comment #7)
> (In reply to Buovjaga from comment #5)
> > F10 opens the first menu for me with gtk3.
> Which GNOME version?

Works fine for me, too, on Debian testing with libgtk-3-0t64:amd64            3.24.42-1 and 

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6f4adc1274cfac30b9097411bb193bd4386969f0
CPU threads: 32; OS: Linux 6.7; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: CL threaded

> With 42.9, focus doesn't leave the document for me.
> And then we've got someone using 46.2 reporting first menu being focused but
> not able to move to the next one with arrows:
> https://listarchives.libreoffice.org/global/accessibility/msg01145.html

That's a GTK/Mutter/Wayland issue, and not LO-specific (see the further emails in that thread).

@Stéphane: Does the menu open for you on F10 if you use the "Menus" example from gtk3-demo instead of LO?
Comment 10 Commit Notification 2024-06-13 13:30:21 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

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

tdf#160462 qt a11y: Open menu bar on F10

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 11 Michael Weghorn 2024-06-13 13:35:03 UTC
(In reply to Michael Weghorn from comment #9)
> Pending Gerrit change for kf5 and other Qt-based VCL plugins:
> https://gerrit.libreoffice.org/c/core/+/168765

That's merged now.

> @Stéphane: Does the menu open for you on F10 if you use the "Menus" example
> from gtk3-demo instead of LO?

@Stéphane: Since gtk3 works for Ilmari and myself, I'd suggest to track that in a separate issue if you see the issue only with LO, not other GTK 3 applications.

-> Closing as fixed.
Comment 12 Stéphane Guillou (stragu) 2024-06-13 13:53:41 UTC
(In reply to Michael Weghorn from comment #11)
> (In reply to Michael Weghorn from comment #9)
> > Pending Gerrit change for kf5 and other Qt-based VCL plugins:
> > https://gerrit.libreoffice.org/c/core/+/168765
> 
> That's merged now.
> 
> > @Stéphane: Does the menu open for you on F10 if you use the "Menus" example
> > from gtk3-demo instead of LO?
> 
> @Stéphane: Since gtk3 works for Ilmari and myself, I'd suggest to track that
> in a separate issue if you see the issue only with LO, not other GTK 3
> applications.
Indeed, also reproduced with gtk3-demo > Menus.
Thanks for the qt5/kf5 fix!
Comment 13 Commit Notification 2024-06-13 20:36:32 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#160462 qt a11y: Open menu bar on F10

It will be available in 24.8.0.0.beta2.

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.