Bug 101881 - after using F6 to activate the native gtk3 menubar, the menus opened by keyboard traversal are the vcl menus, not the gtk3 ones
Summary: after using F6 to activate the native gtk3 menubar, the menus opened by keybo...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Caolán McNamara
QA Contact:
URL:
Whiteboard: target:5.3.0 target:5.2.3
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2016-09-03 19:01 UTC by Yousuf Philips (jay)
Modified: 2016-09-11 08:03 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
screencast (7.50 MB, video/webm)
2016-09-07 13:34 UTC, Yousuf Philips (jay)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) 2016-09-03 19:01:41 UTC
Steps:
1) Start gtk3 build of writer
2) press f6 twice to access menu bar (bug 101879)
3) notice that the file menu header isnt highlighted
4) press down doesnt open the file menu, so press left or right to move to a different menu
5) move to the insert menu and notice the menu header isnt highlighted and the menu isnt aligned with the menu header
6) move the mouse to the menu and notice the gtk3 menu will appear and the gtk2 menu wont disappear

Tested with own build of 5.3 master.
Comment 1 Maxim Monastirsky 2016-09-06 22:34:49 UTC
Can't reproduce under Fedora 24. I don't see anything unusual with the menu, and there is only gtk3 one.
Comment 2 Caolán McNamara 2016-09-07 13:08:47 UTC
Maybe a screenshot would help to explain. I especially don't understand the comment about "gtk2 menu wont disappear" and "gtk3 menu will appear".

Its supposed to be a fairly stock gtk3 menubar widget and set of menus, by which I mean we have fairly limited direct interaction with it.
Comment 3 Yousuf Philips (jay) 2016-09-07 13:34:03 UTC
Created attachment 127195 [details]
screencast

hopefully this will explain it all.
Comment 4 Caolán McNamara 2016-09-07 17:49:23 UTC
Yikes, well that looks utterly vile. So the first "gtk2" menu be a vcl menu themed (badly) to look native, and then the other better looking one is the true gtk3 menu. I wonder how that comes about.

Is it a self-build or a tinderbox build ? Maybe its some particular version of gtk3 that's falling through some ifdef gap
Comment 5 Maxim Monastirsky 2016-09-07 22:50:33 UTC
OK, I reproduced this with the build from git://dev-downloads.libreoffice.org/lo-linux-dbgutil-daily.git as follows:

Fedora 23 livecd - reproducible
Fedora 24 livecd - not reproducible

Xubuntu 16.04 VM - reproducible
Xubuntu 16.04 VM + gtk 3.20 from PPA - not reproducible

So this happens if the system gtk where LO runs is 3.18, but not if it's 3.20 - even if LO wasn't compiled against 3.20.
Comment 6 Caolán McNamara 2016-09-08 09:20:07 UTC
I see it by LD_LIBRARY_PATH pointed to a gtk 3.18 library under fedora 24, looks like the keyboard focus wasn't grabbed by the gtk widget so the keypresses go to the vcl menubar which throws up its own menus then.
Comment 7 Caolán McNamara 2016-09-08 15:26:46 UTC
Using bisect in gtk itself. This began to work in gtk with

commit d54f208d2969550c9eb182b2d5f6173021a1ff34
Author: Carlos Garnacho <carlosg@gnome.org>
Date:   Thu Nov 26 19:54:54 2015 +0100

    GtkMenu: Use gdk_seat_grab()
Comment 8 Commit Notification 2016-09-08 21:04:15 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d45d8ae3c51606eb1d9e63396a0eab13c8742907

Resolves: tdf#101881 gtk3 3.18 menubar doesn't grab keyboard...

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Caolán McNamara 2016-09-08 21:06:18 UTC
That does the trick for me with gtk 3.18.

Maybe its a mistake in the first place to sort of emulate the "activate the menubar without activating a menu" behaviour. I don't see gnome apps working this way. But for the moment lets keep on this road.
Comment 10 Yousuf Philips (jay) 2016-09-08 21:46:58 UTC
Thanks for the quick fix Caolan. Will test my git build and report back. Is this something worth backporting to 5.2 or 5.1?
Comment 11 Caolán McNamara 2016-09-09 07:05:27 UTC
https://gerrit.libreoffice.org/#/c/28759/ for 5-2. IIRC the 5-1 series doesn't have the native menubar so its not relevant there.
Comment 12 Yousuf Philips (jay) 2016-09-09 07:24:16 UTC
Tested the git build and it works great. Thanks.
Comment 13 Commit Notification 2016-09-11 08:03:55 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=571c187f0610f59573b5e2285b6bfc9589236532&h=libreoffice-5-2

Resolves: tdf#101881 gtk3 3.18 menubar doesn't grab keyboard...

It will be available in 5.2.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.