Author Topic: Keybinder v2 notes/problems  (Read 58550 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Keybinder v2 notes/problems
« on: June 27, 2019, 07:23:34 pm »
I've updated my main install of the codeblocks to the latest rev and the keybinder seems to be broken for me.
Here is the list of things I've spotted as problems:

1. Memory leak from "m_pAccelEntries = new wxAcceleratorEntry[m_AccelCount];" use unique_ptr?
2. ctrl-shift-. and ctrl-shift-t doesn't work as accelerators
3. The new keybinder failed to parse the old config and lost all my bindings
4. The old menu name is not visible on windows7 with wx-master + 4k 27inch display in the settings on windows (this is with the latest night build)
5. I have ctrl-f4 instead of ctrl-w for file->close file?
6. The json file is not sorted, so it is hard to compare with another version. It would be really good if this is sorted
7. The json file contains all the keybindings. I think it would be better if it stores only the user specified bindings and leave everything else as default.
8. Can we really make a introspecting keybinder work reliably? Wouldn't it be better if we specify commands using code? VStudio has such an approach. And this would make it possible to have the sublime/vscode command windows.

I'm on gentoo linux, wx3.0.4+patch and wx-master+asan. Both wx versions behave the same sort of.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2743
Re: Keybinder v2 notes/problems
« Reply #1 on: June 28, 2019, 07:22:10 pm »
I've updated my main install of the codeblocks to the latest rev and the keybinder seems to be broken for me.
Here is the list of things I've spotted as problems:

1. Memory leak from "m_pAccelEntries = new wxAcceleratorEntry[m_AccelCount];" use unique_ptr?
At the point it needs to be deleted, the whole address space is about to be destroyed. But since it seems to offend, I'll add a delete.

2. ctrl-shift-. and ctrl-shift-t doesn't work as accelerators
I'm using both shortcuts every day. Please describe your environment and how you're setting them. Further data would help me recreate the problem.
Would you attach the cbKeybinder.ini file that Keybinder tried to convert.
 
3. The new keybinder failed to parse the old config and lost all my bindings
Would you attach your old cbKeybinder.ini file so I can try and duplicate the problem. Windows or Linux? This happens on Linux for the nightly build (June 10 and prior). But I fixed this in head.

4. The old menu name is not visible on windows7 with wx-master + 4k 27inch display in the settings on windows (this is with the latest night build)
I'll try this on a VMWare Windows 7, but I don't have access to such a nice monitor. What do you mean by "wx-master" on "lastest night build" I thought the nightly builds were using 3.1 on windows. And I've I made major fixes since the latest nightly build (june 10).

5. I have ctrl-f4 instead of ctrl-w for file->close file?
Both probably work. Keybinder now preserves the global accelerators set in main.cpp . Somehow the global shortcut got set as the first accelerator. Please attach your cbKeybinder.ini file so I can try to recreate the problem.
 
6. The json file is not sorted, so it is hard to compare with another version. It would be really good if this is sorted
I agree. I'll put it on the todo list.

7. The json file contains all the keybindings. I think it would be better if it stores only the user specified bindings and leave everything else as default.
I'll put this on the todo list to see what happens.

8. Can we really make a introspecting keybinder work reliably? Wouldn't it be better if we specify commands using code? VStudio has such an approach. And this would make it possible to have the sublime/vscode command windows.
I don't know yet what any of this means. I'll do some googling.
 
I'm on gentoo linux, wx3.0.4+patch and wx-master+asan. Both wx versions behave the same sort of.
I'll try to create a VMWare gentoo. But it looks really complicated. It will take some time. I can't find an ISO image like Ubuntu or Mint that VMware Player can just load and run without all that configuration voodoo.
« Last Edit: June 28, 2019, 07:37:58 pm by Pecan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Keybinder v2 notes/problems
« Reply #2 on: June 29, 2019, 10:04:44 am »
1. The memory leak makes using asan harder. I can learn to ignore some leaks, but it will be best if there are as few known leaks as possible. This would make it easy for me to spot new leaks and problem.
2. ctrl-shift-. and ctrl-shift-t doesn't work on a fresh config. So I do
Code
rm ~/.config/codeblocks/debug* -v
and then start codeblocks from codeblocks. For this test I use wx-master (wxwidgets built from recent master and also I'm using asan for everything, but I doubt this last fact matters). But I see a single cbKeyBinder10.ini. Does this mean that it is common for all personalities?

3. See the attached cbKeyBinder10.ini; Linux rev 11750. wx3.0.4.
5. I've found this problem because ctrl-w didn't work.
8. This means that all commands are generated with code, so there would be explicit calls like commandManager.AddCommand(...). Current code relies on properly inspecting (introspecting) the contents of menus to find all the commands. This is less work in the beginning, but it seems unreliable to me.

It will be cool if someday we get something like this https://code.visualstudio.com/assets/docs/getstarted/tips-and-tricks/OpenCommandPalatte.gif (it can also be done with introspection the menus).
It makes it really easy to discover/use obscure features.

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Keybinder v2 notes/problems
« Reply #3 on: June 29, 2019, 04:39:57 pm »
Also:
9. alt-pgup/alt-pgdown doesn't work for me. They should be set to prev/next bookmark, but they don't work. :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2743
Re: Keybinder v2 notes/problems
« Reply #4 on: June 30, 2019, 06:44:23 pm »
@ oBFusCATed

Would you try svn rev 11764 on your gentoo.
Please delete all <personality>.cbKeybinder20.conf files before testing.
(you might not have any because of a bug before rev:11741.)

I re-created the menu accelerator bug, fixed it, and tested on other Linux versions. User config'ed menu accelerators now work correctly on Mint and Ubuntu.
I will fix the memory leak after confirming that you have been successful on gentoo.

2. ctrl-shift-. and ctrl-shift-t doesn't work on a fresh config. [snip] ...
5. I've found this problem because ctrl-w didn't work.
9. alt-pgup/alt-pgdown doesn't work for me. They should be set to prev/next bookmark, but they don't work. :(
But I see a single cbKeyBinder10.ini. Does this mean that it is common for all personalities?
Accelerators are now fixed. svn rev:11764 .
I believe that cbKeyBinder10.ini appeared without a personality prefix because you might have been using a cbKeyBinder prior to rev:11741 which corrected obtaining the location of .config/.codeblocks config directory.

Thanks for finding these bugs.
« Last Edit: June 30, 2019, 06:52:13 pm by Pecan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Keybinder v2 notes/problems
« Reply #5 on: July 01, 2019, 08:48:20 pm »
2 and 5 are fixed it seems. Thanks. This works without deleting the config.

3. Is still broken.
« Last Edit: July 01, 2019, 08:50:26 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2743
Re: Keybinder v2 notes/problems
« Reply #6 on: July 02, 2019, 10:51:24 pm »
@ oBFusCATed

3. Is still broken.
Quote from: oBFusCATed on June 27, 2019, 10:23:34 am
3. The new keybinder failed to parse the old config and lost all my bindings

Please test rev:11766.

To test, backup your ~/.config/codeblocks/<personality>.cbKeybinder20.conf, then remove it. Else Keybinder won't process cbKeyBinder10.ini since it thinks it's already processed it once.

Also, backup and remove any <personality>.cbKeyBinder10.ini file that may not contain the keys you want from the standalone(non-personality) cbKeyBinder10.ini.

This will cause KeyBinder to use the standalone cbKeyBinder10.ini file because it cannot find a personalized one.

I forgot that there could be non-personalized cbKeyBinder10.ini files still sitting around. They don't happen anymore unless a pre-personalized version of CB is run or the file is inherited from a pre-personalized version of CB.
« Last Edit: July 04, 2019, 07:21:14 pm by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2743
Re: Keybinder v2 notes/problems
« Reply #7 on: July 04, 2019, 07:29:40 pm »
@ oBFusCATed

4. The old menu name is not visible on windows7 with wx-master + 4k 27inch display in the settings on windows (this is with the latest night build)

wx-master fails to compile on my windows 10 or my VM windows 7.
And, I am unable to re-create the described problem with wx-3.1.1 .

Code
if exist ..\..\lib\gcc_dll\libwxregexu.a del ..\..\lib\gcc_dll\libwxregexu.a
ar rcu ..\..\lib\gcc_dll\libwxregexu.a gcc_mswudll\wxregex_regcomp.o gcc_mswudll\wxregex_regexec.o gcc_mswudll\wxregex_regerror.o gcc_mswudll\wxregex_regfree.o
ranlib ..\..\lib\gcc_dll\libwxregexu.a
mingw32-make: *** No rule to make target '../../src/zlib/adler32.c', needed by 'gcc_mswudll\wxzlib_adler32.o'.  Stop.
« Last Edit: July 04, 2019, 08:17:59 pm by Pecan »

Offline sodev

  • Regular
  • ***
  • Posts: 496
Re: Keybinder v2 notes/problems
« Reply #8 on: July 04, 2019, 07:42:39 pm »
Did you forget to update the submodules or did you fetch them at all?

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2743
Re: Keybinder v2 notes/problems
« Reply #9 on: July 05, 2019, 10:18:11 pm »
Did you forget to update the submodules or did you fetch them at all?

That was the problem, thanks.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2743
Re: Keybinder v2 notes/problems
« Reply #10 on: July 05, 2019, 10:21:39 pm »
@ oBFusCATed

4. The old menu name is not visible on windows7 with wx-master + 4k 27inch display in the settings on windows (this is with the latest night build)

I am unable to re-create this problem with wx-master, mingw-810seh(64bit), on windows VM 7sp1 (HP laptop 17" dispaly @ res:1920x1080) .

I also cannot cause the problem on the last cbNightly ref:11712 .

Could you give me some more clues as to how to make this happen?

« Last Edit: July 05, 2019, 11:19:59 pm by Pecan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Keybinder v2 notes/problems
« Reply #11 on: July 14, 2019, 06:38:27 pm »
3) is now fixed thank you.

For the display issue just open the settings for the keybinder. Next time I'm on windows, I'll try to remember to provide a screenshot.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Keybinder v2 notes/problems
« Reply #12 on: December 14, 2019, 03:11:50 pm »
Another problem I've discovered is that a v2 file saved with wx28 build doesn't work on wx313 build on linux. I've tried relatively recent build. Please let me know if you need more details.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2743
Re: Keybinder v2 notes/problems
« Reply #13 on: December 17, 2019, 07:43:20 pm »
Another problem I've discovered is that a v2 file saved with wx28 build doesn't work on wx313 build on linux. I've tried relatively recent build. Please let me know if you need more details.
Are there any instructions anywhere to install wx313 on linux. Mint19 only has 3.0
« Last Edit: December 17, 2019, 08:08:54 pm by Pecan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Keybinder v2 notes/problems
« Reply #14 on: December 17, 2019, 08:13:35 pm »
I build it manually and install in some home folder then I use --with-wx-config to point codeblocks' build to it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]