No windows keyboard accelerators when LCL is compiled with '-O2'
Original Reporter info from Mantis: ChrisF
-
Reporter name:
Original Reporter info from Mantis: ChrisF
- Reporter name:
Description:
When the LCL is compiled with the '-O2' option (optimizations level 2), the standard windows keyboard accelerators for reaching directly controls in a Form (Alt+Letter) are no more working.
Note: this is most probably specific to the Windows versions of Lazarus (and eventually to some Windows OS versions and/or types win32/win64)
Steps to reproduce:
Create and save a new profile to build Lazarus : Tools->Configure "Build Lazarus"...
New profile: MyProfile
Options: -O2 (i.e. optimizations level 2)
ReBuild Lazarus:
"Build" button in the Configure "Build Lazarus" dialog,
or Tools->"Build Lazarus with Profile: MyProfile",
or via the command line: "make clean useride" (if this new created profile has been saved and is your current profile).
Once done, call for instance the Find/Replace dialog (Ctrl+F or Ctrl+R) in the IDE, and try to modify any options of this dialog using directly the keyboard accelerators associated to the controls: for the english version, Alt+E for "From b&eginning", Alt+X for "Regular e&xpressions", Alt+F for "&Find" and so on ...
Apart from the annoying "beep bug" (see bug report http://bugs.freepascal.org/view.php?id=19223), the keyboard accelerators (Alt+Letter) don't work at all (i.e. the corresponding control doesn't receive the focus and/or is not activated).
Now, modify the new created profile:
Profile: MyProfile
Options: -O1 (i.e. optimizations level 1)
and rebuild Lazarus.
Once done, call again the Find/Replace dialog and try the keyboard accelerators. This time, they are working properly (still apart the "beep bug").
Additional information:
Additional notes:
1/ The standard released files are not concerned: IDE=Lazarus.exe and LCL object files. I guess they have not been compiled with the -O2 option, though I've not found any indication about this build: "make all" ?
2/ The released "Optimized IDE" profile (though it's not the by-default profile; "Normal IDE" is) does include this option: "-O2 -g- -Xs". Which means that as soon as you install/uninstall a new package and compile the IDE with the "Optimized IDE" profile ("Normal IDE" giving a very huge Lazarus.exe file), the bug is present.
3/ This concerns directly the LCL, not only the IDE (of course the IDE is using the LCL): because both the IDE and the user's programs are concerned (i.e. bug when compiling IDE+LCL with -O2, and no bug either).
Mantis conversion info:
- Mantis ID: 26562
- OS: Windows
- OS Build: Windows XP SP3
- Platform: win32
- Version: 1.2.4
- Fixed in revision: r47048 (#1ad0f960)