Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TabCtrl » TabBar crash fix (very crude one, needs author to rewrite it)
TabBar crash fix (very crude one, needs author to rewrite it) [message #30614] Wed, 12 January 2011 14:49 Go to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
2 fixes included:
1) "Value v = tabs[cross].key;" does crash when cross is outdated (easy to achieve by clicking with mouse on close inactive tabs without movement and fast enough ... active tab will reset cross to -1, so if last tab is active one, no crash occurs)

2) Close(...) should be IMO called *after* registered callbacks

[Updated on: Wed, 12 January 2011 14:55]

Report message to a moderator

Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #30615 is a reply to message #30614] Wed, 12 January 2011 17:23 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Been thinking more about the "cross" value, and IMHO in principle it's cached value.

So whenever it may have changed (mouse move, tab add/remove/scroll/resize(rename)/style change), the cache should be invalidated.

And the TabBar::LeftDown should recalculate it whenever it's invalid directly from "p", if I understand it correctly.

Or how about canceling the cache-way completely, is it really so beneficial? Just using the mouse coords every time and traversing trough active areas definitions. (does look to me "cheap" enough to trade the code complexity for it)
Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #30627 is a reply to message #30615] Wed, 12 January 2011 22:36 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Hopefully fixed! Nice one Smile I agree that some optimizations are too aggressive and makes code more complicated. I'll try to simplify this later.
Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #30628 is a reply to message #30627] Wed, 12 January 2011 22:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Should I consider this resolved for release?

I mean, we are thinking about doing a release and I do not want any bugs I am aware of in it...
Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #30632 is a reply to message #30628] Thu, 13 January 2011 08:44 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

mirek wrote on Wed, 12 January 2011 16:52

Should I consider this resolved for release?

I mean, we are thinking about doing a release and I do not want any bugs I am aware of in it...

There is a little one bug related to drag and drop. Dragged tab's image is not correct in one rare situation. This is nothing serious, but I'll try to fix it today or tomorrow.
Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #30640 is a reply to message #30614] Thu, 13 January 2011 10:03 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Also don't forget about the removal of tab before calling callback. Or did I miss something and don't understand how it should work?

From a quick look into source I would say it's wrong on many places, not just the one I proposed in the patch.

edit: the current SVN looks immune to crash (although I have no idea how you did that with that change you commited .. and I'm not going to look, have plenty of own work Smile ... but it looks completely unrelated on first sight Very Happy).

[Updated on: Thu, 13 January 2011 10:05]

Report message to a moderator

Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #30643 is a reply to message #30640] Thu, 13 January 2011 11:29 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Yes, I remember about calling Close, I have to think about it. The thing is this code is mostly written by James who based on my QuickTabs and I don't want break something Smile
As for the crash fix - MouseMove was not called which should update cross value, and it was not called because of wrong highlight value. Actually all that happened because of unnecessary optimizations you were talking about (checking if n == highlight).
Thanks again for catching this!
Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #30669 is a reply to message #30643] Sun, 16 January 2011 11:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, I have another serious issue with TabBar.

I have noticed that changing text editor color in theide/environment sometimes goes awfully wrong.

After a while, I have relized it is caused by


void Ide::UpdateFormat(CodeEditor& editor, EditorTabBar& tabs)
{
......
	tabs.Stacking(tabs_stacking);



the reason being that Stacking calls SetData, which in turns calls SetCursor, which invokes WhenAction.

Now, WhenAction is fundamentally reserved for situation when widget detects USER action. It should never be invoked by action of code, such as SetData! (That should do Update to signal modified state; it can invoke some other callback like WhenCursor or WhenSel if needed).

Now, should I sort this out? (I guess given we have SetCursor0, it is just matter of some slight refactoring..)

Mirek
Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #30673 is a reply to message #30669] Sun, 16 January 2011 18:17 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Quote:

Now, should I sort this out?

Sure, thanks in advance Smile
Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #30706 is a reply to message #30673] Mon, 17 January 2011 21:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Action issue should be now resolved. WhenAction now invoked only as reaction to MouseDown.

Not sure it is related to TabBar, but I have feeling that TheIDE is now slower when switching files....
Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #30707 is a reply to message #30706] Mon, 17 January 2011 22:34 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

mirek wrote on Mon, 17 January 2011 15:38

Action issue should be now resolved. WhenAction now invoked only as reaction to MouseDown.

Not sure it is related to TabBar, but I have feeling that TheIDE is now slower when switching files....


Interesting, I didn't have that feeling. But who knows.. If I find some free time I'll try to measure file switch with and without tabbar.
Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #31777 is a reply to message #30707] Sat, 26 March 2011 09:59 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Are there any unresolved TabBar issues you'd like me to look at?
Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #32026 is a reply to message #31777] Sun, 17 April 2011 22:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Me: not.

Maybe unodgs?

[Updated on: Sun, 17 April 2011 22:02]

Report message to a moderator

Re: TabBar crash fix (very crude one, needs author to rewrite it) [message #32030 is a reply to message #30614] Mon, 18 April 2011 09:47 Go to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
TabBar.cpp:1930 :
		if (!CancelClose(v) && !CancelCloseSome(Vector<Value>(vv, 0))) {
			Close(ix);
			WhenClose(v);
			WhenCloseSome(vv);
		}

(and line 1973)

Shouldn't the WhenClose callbacks be called BEFORE closing the actual tab? Can somebody more experienced with tabs and callbacks check if it's correct now? Doesn't make sense to me, but I never used it, so maybe I'm just missing something obvious.

[Updated on: Mon, 18 April 2011 09:50]

Report message to a moderator

Previous Topic: Cross-platform TabBar issue (revision 3063)
Next Topic: How to highlight particular tab when corresponding button is clicked
Goto Forum:
  


Current Time: Fri Apr 19 19:08:33 CEST 2024

Total time taken to generate the page: 0.02025 seconds