Bug 143540 - EDITING: Keypad decimal character not changed to comma on KDE Plasma with Wayland
Summary: EDITING: Keypad decimal character not changed to comma on KDE Plasma with Way...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL: https://bugs.kde.org/show_bug.cgi?id=...
Whiteboard:
Keywords:
: 144885 160124 (view as bug list)
Depends on:
Blocks: Wayland KDE, KF5 User-Locale Decimal-Separator-Key
  Show dependency treegraph
 
Reported: 2021-07-26 07:13 UTC by Mattia
Modified: 2024-03-23 21:29 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
cell formatting (59.67 KB, image/png)
2021-07-26 09:48 UTC, Mattia
Details
configuration (9.73 KB, image/jpeg)
2023-04-10 15:57 UTC, md
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mattia 2021-07-26 07:13:23 UTC
Version: 7.1.5.2
Build ID: 10(Build:2)
CPU threads: 4; OS: Linux 5.13; UI render: default; VCL: kf5
Locale: it-IT (it_IT.UTF-8); UI: it-IT
Calc: threaded

I've set KDE Plasma regional settings and keyboard to Italian language.
In Libreoffice options I've set Italian language.
Cell format is set to Italian language.

Still, when I enter a decimal number using the keypad the decimal separator is entered as a . (dot) instead of a , (comma). I've also tried with "same as local" setting checked and not checked, the result doesn't change.

The SUM function doesn't like decimals with dot, so I think Calc is correctly using Italian as language of the spreadsheet and comma as decimal separator.
Comment 1 Timur 2021-07-26 08:59:16 UTC
You should start by checking existing bugs, like bug 46448, bug 54042, bug 42533.
Comment 2 Mattia 2021-07-26 09:48:34 UTC
Created attachment 173846 [details]
cell formatting

Thanks Timur, I've already checked some existing bugs, but they didn't provide any solution to my reported problem.

For example in bug 42533 they said:
"This option defines only what character is inserted when you press the decimal separator key on the numeric keypad. It does not define the decimal separator for your locale."
However, with Same as locale setting either selected or de-selected, when I use the keypad dot the decimal separator is inserted as dot, never as comma.

The strange is when I insert a number with a decimal using dot, LO says the cell is formatted as number, but it then manage it as text (see attached screenshot) i.e. SUM and other functions don't work.
Comment 3 Mattia 2021-07-26 10:00:24 UTC
Basically, what I'm reporting is that the keypad dot is always inserted as dot even when in LO settings it is selected (forced above system locale) to use a comma as decimal separator.
The keypad dot behaves as the standard keyboard dot, but it should not.
Comment 4 [REDACTED] 2021-07-26 15:57:13 UTC
No repro

Version: 7.1.5.2 / LibreOffice Community
Build ID: 85f04e9f809797b8199d13c421bd8a2b025d52b5
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: kf5
Locale: it-IT (en_US.UTF-8); UI: en-US
Calc: threaded

