Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: jens on November 15, 2009, 01:34:01 am

Title: wxAuiNotebook issues
Post by: jens 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 (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 (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/ (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]
Title: Re: wxAuiNotebook issues
Post by: ollydbg 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 / (http://apt.jenslody.de/patches /) .

You should remove the space behind the URL.

http://apt.jenslody.de/patches/ (http://apt.jenslody.de/patches/)
Title: Re: wxAuiNotebook issues
Post by: Alatar 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?
Title: Re: wxAuiNotebook issues
Post by: jens 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.
Title: Re: wxAuiNotebook issues
Post by: MortenMacFly 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.
Title: Re: wxAuiNotebook issues
Post by: cybek 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?
Title: Re: wxAuiNotebook issues
Post by: jens 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.
Title: Re: wxAuiNotebook issues
Post by: oBFusCATed 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.
Title: Re: wxAuiNotebook issues
Post by: MortenMacFly 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/ (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.
Title: Re: wxAuiNotebook issues
Post by: oBFusCATed 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)
Title: Re: wxAuiNotebook issues
Post by: jens 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/ (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.