Bug 129634 - Keyboard navigation not working when focus is in a toolbar item with a sub control (GTK3)
Summary: Keyboard navigation not working when focus is in a toolbar item with a sub co...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:6.5.0 target:7.0.0
Keywords: bibisected, bisected, regression
: 129776 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-12-26 18:26 UTC by Jim Raykowski
Modified: 2020-02-05 11:40 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
bug demonstration (914.40 KB, video/x-matroska)
2020-02-04 00:03 UTC, Jim Raykowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Raykowski 2019-12-26 18:26:55 UTC
When keyboard focus is in a toolbar combo box control like Set Paragraph Name, Font Name, and Font Size, or when focus is in the overflow menu, keyboard navigation using the tab key no longer works for GTK3 vcl backend.

Steps to repro:

1) In writer, with standard toolbar user interface, use F6 key to move keyboard focus to the Set Paragraph Name control or just mouse click in any toolbar combo box control.

2) Press the tab or shift+tab to keyboard navigate focus to the next or previous control in the toolbar.

Results: Focus is lost

Addition info:

The following message is issued to the the terminal:

warn:vcl:18849:18849:vcl/source/window/winproc.cxx:856: ImplHandleKey: Keyboard-Input is sent to a frame without focus

Bug seems to have started with commit bce3b6af1a71d4586f1e0d4cf56cd794454ea3b1

Author: Caolán McNamara <caolanm@redhat.com>
Date:   Tue Dec 17 15:32:23 2019 +0000

    allow default GtkWindow to handle key events first
Comment 1 V Stuart Foote 2019-12-27 14:25:25 UTC
@Mike, I've been seeing this in Windows builds on the Notebook Bar, the tab/cursor "key traps" passing into the listbox widgets, in bug 109425--related?
Comment 2 V Stuart Foote 2019-12-27 14:26:36 UTC
s/@Mike/@Jim  -- sorry Jim, working on my first cup of coffee - Stuart
Comment 3 Xisco Faulí 2019-12-27 15:36:27 UTC
Reproduced in

Version: 6.5.0.0.alpha0+
Build ID: 1abfc8e2f677024ea058e96f3133e503ba89ea02
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

Adding Cc: to Caolán McNamara
Comment 4 Caolán McNamara 2020-01-06 10:34:36 UTC
https://gerrit.libreoffice.org/c/core/+/86262 makes this work for me
Comment 5 Commit Notification 2020-01-06 11:36:13 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#129634 send SalEvent::LoseFocus only if some other widget gains focus

It will be available in 6.5.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 Caolán McNamara 2020-01-06 11:39:14 UTC
FWIW re comment #1, bug #109425 must be something different as this is gtk3 only
Comment 7 Terrence Enger 2020-01-06 14:29:30 UTC
*** Bug 129657 has been marked as a duplicate of this bug. ***
Comment 8 Terrence Enger 2020-01-06 14:35:07 UTC
*** Bug 129776 has been marked as a duplicate of this bug. ***
Comment 9 Terrence Enger 2020-01-06 20:58:11 UTC
In a local build of commit 92ccf53b, running under xfce, configured

    CCFLAGS=-Wshadow
    --with-jdk-home=/usr/lib/jvm/default-java
    --enable-split-debug
    --enable-gdb-index
    --enable-ld=gold
    --enable-option-checking=fatal
    --enable-dbgutil
    --enable-debug
    --without-system-postgresql
    --without-myspell-dicts
    --with-extra-buildid
    --without-doxygen
    --with-external-tar=/home/terry/lo_hacking/git/src
    --without-package-format

and built and running on debian-buster, I still see the problem.  I am
setting bug status REOPENED.
Comment 10 Xisco Faulí 2020-01-07 15:48:44 UTC
The issue is fixed for me

Version: 6.5.0.0.alpha0+
Build ID: bf540873f5e258452fed5006f65a403c95e7872a
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Terrence Enger, Could you please paste the info from Help - about LibreOffice ?
Comment 11 Jim Raykowski 2020-01-07 19:52:22 UTC
I confirm bug is gone when toolbar is docked. 
Unexpected behavior still present when toolbar is undocked.

Version: 6.5.0.0.alpha0+
Build ID: ecb5130e16898c0d2485e99564c57882b5ef25b0
CPU threads: 4; OS: Linux 5.0; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 12 Terrence Enger 2020-01-08 14:50:04 UTC
Whoops!  I am confused.  My comment 9 should have been applied to
bug 129776.

My change of status to REOPENED was wrong, but I am leaving it, in view
of Jim Raykowski's comment 11.
Comment 13 Caolán McNamara 2020-02-03 14:56:48 UTC
how about now after...

https://cgit.freedesktop.org/libreoffice/core/commit/?id=b7411079bb833aa2857aa4b0de7cd4eeb6dc06fa

vcl: ignore floating window set-focus events
because they generate unwanted lose focus events in their parent. We
only want these set-focus events for native widgets hosted in the
sidebar.

does that make a difference ?
Comment 14 Jim Raykowski 2020-02-04 00:03:17 UTC
Created attachment 157624 [details]
bug demonstration

Still repro with gtk3
Comment 15 QA Administrators 2020-02-04 03:31:38 UTC Comment hidden (obsolete)
Comment 16 Commit Notification 2020-02-04 11:52:42 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/02c5a61944a212ecc4573001a2fb853339448b03

tdf#129634 ignore floating toolbars

It will be available in 7.0.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 17 Jim Raykowski 2020-02-04 23:09:48 UTC
I confirm the most recent patch fixes the keyboard navigation issue. Thanks Caolán!
Comment 18 Caolán McNamara 2020-02-05 11:40:53 UTC
oh good