|
|
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 |
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 #30632 is a reply to message #30628] |
Thu, 13 January 2011 08:44 |
|
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 #30643 is a reply to message #30640] |
Thu, 13 January 2011 11:29 |
|
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
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 |
|
mirek
Messages: 14050 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 #30707 is a reply to message #30706] |
Mon, 17 January 2011 22:34 |
|
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 #32030 is a reply to message #30614] |
Mon, 18 April 2011 09:47 |
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
|
|
|
Goto Forum:
Current Time: Sun Oct 06 14:12:54 CEST 2024
Total time taken to generate the page: 0.00835 seconds
|
|
|