Author Topic: wxAuiNotebook issues  (Read 21879 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
wxAuiNotebook issues
« on: November 15, 2009, 01:34:01 am »
With the change from wxFlatnotebook to wxAuiNotebook we improved the usage of the editor much (two or more editors with different content side by side).
But we also introduced some issues with it:
http://forums.codeblocks.org/index.php/topic,8595.msg72500.html#msg72500 (ctrl+tab does not wrap at the end or the beginning),
http://forums.codeblocks.org/index.php/topic,10810.msg74542.html#msg74542  (ctrl+tab does not respect order of reordered tabs),
ctr+tab jumps through all tab-controls, even if new groups have been created with dragging the tabs,
the order of reordered tabs is not saved, so that after closing and reopening a project, the tabs have to be moved again.

While searching for a fix of a longstanding bug (crash of C::B when docking free-floating windows on linux-system with composite-effects enabled), I found another issue with wxAuiNotebook, dragging a tab can lead to the exact same crash as docking a free-floating window (again only on linux-systems with composite-effects enabled, as far as I know).
This bug makes it more or less impossible to drag tabs to have multiple editors side by side (I write more or less, because the crash occurs not always, but I never needed more then two or three drags to crash C::B with an X-window error). To prevent the crash when docking windows the drag-hint style of the wxAuiManager has to be changed.
The wxAuiNotebook-class uses wxAuiManager internally and the flags it uses can only be changed from inside the class, because the manager is protected.

These issues can be fixed, if we do not use wxAuiNotebook directly, but a derived-class, that overrides parts of wxAuiNotebooks functions and adds some new to be able to save the visible order.

I started a new thread about this problems, because I think we should seriously think about using our own notebook-class (cbAuiNotebook derived from wxAuiNotebbok) to get rid of these (partly serious) issues.

I attach a patch against C::B trunk, the same patch and patches against the scintilla- and the debugger-branch can be found on my server: http://apt.jenslody.de/patches/ .

I hope to start a discussion, because the tab-order issues are "only" annoying, but the crash is in my opinion a serious bug.

I also added a function to save the perspective of the notebooks to the cbAuiNotebook-class, but loading a perspective is much more complicated (most likely impossible at the moment), bacause the class that holds the tabcontols used by wxAuiNotebook (wxTabFrame) is only defined inside the cpp-file and can therefore not be reached by a derived class.

[attachment deleted by admin]
« Last Edit: November 15, 2009, 01:47:25 pm by jens »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wxAuiNotebook issues
« Reply #1 on: November 15, 2009, 12:54:32 pm »

I attach a patch against C::B trunk, the same patch and patches against the scintilla- and the debugger-branch can be found on my server: http://apt.jenslody.de/patches / .

You should remove the space behind the URL.

http://apt.jenslody.de/patches/
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Alatar

  • Multiple posting newcomer
  • *
  • Posts: 61
Re: wxAuiNotebook issues
« Reply #2 on: November 15, 2009, 07:48:33 pm »
To jens
But why you don`t want to sent this changes to wxWidgets core? If you found bug in library, you should send bugfix to upstream, if you need some features in library, you should send patches to trunk - this is one of basic principles of OpenSource Software, isn`t it?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: wxAuiNotebook issues
« Reply #3 on: November 15, 2009, 08:27:36 pm »
To jens
But why you don`t want to sent this changes to wxWidgets core? If you found bug in library, you should send bugfix to upstream, if you need some features in library, you should send patches to trunk - this is one of basic principles of OpenSource Software, isn`t it?
You are right, but if you would have read the links in my first post, you would know that parts of the patch have been committed to wxWidgets 5 months ago, without any reaction.

The SavePerspective-part is based on a posts in the wxWidgets forum (again written in one of the links of my first post) and I only adapted it to be usable from a derived class.

The workaraounds for the C::B crash with composite-effects enabled are also based on posts and/or bug-tracker entries from wxWidgets,and they are workarounds not fixes, because i do not have the time to dig into wxWidgets-code so deep to find out why it happens.

If I find the time to, I will create patches against wxWidgets sources (auibook.*), but the problems exist now and it will most likely take too much time to wait until they are fixed in a wxWidgets release-version.

That's of course just my (personal) opinion, and the cause why I started this thread.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: wxAuiNotebook issues
« Reply #4 on: November 28, 2009, 07:29:03 am »
I hope to start a discussion, because the tab-order issues are "only" annoying, but the crash is in my opinion a serious bug.
Works nicely here with Windows XP-SP3 and Windows Vista. It indeed is more user friendly. Hence a couple of third party plugins need an update, too. Just for the record.

For the schedule: I think it's time to merge the scintilla branch including this patch. That's my personal opinion.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline cybek

  • Single posting newcomer
  • *
  • Posts: 6
Re: wxAuiNotebook issues
« Reply #5 on: November 29, 2009, 12:50:04 am »
I hope to start a discussion, because the tab-order issues are "only" annoying, but the crash is in my opinion a serious bug.
Works nicely here with Windows XP-SP3 and Windows Vista. It indeed is more user friendly. Hence a couple of third party plugins need an update, too. Just for the record.

For the schedule: I think it's time to merge the scintilla branch including this patch. That's my personal opinion.
How to patch it in the Windows Seven (and other, etc.)? I must download wxWidgets source, apply patch and compile it to dll?
Why you don't return to using wxFlatnotebook?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: wxAuiNotebook issues
« Reply #6 on: November 29, 2009, 01:08:15 am »
I hope to start a discussion, because the tab-order issues are "only" annoying, but the crash is in my opinion a serious bug.
Works nicely here with Windows XP-SP3 and Windows Vista. It indeed is more user friendly. Hence a couple of third party plugins need an update, too. Just for the record.

For the schedule: I think it's time to merge the scintilla branch including this patch. That's my personal opinion.
How to patch it in the Windows Seven (and other, etc.)? I must download wxWidgets source, apply patch and compile it to dll?
Why you don't return to using wxFlatnotebook?

The patch is against C::B sources, not wxwidgets sources.
Nevertheless to compile C::B you need wxWidgets headers and libs (either self-compiled or pre-build like wxwidgets-devpak).

The main cause to switch from flatnotebokk to auinotebook is the possibility to have two (or more) different files side by side.

There is no way back (in my opinion), but we have the possibility to fix the problems introduced with auinotebook, and that's the better way.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: wxAuiNotebook issues
« Reply #7 on: November 29, 2009, 12:12:05 pm »
Applied the patch on my main install -> gentoo linux amd64.

Ctrl+tab works correctly, no visible problems.
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: wxAuiNotebook issues
« Reply #8 on: February 03, 2010, 09:37:30 am »
I attach a patch against C::B trunk, the same patch and patches against the scintilla- and the debugger-branch can be found on my server: http://apt.jenslody.de/patches/ .
Jens, I see no serious show-stoppers and I am using this patch for the time being without issues on Windows and (rarely) on Linux. I think you can commit to trunk.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: wxAuiNotebook issues
« Reply #9 on: February 03, 2010, 10:46:52 am »
No visible issues on linux, too...

1. Ctrl + tab wraps around correctly
2. Reordering of tabs works as expected

p.s. I can't click on the buttons in the notebook, but this seems to be a wx issue (I don't use the default style... and don't remember which one was... will check tonight)
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: wxAuiNotebook issues
« Reply #10 on: February 03, 2010, 12:41:40 pm »
I attach a patch against C::B trunk, the same patch and patches against the scintilla- and the debugger-branch can be found on my server: http://apt.jenslody.de/patches/ .
Jens, I see no serious show-stoppers and I am using this patch for the time being without issues on Windows and (rarely) on Linux. I think you can commit to trunk.
Committed (svn r6131).
Make sure the pch-files get deleted before compiling, when using automake-system you also have to run ./bootstrap and ./configure.