i.e.: Changing "Tools -> Options -> Language Settings -> Languages -> Locale Setting" to "Italian (Italy)" changes the numpad decimal spearator to "," (comma) while changing it to "English (USA)" changes the numpad decimal spearator to "." (dot)
Comment 5 Aron Budea 2022-10-16 03:06:55 UTC
Please update LO to a more recent version, and test again.
Comment 6 Mattia 2022-10-16 08:14:51 UTC
Thanks, I tried with 7.3.6.2 and the results are the same.
However, I've now forced LO regional settings to English(USA), as it seems there's no other way to make things works as expected, so feel free to close this bug report, if there's little interest in fixing it.
Comment 7 QA Administrators 2022-10-17 03:30:35 UTC Comment hidden (obsolete)
Comment 8 Aron Budea 2022-10-24 05:30:10 UTC
(In reply to Mattia from comment #6)
> if there's little interest in fixing it.
So far the problem is that others seem to have a hard time reproducing this issue. Until then the chance of getting this fixed is rather slim.
Comment 9 md 2023-04-10 15:57:44 UTC
Created attachment 186566 [details]
configuration
Comment 10 md 2023-04-10 16:00:37 UTC
I've got the same issue, 

I join my configuration in previous screenshot.
If I press the dot on my numpad I got a dot even if the decimal separator key config is checked

If I uncheck I got a dot , If I change for English I got a dot

I'm not able to have comma by pressing the "dot" of my numeric pad as opposed of the help : 
> If this checkbox is activated, the character shown after "Same as locale setting" is inserted when you press the key on the number pad
Comment 11 md 2023-04-10 16:01:45 UTC
I'm using XFCE and 

LO:
Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 8; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Ubuntu package version: 4:7.5.2~rc2-0ubuntu0.22.04.1~lo1
Calc: threaded
Comment 12 Stéphane Guillou (stragu) 2023-04-11 12:37:50 UTC
I'm marking as New because md confirmed it in comment 11, but I haven't been able to reproduce on Ubuntu 20.04 with GNOME 3.36.8, a French layout keyboard and:

Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 53bb9681a964705cf672590721dbc85eb4d0c3a2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fr-FR (en_AU.UTF-8); UI: en-US
Calc: threaded

Calc does insert commas when using the decimal dot key on the numpad, as expected.
Comment 13 Stéphane Guillou (stragu) 2023-04-11 12:40:11 UTC
*** Bug 144885 has been marked as a duplicate of this bug. ***
Comment 14 Mattia 2023-04-11 16:45:09 UTC
(In reply to Stéphane Guillou (stragu) from comment #12)
> I'm marking as New because md confirmed it in comment 11, but I haven't been
> able to reproduce on Ubuntu 20.04 with GNOME 3.36.8, a French layout
> keyboard and:
> 
> Version: 7.5.2.2 (X86_64) / LibreOffice Community
> Build ID: 53bb9681a964705cf672590721dbc85eb4d0c3a2
> CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
> Locale: fr-FR (en_AU.UTF-8); UI: en-US
> Calc: threaded
> 
> Calc does insert commas when using the decimal dot key on the numpad, as
> expected.

I think the problem is that you're using:
Locale: fr-FR (en_AU.UTF-8)
(note that "en_AU.UTF-8")

The same was in comment #4:
Locale: it-IT (en_US.UTF-8)

It was reproducible in my case with "Locale: it-IT (it_IT.UTF-8)" and by md with "Locale: fr-FR (fr_FR.UTF-8)"
Comment 15 Stéphane Guillou (stragu) 2023-04-15 12:49:16 UTC
(In reply to Mattia from comment #14)

> I think the problem is that you're using:
> Locale: fr-FR (en_AU.UTF-8)
> (note that "en_AU.UTF-8")
> 
> The same was in comment #4:
> Locale: it-IT (en_US.UTF-8)
> 
> It was reproducible in my case with "Locale: it-IT (it_IT.UTF-8)" and by md
> with "Locale: fr-FR (fr_FR.UTF-8)"

I still can't reproduce with:

Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 53bb9681a964705cf672590721dbc85eb4d0c3a2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 16 Stéphane Guillou (stragu) 2023-05-23 13:26:38 UTC
A 7.1 GTK-specific regression was fixed recently, see bug 154623, so I'd recommend users who reproduced the issue to test with version 7.5.3 or above and please report back.
The issue was related to the formula bar, which might have muddied the waters here.
Comment 17 Mattia 2023-05-24 16:00:20 UTC
Tested with
Version: 7.5.3.2 (X86_64)
Build ID: 50(Build:2)
CPU threads: 16; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+wayland)
Locale: it-IT (it_IT.UTF-8); UI: it-IT
Calc: threaded

behavior is the same.

I think it can consistently reproduced with the following steps:
- download Fedora 38 KDE Live image
- start the live system
- open KDE Plasma settings and in Regional Settings change language to "Italiano"
- log out
- in the login screen, change the Keyboard layout to "Italian", then log in (blank password)
- start libreoffice Calc

You will now see that:
- in "About", Calc is set to "Locale: it-IT (it_IT.UTF-8)"
- in "tools -> options" the Locale is set to Italian and the decimal separator is "Same as locale (,)"

Yet, typing a decimal number using the keypad dot is recognized as text, not as a number.
Comment 18 Sébastien P. 2023-06-06 19:11:53 UTC
Could #154623 be a duplicate?
Comment 19 Stéphane Guillou (stragu) 2023-06-07 09:13:52 UTC
(In reply to Sébastien P. from comment #18)
> Could #154623 be a duplicate?

Bug 154623 was a GTK-specific regression affecting the formula bar, and I have verified it as fixed by Caolán. Let's keep these two separate.

Mattia, md and Sébastien, can you confirm that this does not affect only the formula bar, but also uses the wrong decimal separator when editing a cell in place?
Please test in LO 7.5.3.

Would be also good to see if the issue predates 7.1.
Comment 20 Mattia 2023-06-07 16:29:53 UTC
(In reply to Stéphane Guillou (stragu) from comment #19)
> (In reply to Sébastien P. from comment #18)
> > Could #154623 be a duplicate?
> 
> Bug 154623 was a GTK-specific regression affecting the formula bar, and I
> have verified it as fixed by Caolán. Let's keep these two separate.
> 
> Mattia, md and Sébastien, can you confirm that this does not affect only the
> formula bar, but also uses the wrong decimal separator when editing a cell
> in place?
> Please test in LO 7.5.3.
> 
> Would be also good to see if the issue predates 7.1.

Yes, I always tested editing a cell in place, but I've now verified that the same happens entering text in the formula bar.

Yet, the analysis made by Caolán in Bug 154623 made me think about what key value LO sees when I press the decimal on keypad.
I don't know how to verify that in LO, but I've found a small python script which prints key values pressed within a gtk3 window: https://riptutorial.com/gtk3/example/16426/simple-binding-to-a-widget-s-key-press-event
Running the python script and pressing the decimal keypad I get:
$ python keyboard.py 
Key press on widget:  <__main__.MyWindow object at 0x7fa495ea5140 (__main__+MyWindow at 0x55bf5ae3c6b0)>
          Modifiers:  <flags GDK_MOD2_MASK of type Gdk.ModifierType>
      Key val, name:  65454 KP_Decimal

Is it correct that it returns "KP_Decimal" instead of "GDK_KEY_KP_Decimal"? Is there a way to display the gtk key value inside Calc to be sure that it receives the correct value?
Comment 21 Sébastien P. 2023-06-08 20:08:42 UTC
(In reply to Stéphane Guillou (stragu) from comment #19)
> Mattia, md and Sébastien, can you confirm that this does not affect only the
> formula bar, but also uses the wrong decimal separator when editing a cell
> in place?
> Please test in LO 7.5.3.

I have got the wrong decimal separator in formula and when editing a cell.

> Would be also good to see if the issue predates 7.1.

I follow stable amd64 version of Gentoo (https://gitweb.gentoo.org/repo/gentoo.git/log/app-office/libreoffice).
On my side, this bug started last month (with 7.4.6.2). I noticed #154623, so I have waited one month before take a closer look a few days ago.
7.4.4.2 (stable in January) was working until April for me.

Which leads me thought why does it change between 7.4.4.2 and 7.4.6.2. It may be something upgrade outside that cause that.
I will try to reinstall old 7.4.4.2 to check if I got the same issue now.
Comment 22 Sébastien P. 2023-06-10 20:06:25 UTC
I have just reinstall 7.4.4.2 and got the same bug. I will try to reinstall also libreoffice-i10n (since Gentoo splits in two packages and the bug is related to language, it may be revelant).

Version: 7.4.4.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 2; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Gentoo official package
Calc: threaded

If I have the same bug after reinstall all old package, it should be the upgrade of something outside of libreoffice that cause the issue…
Comment 23 Stéphane Guillou (stragu) 2023-06-13 21:11:36 UTC
Thank you both.

(In reply to Mattia from comment #20)

> (In reply to Stéphane Guillou (stragu) from comment #19)
>       Key val, name:  65454 KP_Decimal

I've tested the same script and get the same key val when using "English (Australia)" for Ubuntu's Regional Formats. However, if I change the Regional Format to "français (France)", the same key sends the key val "65452 KP_Separator".


More questions:
- can you please check that you get the right character in other GTK apps, to make sure that it is indeed a LibreOffice issue?
- if it is only in LibreOffice, is it only for Calc or also in e.g. Writer?
Comment 24 Sébastien P. 2023-06-14 21:44:58 UTC
On my side:
Key press on widget:  <__main__.MyWindow object at 0x7fca59134140 (__main__+MyWindow at 0x55ebd073e2f0)>
          Modifiers:  <flags GDK_MOD2_MASK of type Gdk.ModifierType>
      Key val, name:  46 period

Key press on widget:  <__main__.MyWindow object at 0x7fca59134140 (__main__+MyWindow at 0x55ebd073e2f0)>
          Modifiers:  <flags GDK_MOD2_MASK of type Gdk.ModifierType>
      Key val, name:  65506 Shift_R
Key press on widget:  <__main__.MyWindow object at 0x7fca59134140 (__main__+MyWindow at 0x55ebd073e2f0)>
          Modifiers:  <flags GDK_SHIFT_MASK | GDK_MOD2_MASK of type Gdk.ModifierType>
      Key val, name:  46 period

* Both « . » (digit side and letters side) gave me the same key.


* Writer and other applications always give me « . » (before and currently). No change.

I thought about something: I use a special layout. It may be linked. Here are my X11 options:
        Option "XkbLayout" "fr"
        Option "XkbVariant" "oss"
        Option "XkbOptions" "compose:rwin,compose:lwin"
(the keyboard is physically usual)

Sorry, I am going on holiday. I will not be able to give more information until my return in 4 weeks.
Comment 25 Mattia 2023-06-17 08:44:20 UTC
So, in my case it seems that this is a problem related to KDE Plasma running under Wayland, not LO specific.

I have created a brand new test user and logged in with that credentials, using the same regional settings (Italian) than my real user. Running a Plasma DE under X11 the keypad dot is correctly inserted as decimal separator (",") in Calc, while running the same plasma DE under Wayland the keypad dot is inserted as dot and cell content is treated as text.

This behavior seems consistent with what I get running, for example, Calligra, so it's not LO specific.
Comment 26 Stéphane Guillou (stragu) 2023-06-19 17:10:17 UTC
Thank you both.
Sébastien, are you using Wayland too? Are you able to test X11 vs Wayland? (we can wait :) )
Comment 27 Sébastien P. 2023-07-15 15:04:48 UTC
Hi,

I use Wayland too (since it is the default in Plasma or at least recommanded).
Currently, I have a lot of updates to do on this computer. I will take a look if I can test a X11 session.
Comment 28 Tom 2023-07-27 11:56:47 UTC
same problem here using Wayland

LibreOffice 7.5.4.4
Language settings:
UI: English (UK)
Locale setting: Dutch (Belgium)
Default currency: Default - EUR
Decimal separator key: [x] Same as locale setting (,)

The '.' on the numeric keypad is inserting a '.' and my decimal numbers are not recognised!
Comment 29 Sébastien P. 2023-07-29 16:14:09 UTC
On my side, tests on Plasma X11/Wayland have the same result: dot instead of comma with fr-FR settings.
Contrary to Mattia, I used my current user (not a new one).
Comment 30 Mattia 2023-09-29 11:58:21 UTC
This turned out to be a bug of KDE Plasma with Wayland.
A possible (hopefully temporary) workaround is to start libreoffice with `env WAYLAND_DISPLAY= libreoffice`, which will force the app to run under xwayland.

See https://bugs.kde.org/show_bug.cgi?id=449706#c3
Comment 31 Stéphane Guillou (stragu) 2023-09-29 12:51:45 UTC
OK, Sébastien, Mattia and Tom all use Wayland, so let's say this is "not our bug". I've linked the report in "URL".
Tom and Sébastien, please check that the workaround does work to confirm.
Thanks Mattia and everyone else!
Comment 32 Sébastien P. 2023-10-15 14:07:56 UTC
No change for me.
As state in #c22 I had the same bug with old LO version. Same with/without Wayland (#29).

I also tried today to create a new user: same bug with/without Wayland.
Comment 33 Sébastien P. 2023-10-15 14:39:02 UTC
As state in #24, I use a variant layout.
With no variant or “obsolete variant”, the workaround is working. So, it can NOTOURBUG for me too.

(add a comment in upstream bug: https://bugs.kde.org/show_bug.cgi?id=449706#c4)
Comment 34 Stéphane Guillou (stragu) 2024-03-23 21:27:25 UTC
*** Bug 160124 has been marked as a duplicate of this bug. ***