View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015688LazarusWidgetsetpublic2010-02-05 17:142014-04-12 12:06
ReporterFlávio Etrusco (mantis doesn't notify me) 
Assigned ToZeljan Rikalo 
PrioritynormalSeveritymajorReproducibilityalways
StatusfeedbackResolutionopen 
PlatformOSOS Version
Product Version0.9.28.3 (SVN)Product Build 
Target Version1.4Fixed 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
LazTarget1.4
WidgetsetGTK 2
Attached Fileszip file icon bug_gtk2_deadkey.zip [^] (130,059 bytes) 2010-02-26 03:35

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

-  Notes
(0034688)
Bart Broersma (developer)
2010-02-23 01:28

Works perfectly well for me on Suse 10.0
(0034690)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-02-23 02:45
edited on: 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.

(0034697)
Bart Broersma (developer)
2010-02-23 13:14

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?
(0034717)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-02-24 05:13
edited on: 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.

(0034725)
theo (reporter)
2010-02-24 09:47

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.
(0034734)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-02-24 21:51

theo, what is your gtk2 and xorg-server version? (You compiled Lazarus with gtk, correct?)
(0034735)
theo (reporter)
2010-02-24 22:03

GTK2: 2.14.4
xorg-x11: 7.4
(0034739)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-02-25 05:51
edited on: 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?

(0034750)
theo (reporter)
2010-02-25 11:19

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.
(0034755)
Bart Broersma (developer)
2010-02-25 16:47

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
(0034764)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-02-25 21:55
edited on: 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

(0034768)
Bart Broersma (developer)
2010-02-26 00:50

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)
(0034774)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-02-26 03:44

Of course you'll need to run it in a terminal or enable the "Use launching application" in the "Run Parameters" dialog.
(0034801)
Bart Broersma (developer)
2010-02-26 15:01

(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??)
(0034804)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-02-26 15:54
edited on: 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...)

(0034805)
theo (reporter)
2010-02-26 15:58

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?
(0034806)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-02-26 16:19
edited on: 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?)

(0034808)
theo (reporter)
2010-02-26 16:30

> 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.
(0034809)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-02-26 16:35
edited on: 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...

(0034833)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-02-27 15:51
edited on: 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.

(0034834)
theo (reporter)
2010-02-27 16:08

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.
(0034868)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-03-01 09:21

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!).
(0034872)
theo (reporter)
2010-03-01 10:19

> 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.
(0034884)
Flávio Etrusco (mantis doesn't notify me) (developer)
2010-03-01 20:01
edited on: 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...

(0034887)
theo (reporter)
2010-03-01 22:56

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?
(0056391)
Zeljan Rikalo (developer)
2012-02-04 13:27

Not blocker so postponed.
(0074347)
Zeljan Rikalo (developer)
2014-04-12 12:06

@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 ?

- Issue History
Date Modified Username Field Change
2010-02-05 17:14 Flávio Etrusco (mantis doesn't notify me) New Issue
2010-02-05 17:14 Flávio Etrusco (mantis doesn't notify me) 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 (mantis doesn't notify me) Note Added: 0034690
2010-02-23 02:45 Flávio Etrusco (mantis doesn't notify me) Note Edited: 0034690
2010-02-23 13:14 Bart Broersma Note Added: 0034697
2010-02-24 05:13 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034717
2010-02-24 05:26 Flávio Etrusco (mantis doesn't notify me) Note Edited: 0034717
2010-02-24 09:47 theo Note Added: 0034725
2010-02-24 21:51 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034734
2010-02-24 22:03 theo Note Added: 0034735
2010-02-25 05:51 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034739
2010-02-25 05:52 Flávio Etrusco (mantis doesn't notify me) 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 (mantis doesn't notify me) Note Added: 0034764
2010-02-26 00:50 Bart Broersma Note Added: 0034768
2010-02-26 03:35 Flávio Etrusco (mantis doesn't notify me) File Added: bug_gtk2_deadkey.zip
2010-02-26 03:44 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034774
2010-02-26 15:01 Bart Broersma Note Added: 0034801
2010-02-26 15:54 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034804
2010-02-26 15:58 theo Note Added: 0034805
2010-02-26 16:01 Flávio Etrusco (mantis doesn't notify me) Note Edited: 0034804
2010-02-26 16:19 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034806
2010-02-26 16:21 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034807
2010-02-26 16:25 Flávio Etrusco (mantis doesn't notify me) Note Edited: 0034806
2010-02-26 16:26 Flávio Etrusco (mantis doesn't notify me) Note Deleted: 0034807
2010-02-26 16:30 theo Note Added: 0034808
2010-02-26 16:35 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034809
2010-02-26 16:38 Flávio Etrusco (mantis doesn't notify me) Note Edited: 0034809
2010-02-27 15:51 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034833
2010-02-27 16:03 Flávio Etrusco (mantis doesn't notify me) Note Edited: 0034764
2010-02-27 16:05 Flávio Etrusco (mantis doesn't notify me) Note Edited: 0034764
2010-02-27 16:08 theo Note Added: 0034834
2010-02-27 20:02 Flávio Etrusco (mantis doesn't notify me) Note Edited: 0034833
2010-03-01 09:21 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034868
2010-03-01 10:19 theo Note Added: 0034872
2010-03-01 20:01 Flávio Etrusco (mantis doesn't notify me) Note Added: 0034884
2010-03-01 20:06 Flávio Etrusco (mantis doesn't notify me) 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 (mantis doesn't notify me) 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 (mantis doesn't notify me) 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



MantisBT 1.2.12[^]
Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker