Bug 124092 - When focus is on header/footer frame menu button key input handling should be limited to executing the pop up menu and escape to header/footer edit window
Summary: When focus is on header/footer frame menu button key input handling should be...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Header-Footer
  Show dependency treegraph
 
Reported: 2019-03-15 08:00 UTC by Jim Raykowski
Modified: 2024-11-19 04:39 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
test file for header frame menu button key input caused misbehaviors (9.07 KB, application/vnd.oasis.opendocument.text)
2019-03-15 08:00 UTC, Jim Raykowski
Details
video demonstration of bug report (533.80 KB, video/x-matroska)
2019-03-15 08:04 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-03-15 08:00:49 UTC
Created attachment 149988 [details]
test file for header frame menu button key input caused misbehaviors

Here are steps which show the frame menu button pop up menu unexpectedly displayed at the top of the writer window and menu item "Insert Page Number" selection resulting in the page number inserted in the main document.

1) Open the attached file (bugtest.odt)
2) On page 1 click in the header area or use keyboard shortcut Ctrl+Page Up to move to the header edit window
3) Click on Header (Default Style) v frame menu button
4) Press Escape key to collapse the pop up menu
keyboard focus is now on the frame menu button
5) Press Page down key
document page down action happens
6) Press Space key
header frame menu button pop up menu appears at the top to the screen
7) Press Escape key
8) Press Page up key
9) Press Escape key
cursor is displayed at the end of Page 1 in the main document and Header frame menu button is still visible (you may have to move the mouse pointer over to where the frame menu button would be to have it redraw)
9) Click on Header (Default Style) v frame menu button or press the Space key
10) Select Insert Page Number
page number is inserted in main document resulting in Page 11
Comment 1 Jim Raykowski 2019-03-15 08:04:05 UTC
Created attachment 149989 [details]
video demonstration of bug report
Comment 2 Durgapriyanka 2019-03-15 21:48:28 UTC
Thank you for reporting the bug. I can confirm the bug present in

Version: 6.3.0.0.alpha0+
Build ID: b6b28931435e44aca92b8c0e1659f701e3ed1a87
CPU threads: 2; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-01-30_06:57:04
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 3 Jim Raykowski 2019-03-16 22:26:11 UTC
Code pointers:

class SwHeaderFooterWin is the header/footer frame menu button.

sw/source/uibase/inc/HeaderFooterWin.hxx
Declare a function override of the inherited MenuButton:KeyInput function in class SwHeaderFooterWin. 

sw/source/uibase/docvw/HeaderFooterWin.cxx
Add key input handling code to catch KEY_ESCAPE, KEY_SPACE, KEY_RETURN, and Mod2 + KEY_DOWN.
For KEY_ESCAPE grab focus to the header/footer edit window.
For KEY_SPACE, KEY_RETURN, and Mod2 + KEY_DOWN follow SwHeaderFooterWin base class hierachy to find how to execute its menu.

Search code base for KeyInput to learn about vcl::Window::KeyInput handling function

This is for the case when header/footer edit window is not empty. Currently there isn't a way that focus can be on the header/footer frame menu button when header/footer is empty but if suggested behavior change is made for Bug 124041 a check for empty/header footer edit window will be required so bonus points for implementing check here.

There is additional code required to ensure the popup menu is displayed in the correct location when executed using key input. I can supply code pointers as needed.
Comment 4 Jim Raykowski 2019-03-16 22:57:35 UTC
(In reply to Jim Raykowski from comment #3)
 
> There is additional code required to ensure the popup menu is displayed in
> the correct location when executed using key input.

Oops, not required here. This will be needed if suggested behavior change for Bug 124113 is implemented.
Comment 5 Xisco Faulí 2019-03-22 12:36:13 UTC
@Jim, since you provided the code pointers, can be turn this issue into an easyhack ? or you plan to work on this ?
Comment 6 Aditya Sahu 2019-04-22 19:24:07 UTC
I have some experience in resolving Header Footer bugs, would love to assign it to myself :-)
Comment 7 Xisco Faulí 2019-08-06 14:33:48 UTC
Dear Aditya Sahu,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.
Comment 8 Aditya Sahu 2024-11-19 00:23:32 UTC
Oops, sorry about the 5 year gap. Let me try to close it ASAP.
Comment 9 Aditya Sahu 2024-11-19 01:17:13 UTC
I could not reproduce the bug according to description #c0

> 4) Press Escape key to collapse the pop up menu
> keyboard focus is now on the frame menu button

Pressing the escape key puts the focus on the header text and cursor is visible instead.
Comment 10 Buovjaga 2024-11-19 04:39:13 UTC
Yes, this seems to be WFM. Tested on kf6, gtk3, gen and Windows.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: deaa5dc2a4d5446cdd120236615608702598e365
CPU threads: 2; OS: Windows 11 X86_64 (10.0 build 22621); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-GB
Calc: threaded

Arch Linux 64-bit
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4805277b8d3e93ac652a5ed66d0ed101d64a78c3
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 15 November 2024