View Issue Details

IDProjectCategoryView StatusLast Update
0015688LazarusWidgetsetpublic2015-04-27 22:02
ReporterFlávio Etrusco (notifications not working)Assigned ToZeljan Rikalo 
PrioritynormalSeveritymajorReproducibilityalways
Status feedbackResolutionopen 
Product Version0.9.28.3 (SVN)Product Build 
Target VersionFixed in Version 
Summary0015688: Gtk2 native controls fails to input some chars (dead keys) in Ubuntu Lucid
DescriptionI cannot enter pure accents - like '`^~ - in Gtk2 ComboBoxes and Memos (like in the Evaluate window). I can enter áãâ. SynEdit works fine for all chars.
I'm using the latest Ubuntu (Lucid) and gtk2 (2.19.4-1ubuntu3), with "ev-dev handled" keyboard.
Other gtk2 applications work as expected.
TagsNo tags attached.
Fixed in Revision
LazTargetpost 1.4
WidgetsetGTK 2
Attached Files

Relationships

has duplicate 0016702 closedJuha Manninen TEdit does not support ^ 
related to 0008855 acknowledged Editor does not support fully international keyboard layout 
related to 0024750 feedbackZeljan Rikalo Accents in GTK2 

Activities

Bart Broersma

2010-02-23 01:28

developer   ~0034688

Works perfectly well for me on Suse 10.0

Flávio Etrusco (notifications not working)

2010-02-23 02:45

developer   ~0034690

Last edited: 2010-02-23 02:45

This is on GNOME, I'm using default gtk input method and either locale en_US.UTF-8 or pt_BR.UTF-8, and either keyboard layouts Brazil-Brazil or US-intl incur in the same problem.

Edit: I'm setting the keyboard with gnome-keyboard-properties, not in xorg.conf.

Bart Broersma

2010-02-23 13:14

developer   ~0034697

Can you set Keyboard method in xorg.conf (I mean does it have any effect, or does GNOME overrule it?)

You might try something like this in xorg.conf:

Section "InputDevice"
  Driver "kbd"
  Identifier "Keyboard[0]"
  Option "Protocol" "Standard"
  Option "XkbLayout" "us"
  Option "XkbModel" "pc104"
  Option "XkbVariant" "intl"
  Option "XkbRules" "xfree86"
EndSection

(This is for US-international layout)

or run
setxkbmap -variant intl
from a console?

Can you test what happens in either of these scenario's?

Flávio Etrusco (notifications not working)

2010-02-24 05:13

developer   ~0034717

Last edited: 2010-02-24 05:26

"setxkbmap -model pc104 -layout us -variant intl" doesn't work either.
BTW Lazarus version is 0.9.29, if you can fix it please.
Thanks.

OT. Dang Mantis. I so would like to receive email notifications :-/

Edit: Oddly enough, some some accents like ´ can be entered by pressing the char twice (instead of char+spacebar). ^ and ~ still fail, though.

theo

2010-02-24 09:47

reporter   ~0034725

I have exactly the same problem here.
openSUSE 11.1 (i586), KDE: 4.1.3, $LANG: de_CH.UTF-8

So this is not Ubuntu or Gnome specific.
theo, what is your gtk2 and xorg-server version? (You compiled Lazarus with gtk, correct?)

theo

2010-02-24 22:03

reporter   ~0034735

GTK2: 2.14.4
xorg-x11: 7.4

Flávio Etrusco (notifications not working)

2010-02-25 05:51

developer   ~0034739

Last edited: 2010-02-25 05:52

Mine is: GTK2 2.19.5
xserver-xorg package is 7.5
X -version returns:
  X.Org X Server 1.7.5
  Release Date: 2010-02-16
What about yours, Bart?

theo

2010-02-25 11:19

reporter   ~0034750

The OnKey.. events of TMemo work correctly.
I put a writeln(Key); in OnKeyDown, OnKeyPress, OnUTF8KeyPress, OnKeyup

Pressing ^:
146
146

Pressing Space:
32
^
^
32

So this is as expected.
But nothing shows in the Memo. I get a beep instead.

Bart Broersma

2010-02-25 16:47

developer   ~0034755

bart@simenon:~/LazarusProjecten/ConsoleProjecten> X -version

X Window System Version 6.8.2
Release Date: 9 February 2005
X Protocol Version 11, Revision 0, Release 6.8.2

bart@simenon:~/LazarusProjecten/ConsoleProjecten> rpm -q gtk2
gtk2-2.8.3-4

Flávio Etrusco (notifications not working)

2010-02-25 21:55

developer   ~0034764

Last edited: 2010-02-27 16:05

Yeah, weird. I'll debug it, since the the UTF8KeyPress is ok. That's what I get:
KeyDown: 16 (shift)
KeyDown: 147
KeyUp: 147
KeyUp: 16
KeyDown: 32
UTF8KeyPress: "^" (the apostrophes are added by my code)
KeyPress: 94 (ascii for ^)
KeyUp: 32

Do you think running it in your setup is of any use, Bart? If so, I can attach the code to save your time.

Edit: fixed nonsense comment about code 147

Bart Broersma

2010-02-26 00:50

developer   ~0034768

Attach a sample program and I'll run it.
Mind you my Lazarus isn't up-to-date ATM (r22593M / fpc 2.2.4)
(Having trouble updating fpc)

2010-02-26 03:35

 

bug_gtk2_deadkey.zip (130,059 bytes)
Of course you'll need to run it in a terminal or enable the "Use launching application" in the "Run Parameters" dialog.

Bart Broersma

2010-02-26 15:01

developer   ~0034801

(Had to fiddle a bit with the program, it would not compile with fpc 2.2.4 due to new resource system)

Pressing ~ (tilde) followed by space:
KeyDown: 16
KeyDown: 192
KeyUp: 192
KeyUp: 16
KeyDown: 32
UTF8KeyPress: "~" (Length=1, Ord[1]=~)
KeyPress: 126
KeyUp: 32

Pressing ^ (caret) followed by space:
KeyDown: 16
KeyDown: 54
KeyUp: 54
KeyUp: 16
KeyDown: 32
UTF8KeyPress: "^" (Length=1, Ord[1]=^)
KeyPress: 94
KeyUp: 32

