View Issue Details

IDProjectCategoryView StatusLast Update
0024750LazarusPatchpublic2017-06-06 10:57
ReporterÉderson CássioAssigned ToZeljan Rikalo 
PrioritynormalSeverityminorReproducibilityalways
Status feedbackResolutionreopened 
PlatformLinuxOSOS Version
Product Version1.0.10Product Build 
Target VersionFixed in Version 
Summary0024750: Accents in GTK2
DescriptionPatch for issues 0024693, 0015688, 0015688, 0022507 etc.
In some situations, accented characters are duplicated when typing: 'áá', 'éé'...
It seems too frequent when the input language is latin-derived: Portuguese, Spanish, etc.
Because not all systems need this correction, I have implemented it via a compilation directive (Mattias Gaertner suggestion). It will be necessary to include a -dGtk2LatinAccents in the compiler parameters.
TagsNo tags attached.
Fixed in Revisionr42102, r42581
LazTarget-
WidgetsetGTK 2
Attached Files
  • gtk2proc.inc.patch (627 bytes)
    Index: gtk2proc.inc
    ===================================================================
    --- gtk2proc.inc	(revision 42096)
    +++ gtk2proc.inc	(working copy)
    @@ -2265,7 +2265,13 @@
     
       gdk_event_key_get_string(AEvent, EventString{%H-});
       //DebugLn(['HandleGTKKeyUpDown TargetWidget=',GetWidgetDebugReport(TargetWidget),' ',DbgStr(EventString),' state=',AEvent^.state,' keyval=',AEvent^.keyval]);
    +  
    +  {$IfDef Gtk2LatinAccents}
    +  gtk_im_context_filter_keypress (im_context, AEvent);
    +  {$Else}
       CheckDeadKey;
    +  {$EndIf}
    +  
       Flags := 0;
       SysKey := False;
       ShiftState := GTKEventStateToShiftState(AEvent^.state);
    
    gtk2proc.inc.patch (627 bytes)

Relationships

related to 0015688 feedbackZeljan Rikalo Gtk2 native controls fails to input some chars (dead keys) in Ubuntu Lucid 
has duplicate 0024693 resolvedJuha Manninen Accents in IDE and my apps 
has duplicate 0022507 resolvedJuha Manninen error writing accented characters 
related to 0024990 resolvedJuha Manninen [regression] Ctrl or Shift key repeats the last entered letter 
related to 0030863 assignedZeljan Rikalo keys typed in the source editor are duplicated 

Activities

Éderson Cássio

2013-07-16 03:42

reporter  

gtk2proc.inc.patch (627 bytes)
Index: gtk2proc.inc
===================================================================
--- gtk2proc.inc	(revision 42096)
+++ gtk2proc.inc	(working copy)
@@ -2265,7 +2265,13 @@
 
   gdk_event_key_get_string(AEvent, EventString{%H-});
   //DebugLn(['HandleGTKKeyUpDown TargetWidget=',GetWidgetDebugReport(TargetWidget),' ',DbgStr(EventString),' state=',AEvent^.state,' keyval=',AEvent^.keyval]);
+  
+  {$IfDef Gtk2LatinAccents}
+  gtk_im_context_filter_keypress (im_context, AEvent);
+  {$Else}
   CheckDeadKey;
+  {$EndIf}
+  
   Flags := 0;
   SysKey := False;
   ShiftState := GTKEventStateToShiftState(AEvent^.state);
gtk2proc.inc.patch (627 bytes)

Juha Manninen

2013-07-16 09:51

developer   ~0068878

Last edited: 2013-07-16 18:08

View 2 revisions

I applied the patch in r42102. Thanks.
Accented chars still work in my environment with TEdit and TMemo. Nothing broke there.
SynEdit dropped on a form did not get accented chars at all. ' + "a" gives just "a". No change there either.
However the source editor in Lazarus behaves differently. Earlier I got accented chars with red color which is also wrong. Now I don't get accent but the color is normal.

