Bug 159645

Summary: CTRL-F after applying last used cell background color or font color does not focus search field (gtk3)
Product: LibreOffice Reporter: d4928443
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: caolan.mcnamara, stephane.guillou
Priority: medium Keywords: bibisected, bisected, regression
Version: 7.0.2.2 release   
Hardware: All   
OS: Linux (All)   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=135779
Whiteboard:
Crash report or crash signature: Regression By: Caolán McNamara
Bug Depends on:    
Bug Blocks: 102847, 103182    
Attachments: screenshot of the CTRL-F + background color focus problem

Description d4928443 2024-02-08 18:33:16 UTC
Created attachment 192473 [details]
screenshot of the CTRL-F + background color focus problem

Doing a search with CTRL-F and applying a background color to a cell gives problems with the focus in the Find field when one comes back with CTRL-F and applying background color to another cell.

How to reproduce:

1. create a list, in my example on rows 1 to 6 in column A: apple (in A1), banana (A2), pineapple (A3), strawberry (A4), pear (A5), mango (A6).
2. find the field apple using CTRL-F and typing 'apple' into the search field that than appears below in the window. (see screenshot).

from this point there are 2 variants:
==first variant: steps 3 to 5==
==second variant: steps 6 to 10==

==variant 1==
3. apply a background color to cell A1 choosing any color from the color palette (but not using the rapid button for the last applied color; instead, click the arrow and choose a color from the drop down color palette). 

4. use CTRL-F to go back to the search field. 

5. at this point one can see already an odd behaviour (if you have more search strings in the search field history): the pre filled search term changes to another search string previously used, instead of leaving the last used search word, in this case "apple" there.

==variant 2==
6. close the search bar (with the red cross or with ESC) and give focus to any empty cell with the mouse. This to reset the procedure for variant 2:

7. use CTRL-F to search for another item, for example "banana". 

8. apply a background color to this cell, but this time use the quick color button beside the arrow. So for this variant do not choose from the color palette, but apply the last used color (this should now be the color that you've choosen in variant 1 here above.)

9. use CTRL-F to go back to the search bar, and at this point the focus in the search bar completely freezes. 

10. Actually, it's not frozen, but the focus shifted somewhere between the search field and the arrow to access the search history. One can be released from this (without using a mouse) by using SHIFT-TAB  (the focus then appears on the cross for closing Find and after that another TAB brings you with correct focus back in the search field).
Comment 1 Stéphane Guillou (stragu) 2024-02-27 05:55:41 UTC
Thanks for the report!

(In reply to d4928443 from comment #0)
> ==variant 1==
> 5. at this point one can see already an odd behaviour (if you have more
> search strings in the search field history): the pre filled search term
> changes to another search string previously used, instead of leaving the
> last used search word, in this case "apple" there.
I can't reproduce this.

> ==variant 2==
> 9. use CTRL-F to go back to the search bar, and at this point the focus in
> the search bar completely freezes. 
Reproduced, and the same happens with another split button like Font Colour.

Version: 7.3.0.3 / LibreOffice Community
Build ID: 0f246aa12d0eee4a0f7adcefbf7c878fc2238db3
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d2fa44db6f8a1badece63856ee0f12db4cba9b28
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Not reproduced with gen VCL plugin not kf5, so gtk3-specific.

Bibisected with linux-64-7.0 to first bad build [89a072a16c5f44658af2af88dd24ddc40e23a2c0] which is:

commit 6a4dfa7469168207a9c11463d1b1c9cef5f86c3f
author	Caolán McNamara 	Sun Aug 23 20:12:28 2020 +0100
committer	Michael Stahl 	Mon Aug 24 12:12:15 2020 +0200
tdf#135779 move focus back to usual parent before grabbing pointer
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101153

Caolán, can you please have a look?