Pressing ' (single quote) followed by space:
KeyDown: 222
KeyUp: 222
KeyDown: 32
UTF8KeyPress: "'" (Length=1, Ord[1]=')
KeyPress: 39
KeyUp: 32

All characters show up (after pressing space) in Memo1 as expected.

I seem to get another KeyDown for ^ (me: 54, Flavio: 147) (may be due to other keyboard layout??)

Flávio Etrusco (notifications not working)

2010-02-26 15:54

developer   ~0034804

Last edited: 2010-02-26 16:01

> I seem to get another KeyDown for ^ (me: 54, Flavio: 147)
> (may be due to other keyboard layout??)
Yes, I guess so. Theo's are different from ours too.

Apart from the bug, am I the only one that find it odd that UTF8KeyPress pass an ASCII/ANSI string instead of UTF-8? O_o (Man, debugging strings will get messy if gdb doesn't get support to call pascal functions...)

theo

2010-02-26 15:58

reporter   ~0034805

Yes, an I don't need shift to reach '^'.

But what did we learn now?

Is the problem in the keyboard layout or GTK version?

Flávio Etrusco (notifications not working)

2010-02-26 16:19

developer   ~0034806

Last edited: 2010-02-26 16:25

I'd speculate it's GTK, but it's just it: speculation. I couldn't get to debug the FCL/RTL and GTK code yet, and AFAICS the data we collected doesn't prove anything.
(And I learned I forgot to add a "Ord" call in the UTF8KeyPress debug :-/ )
Maybe GTK now expects a UTF-8 value (or some other value) somewhere where the LCL pass the ASCII value...

(OT: are both of you receiving email notifications upon changes?)

theo

2010-02-26 16:30

reporter   ~0034808

> Maybe GTK now expects a UTF-8 value (or some other value) somewhere where the LCL pass the ASCII value...

^ is in the ASCII range, so It's the same value for UTF-8: $5E

OT: are both of you receiving email notifications upon changes?
No

Trying to fix something that works for some is probably not the best idea until we know what makes the difference.

Flávio Etrusco (notifications not working)

2010-02-26 16:35

developer   ~0034809

Last edited: 2010-02-26 16:38

> ^ is in the ASCII range, so It's the same value for UTF-8: $5E

Yeah, but maybe it says something that the first KeyDown triggers the UTF-8 value for ^...

> Trying to fix something that works for some is probably not
> the best idea until we know what makes the difference.

Of course. But I'm thinking of something that worked because of some earlier gtk quirky that got removed. And anyway eventually most users will upgrade to newer versions of gtk...

Flávio Etrusco (notifications not working)

2010-02-27 15:51

developer   ~0034833

Last edited: 2010-02-27 20:02

Edit: Scrap everything bellow. This works. It must have been some other issue at the time...

Seeing a post in the mailing list I "remembered" another thing: Ctrl+C, Ctrl+V, etc aren't working, too.

theo

2010-02-27 16:08

reporter   ~0034834

Ctrl+C, Ctrl+V work here.

I had a look at gtkproc.inc yesterday.
I suspect the problem to be somewhere in the area of im_context / gtk_im_context_filter_keypress but I'm lost.
This is one of the more complicated parts of the LCL.
I give up.
Commenting out CheckDeadKey in gtkproc.inc fixes the issue O_o
Actually, removing gtk_im_context_filter_keypress is what does the job. What's this method supposed to do?
BTW handling of ResetDefaultIMContext is incorrect since it doesn't reset the "buffer" if im_context_widget is nil, which allow you start a composition, move away from the control and continue the composite key (e.g. press ^, move focus away then back, press space, it works!).

theo

2010-03-01 10:19

reporter   ~0034872

> Commenting out CheckDeadKey in gtkproc.inc fixes the issue

I've tried that, the char appears in the control but the problem is: You don't get correct OnKey events at the same time.

Flávio Etrusco (notifications not working)

2010-03-01 20:01

developer   ~0034884

Last edited: 2010-03-01 20:06

theo: Yeah, and menu handling and other stuff go bogus. Sorry, I didn't meant it was a real fix, it was just comment...

theo

2010-03-01 22:56

reporter   ~0034887

This simply disables the LCL to control what's happening.
Still I have a certain feeling ;-) that this the key point.
Maybe it's the sequence in which things happen that has changed.
Or it's necessary to sort of "tell" the control again to enter a character after the LCL has done its work.
But I really don't know. Who has written this part of the LCL?

Zeljan Rikalo

2012-02-04 13:27

developer   ~0056391

Not blocker so postponed.

Zeljan Rikalo

2014-04-12 12:06

developer   ~0074347

@Flavio if you're using scim-bridge then you should test with laz 1.3 r44697.
if not what's im context method in your case ?

Zeljan Rikalo

2014-09-11 08:10

developer   ~0077077

LazTarget moved to post 1.4 since there's no feedback from reporter.

Issue History

Date Modified Username Field Change
2010-02-05 17:14 Flávio Etrusco (notifications not working) New Issue
2010-02-05 17:14 Flávio Etrusco (notifications not working) Widgetset => GTK 2
2010-02-23 01:28 Bart Broersma Note Added: 0034688
2010-02-23 01:32 Bart Broersma Relationship added related to 0008855
2010-02-23 02:45 Flávio Etrusco (notifications not working) Note Added: 0034690
2010-02-23 02:45 Flávio Etrusco (notifications not working) Note Edited: 0034690
2010-02-23 13:14 Bart Broersma Note Added: 0034697
2010-02-24 05:13 Flávio Etrusco (notifications not working) Note Added: 0034717
2010-02-24 05:26 Flávio Etrusco (notifications not working) Note Edited: 0034717
2010-02-24 09:47 theo Note Added: 0034725
2010-02-24 21:51 Flávio Etrusco (notifications not working) Note Added: 0034734
2010-02-24 22:03 theo Note Added: 0034735
2010-02-25 05:51 Flávio Etrusco (notifications not working) Note Added: 0034739
2010-02-25 05:52 Flávio Etrusco (notifications not working) Note Edited: 0034739
2010-02-25 11:19 theo Note Added: 0034750
2010-02-25 16:47 Bart Broersma Note Added: 0034755
2010-02-25 21:55 Flávio Etrusco (notifications not working) Note Added: 0034764
2010-02-26 00:50 Bart Broersma Note Added: 0034768
2010-02-26 03:35 Flávio Etrusco (notifications not working) File Added: bug_gtk2_deadkey.zip
2010-02-26 03:44 Flávio Etrusco (notifications not working) Note Added: 0034774
2010-02-26 15:01 Bart Broersma Note Added: 0034801
2010-02-26 15:54 Flávio Etrusco (notifications not working) Note Added: 0034804
2010-02-26 15:58 theo Note Added: 0034805
2010-02-26 16:01 Flávio Etrusco (notifications not working) Note Edited: 0034804
2010-02-26 16:19 Flávio Etrusco (notifications not working) Note Added: 0034806
2010-02-26 16:25 Flávio Etrusco (notifications not working) Note Edited: 0034806
2010-02-26 16:30 theo Note Added: 0034808
2010-02-26 16:35 Flávio Etrusco (notifications not working) Note Added: 0034809
2010-02-26 16:38 Flávio Etrusco (notifications not working) Note Edited: 0034809
2010-02-27 15:51 Flávio Etrusco (notifications not working) Note Added: 0034833
2010-02-27 16:03 Flávio Etrusco (notifications not working) Note Edited: 0034764
2010-02-27 16:05 Flávio Etrusco (notifications not working) Note Edited: 0034764
2010-02-27 16:08 theo Note Added: 0034834
2010-02-27 20:02 Flávio Etrusco (notifications not working) Note Edited: 0034833
2010-03-01 09:21 Flávio Etrusco (notifications not working) Note Added: 0034868
2010-03-01 10:19 theo Note Added: 0034872
2010-03-01 20:01 Flávio Etrusco (notifications not working) Note Added: 0034884
2010-03-01 20:06 Flávio Etrusco (notifications not working) Note Edited: 0034884
2010-03-01 22:56 theo Note Added: 0034887
2010-03-12 15:47 Vincent Snijders LazTarget => 1.0
2010-03-12 15:47 Vincent Snijders Status new => acknowledged
2010-03-12 15:47 Vincent Snijders Target Version => 1.0.0
2010-05-08 05:32 Flávio Etrusco (notifications not working) Summary Gtk2 native controls fails to input some chars in Ubuntu Lucid => Gtk2 native controls fails to input some chars (dead chars) in Ubuntu Lucid
2010-05-18 21:49 Flávio Etrusco (notifications not working) Summary Gtk2 native controls fails to input some chars (dead chars) in Ubuntu Lucid => Gtk2 native controls fails to input some chars (dead keys) in Ubuntu Lucid
2010-06-13 11:16 Bart Broersma Relationship added has duplicate 0016702
2012-02-04 13:27 Zeljan Rikalo LazTarget 1.0 => 1.2
2012-02-04 13:27 Zeljan Rikalo Note Added: 0056391
2012-03-13 07:50 Vincent Snijders Target Version 1.0.0 => 1.2.0
2013-07-16 08:51 Juha Manninen Relationship added related to 0024750
2014-01-20 13:36 Martin Friebe Target Version 1.2.0 => 1.4
2014-01-20 13:37 Martin Friebe LazTarget 1.2 => 1.4
2014-04-12 12:06 Zeljan Rikalo Note Added: 0074347
2014-04-12 12:06 Zeljan Rikalo Assigned To => Zeljan Rikalo
2014-04-12 12:06 Zeljan Rikalo Status acknowledged => feedback
2014-09-11 08:10 Zeljan Rikalo LazTarget 1.4 => post 1.4
2014-09-11 08:10 Zeljan Rikalo Note Added: 0077077
2015-04-27 22:02 Juha Manninen Target Version 1.4 =>