Bug 141441 - Font style menulist loses selection when switching fonts (gtk3)
Summary: Font style menulist loses selection when switching fonts (gtk3)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All Linux (All)
: medium trivial
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.4.0 target:7.3.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2021-04-01 21:22 UTC by Eyal Rozenberg
Modified: 2022-04-26 07:14 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Character dialog before and after typing in a new font family name (69.59 KB, image/png)
2021-04-22 19:23 UTC, Eyal Rozenberg
Details
Character dialog before and after typing in a new font family name (71.25 KB, image/png)
2021-04-28 13:50 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2021-04-01 21:22:03 UTC
Reproduction:

1. Create a new writer document
2. Open the Character dialog
3. Type the name of another font family (e.g. if you had Liberation Serif type Liberation Sans, otherwise type Liberation Serif)

The moment you even start typing anything, the selection on the Style menulist is lost. Now, when you type the new font family, approve and re-open the dialog it will be the Regular style (assuming that's what you had to begin with) - but I don't see why the selection should be lost at all (or at least, not restored after some font with a Regular style is selected). Note it is not lost for the font size, for example.
Comment 1 Dieter 2021-04-16 06:32:30 UTC
(In reply to Eyal Rozenberg from comment #0)
> The moment you even start typing anything, the selection on the Style
> menulist is lost.

I can't confirm this with

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 807d059d99e7b99fe45a712428befa17ffa44858
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL
Comment 2 Eyal Rozenberg 2021-04-17 15:15:08 UTC
(In reply to Dieter from comment #1)
> I can't confirm this with etc.

What are your default font families? i.e. what font family do you see when opening the Character dialog?
Comment 3 Dieter 2021-04-18 16:12:52 UTC
(In reply to Eyal Rozenberg from comment #2)
> What are your default font families? i.e. what font family do you see when
> opening the Character dialog?

Default font is Liberation Serif. But reading again your description, I don't understand it anymore.

My steps
1. Open a new writer document
2. Format > Character
3. Mark the current used font name (in my case Liberation Serif)
4. Type Liberation Sans

Result: Nothing strange. There is no selection on the Style menulist. So nothing can be lost. Is it possible for you to add a screencast, to make the steps more clear?
Comment 4 Eyal Rozenberg 2021-04-18 17:02:46 UTC
(In reply to Dieter from comment #3)
> There is no selection on the Style menulist.

If you don't see an item selected in the style menulist of the character dialog both _before_ and _after_ changing the font family, then you have another bug, and should file it as such.

Typically, the selected item should be 'Regular'.
Comment 5 Dieter 2021-04-22 15:01:11 UTC
I think, I misunderstood the meaning of "selection". I only can see, that selection changes (just put cursor in font field and move arrow key up or down), but I can't assess, if this is a bug or not.
Comment 6 Eyal Rozenberg 2021-04-22 19:21:10 UTC
(In reply to Dieter from comment #5)
> I think, I misunderstood the meaning of "selection".

I mean, whether there's a selected item in the menulist. I'll attach an illustration.
Comment 7 Eyal Rozenberg 2021-04-22 19:23:00 UTC
Created attachment 171361 [details]
Character dialog before and after typing in a new font family name

On the left side is the dialog as you find it when opening it, with an empty document. On the right is what you get after you type in a different font name. I switched to a different input box to clarify that this isn't just a temporary effect while you type in something new.
Comment 8 Dieter 2021-04-27 14:52:50 UTC
Thanks for the screenshot; wasn't clear to me, that it is font in CTL field. But I still can't reproduce it. Does it also happen in SafeMode?
Comment 9 Eyal Rozenberg 2021-04-28 13:36:26 UTC
(In reply to Dieter from comment #8)
> Thanks for the screenshot; wasn't clear to me, that it is font in CTL field.

It isn't in the CTL field. The focus just happens to be in the CTL font family field after moving focus from the Western Text Fony Family field.

> Does it also happen in SafeMode?

Yes, it does! :-(
Comment 10 Eyal Rozenberg 2021-04-28 13:50:23 UTC
Created attachment 171478 [details]
Character dialog before and after typing in a new font family name

Re-created the screenshot without the confusing focus on the CTL font field (it's not relevant).
Comment 11 Dieter 2021-05-09 14:58:53 UTC
(In reply to Eyal Rozenberg from comment #10)
> Created attachment 171478 [details]
> Character dialog before and after typing in a new font family name
> 
> Re-created the screenshot without the confusing focus on the CTL font field
> (it's not relevant).

Still not reproducible for me. I ope, somebody else can help.
Comment 12 Buovjaga 2022-04-19 06:43:06 UTC
Bibisected with linux-64-7.0 to
https://git.libreoffice.org/core/commit/bc0e0f633b05c4f91b6695488fc9e5c127507ba5
tdf#131120 use a replacement for GtkComboBox

Adding Cc: to Caolán McNamara

The dialog was redesigned since then, but the issue remains and is only seen with gtk3.

Eyal: you can test the different VCL UI backends by launching LibreOffice from the terminal with
SAL_USE_VCLPLUGIN=gtk3 libreoffice
SAL_USE_VCLPLUGIN=kf5 libreoffice
SAL_USE_VCLPLUGIN=gen libreoffice
Comment 13 Eyal Rozenberg 2022-04-20 11:16:19 UTC
(In reply to Buovjaga from comment #12)

I tried several VCL with build:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: d9b33ed6644203141fdb0776c291425c2bc9f5ac
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US

Results:

VCL    Bug manifests?
----------------------
gtk3   Yes
kf5    Yes
gen    No
qt5    No
Comment 14 Commit Notification 2022-04-25 16:10:19 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#141441 get and set selected entry when "unfrozen"

It will be available in 7.4.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 15 Caolán McNamara 2022-04-25 16:10:51 UTC
fixed in trunk, backport to 7-3 in gerrit
Comment 16 Commit Notification 2022-04-26 07:14:51 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

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

Resolves: tdf#141441 get and set selected entry when "unfrozen"

It will be available in 7.3.4.

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.