I hope the SynEdit / source editor issue will be solved. Maybe it is a separate issue.

Please test everybody.

P.S.
Éderson Cássio, you can attach a patch also to an existing bug report. Now there are many duplicates. No big deal of course ...

Éderson Cássio

2013-07-16 21:54

reporter   ~0068891

Last edited: 2013-07-16 21:55

View 2 revisions

I have the intention to verify SynEdit soon, maybe next week (because this week I'm full of work, which I'm doing in Lazarus :D)

Actually, I'm programming under Windows, where I have no problems with accents. I open the projects under Linux only to compile them.

What must I do to document the new compiler directive, for others who have the same problem?

Juha Manninen

2013-07-17 13:36

developer   ~0068898

> What must I do to document the new compiler directive, for others who have the same problem?

No need to really document it because it is a temporary define for testing purposes.
You can advertise it as you wish, for example by personal email, mailing list and forum.

Juha Manninen

2013-09-04 02:08

developer   ~0069709

Apparently it works as nobody complained. I removed the define Gtk2LatinAccents.

Juha Manninen

2013-09-11 14:56

developer   ~0069924

This created problems after all. See mail thread at Lazarus list:
 IDE - SynEdit not accept accented characters / revision found

I reopen and detach myself from this issue. I don't know how to fix it except for reverting commits.

Zeljan Rikalo

2014-04-12 12:07

developer   ~0074348

anyone can test with current trunk 1.3 ? (>= r44697) ?

Issue History

Date Modified Username Field Change
2013-07-16 03:42 Éderson Cássio New Issue
2013-07-16 03:42 Éderson Cássio File Added: gtk2proc.inc.patch
2013-07-16 08:51 Juha Manninen Relationship added related to 0024693
2013-07-16 08:51 Juha Manninen Relationship added related to 0015688
2013-07-16 08:52 Juha Manninen Relationship added related to 0022507
2013-07-16 09:10 Juha Manninen Relationship replaced has duplicate 0024693
2013-07-16 09:10 Juha Manninen Relationship replaced has duplicate 0022507
2013-07-16 09:36 Juha Manninen Assigned To => Juha Manninen
2013-07-16 09:36 Juha Manninen Status new => assigned
2013-07-16 09:51 Juha Manninen Note Added: 0068878
2013-07-16 09:52 Juha Manninen LazTarget => -
2013-07-16 09:52 Juha Manninen Status assigned => feedback
2013-07-16 18:08 Juha Manninen Note Edited: 0068878 View Revisions
2013-07-16 21:54 Éderson Cássio Note Added: 0068891
2013-07-16 21:54 Éderson Cássio Status feedback => assigned
2013-07-16 21:55 Éderson Cássio Note Edited: 0068891 View Revisions
2013-07-17 13:36 Juha Manninen Note Added: 0068898
2013-09-04 02:08 Juha Manninen Fixed in Revision => r42102, r42581
2013-09-04 02:08 Juha Manninen Note Added: 0069709
2013-09-04 02:08 Juha Manninen Status assigned => resolved
2013-09-04 02:08 Juha Manninen Resolution open => fixed
2013-09-11 14:56 Juha Manninen Assigned To Juha Manninen =>
2013-09-11 14:56 Juha Manninen Note Added: 0069924
2013-09-11 14:56 Juha Manninen Status resolved => assigned
2013-09-11 14:56 Juha Manninen Resolution fixed => reopened
2013-09-11 15:28 Juha Manninen Status assigned => new
2013-09-11 22:33 Martin Friebe Relationship added related to 0024990
2014-04-12 12:07 Zeljan Rikalo Note Added: 0074348
2014-04-12 12:07 Zeljan Rikalo Assigned To => Zeljan Rikalo
2014-04-12 12:07 Zeljan Rikalo Status new => feedback
2017-06-06 10:57 Juha Manninen Relationship added related to 0030863