Author Topic: Request : C::B View::notebook enhancements  (Read 74002 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #75 on: January 24, 2011, 02:22:22 pm »
That's a show stopper for me.
[...]
I will not commit, before the cause is found.
Agreed.
Here comes a patch that (hopefully) fixes the issue (it does it at least on win7).
It contains some more changes (tab tooltips can now be disabled generally in "Sedttings -> View -> Notebook appearance", the dwell time can also be configured).

EDIT:
The patch will not apply to trunk later than r6931, some of the included changes are now committed.
More will follow.
I will update the patch tomorrow (it's a lot of work to split the patches  :( ).
« Last Edit: January 24, 2011, 04:52:28 pm by jens »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Request : C::B View::notebook enhancements
« Reply #76 on: January 24, 2011, 02:46:26 pm »
Here comes a patch that (hopefully) fixes the issue (it does it at least on win7).
So you were able to reproduce? I am very curious what has caused this effect! (I've no access to C::B atm...).
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #77 on: January 24, 2011, 03:17:26 pm »
The cause was, that I always tried to restore the previous focus (windows hack), but if the previous focus was on an editor (or more precisely on a cbStyledtextCtrl), this fails after deleting the editor (of course).
Now when deleting (or removing) a page, I check whether the stored pointer (or one of its parents) is the page to be deleted (or removed). In this case I reset the stored pointer to nullptr.

The crash only happened, if the closed page was not the last page, because in this case the selection also has changed and a changed selection (via mousewheel for example) overrides has precedence over restoring the focus.
« Last Edit: January 24, 2011, 03:36:37 pm by jens »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #78 on: January 25, 2011, 01:32:08 pm »
For awhile there, I didn't have to hover at all.

Then I deleted my local repository, downloaded and rebuilt. It's working much better now.

However, I would like to turn this feature off. If we're going to add features that popup, we should also give the user a chance to turn them off.
 
I'm currently working on a patch, that alows turning off tooltips completely and to change the dwelltime.
Applied to trunk svn r6936 !

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #79 on: January 25, 2011, 01:57:18 pm »
Jens (as our auiNotebook spe[spammer]t): I have another feature request:

The problem is:
1. open tabs, so that all tabs can't be visible at the same time
2. scroll to the last tab
3. close the last tab
4. the tabs on the left of the last tab don't move.

Is it possible to make tabs on the left move to the right
(the notebook will behave like the one in firefox for example)?

I will attach a patch later this day (or tomorrow)


Applied to trunk svn r6937 !

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Request : C::B View::notebook enhancements
« Reply #80 on: January 25, 2011, 02:02:53 pm »
...well done. I can tell the bug I mentioned seems indeed fixed. Thanks for this contribution!
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #81 on: January 25, 2011, 02:41:15 pm »
...well done. I can tell the bug I mentioned seems indeed fixed. Thanks for this contribution!
Fixed with the patch against 6931 or does it not appear in trunk ?
The problematic code is not (yet) committed.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #82 on: January 25, 2011, 03:30:19 pm »
...well done. I can tell the bug I mentioned seems indeed fixed. Thanks for this contribution!
Fixed with the patch against 6931 or does it not appear in trunk ?
The problematic code is not (yet) committed.

Now it is (svn r6939).

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Request : C::B View::notebook enhancements
« Reply #83 on: January 26, 2011, 02:44:43 pm »
I'm experiencing a crash here, after I updated to the last version svn r6939, which could be related to the scroll with mouse-wheel (or not)...

Anyway, before updating it, I was using jens patch and had no crashes...

Steps to reproduce it:
1- open a workspace with many files opened
2- scroll (no activating the tabs) a lot, so that the active editor is no longer visible
3- click on a tab

Here, everything freezes and I have to kill codeblocks and start fresh again.

In case it may help, here is the status of the threads when it freezes:

"bt"
Code
In ntdll!DbgUiConvertStateChangeStructure () (C:\Windows\system32\ntdll.dll)
#0  0x77ab8b2f in ntdll!DbgUiConvertStateChangeStructure () from C:\Windows\system32\ntdll.dll
#1  0x77afc9a0 in ntdll!EtwEventEnabled () from C:\Windows\system32\ntdll.dll
#2  0x38d2a2ac in ?? ()
#3  0x00000000 in ?? ()

"thread apply all bt"
Code
Thread 14 (Thread 6664.0x204c):
#0  0x77ab8b2f in ntdll!DbgUiConvertStateChangeStructure () from C:\Windows\system32\ntdll.dll
#1  0x77afc9a0 in ntdll!EtwEventEnabled () from C:\Windows\system32\ntdll.dll
#2  0x38d2a2ac in ?? ()
#3  0x00000000 in ?? ()
Thread 13 (Thread 6664.0x2618):
#0  wxStringData::Unlock (this=0x62b43f6c) at C:/Work/wxWidgets-2.8.10/include/wx/string.h:243
#1  0x65f08601 in ~wxStringBase (this=0xfa9f9b4, __in_chrg=<value optimized out>) at C:/Work/wxWidgets-2.8.10/include/wx/string.h:396
#2  0x65f0f0e5 in ~wxString (this=0xfa9f9b4, __in_chrg=<value optimized out>) at C:/Work/wxWidgets-2.8.10/include/wx/string.h:660
#3  0x65ef2e80 in Tokenizer::DoGetToken (this=0x10eb1f78) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\parser\tokenizer.cpp:1018
#4  0x65ef37fe in Tokenizer::CalcConditionExpression (this=0x10eb1f78) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\parser\tokenizer.cpp:1228
#5  0x65ef4451 in Tokenizer::HandleConditionPreprocessor (this=0x10eb1f78, type=ptIf) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\parser\tokenizer.cpp:1448
#6  0x65ef238c in Tokenizer::SkipUnwanted (this=0x10eb1f78) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\parser\tokenizer.cpp:902
#7  0x65ef25c8 in Tokenizer::GetToken (this=0x10eb1f78) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\parser\tokenizer.cpp:963
#8  0x65edb8c6 in ParserThread::DoParse (this=0x10eb1f70) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\parser\parserthread.cpp:503
#9  0x65edb671 in ParserThread::Parse (this=0x10eb1f70) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\parser\parserthread.cpp:467
#10 0x65f077a5 in ParserThread::Execute (this=0x10eb1f70) at C:/Work/codeblocks_trunk/src/plugins/codecompletion/parser/parserthread.h:137
#11 0x010a2f62 in cbThreadPool::cbWorkerThread::Entry (this=0xe91cab8) at C:\Work\codeblocks_trunk\src\sdk\cbthreadpool.cpp:228
#12 0x6277d8c4 in wxThreadInternal::DoThreadStart(wxThread*) () from C:\Work\codeblocks_trunk\src\devel\wxmsw28u_gcc_custom.dll
#13 0x6277d9f8 in wxThreadInternal::WinThreadStart () from C:\Work\codeblocks_trunk\src\devel\wxmsw28u_gcc_custom.dll
#14 0x76df2599 in wcstombs () from C:\Windows\system32\msvcrt.dll
#15 0x76df26b3 in msvcrt!_beginthreadex () from C:\Windows\system32\msvcrt.dll
#16 0x7721d0e9 in KERNEL32!AcquireSRWLockExclusive () from C:\Windows\system32\kernel32.dll
#17 0x77ab19bb in ntdll!RtlInitializeNtUserPfn () from C:\Windows\system32\ntdll.dll
#18 0x77ab198e in ntdll!RtlInitializeNtUserPfn () from C:\Windows\system32\ntdll.dll
#19 0x00000000 in ?? ()
Thread 10 (Thread 6664.0x1bb4):
#0  0x77ad5e74 in ntdll!LdrAccessResource () from C:\Windows\system32\ntdll.dll
#1  0x77ad5620 in ntdll!ZwWaitForSingleObject () from C:\Windows\system32\ntdll.dll
#2  0x77219884 in WaitForSingleObjectEx () from C:\Windows\system32\kernel32.dll
#3  0x00000230 in ?? () at C:/Work/codeblocks_trunk/src/src/scriptingsettingsdlg.h:30
#4  0x00000000 in ?? ()
Thread 9 (Thread 6664.0x171c):
#0  0x77ad5e74 in ntdll!LdrAccessResource () from C:\Windows\system32\ntdll.dll
#1  0x77ad5620 in ntdll!ZwWaitForSingleObject () from C:\Windows\system32\ntdll.dll
#2  0x77219884 in WaitForSingleObjectEx () from C:\Windows\system32\kernel32.dll
#3  0x000001f0 in ?? () at C:/Work/codeblocks_trunk/src/src/scriptingsettingsdlg.h:29
#4  0x00000000 in ?? ()
Thread 8 (Thread 6664.0x1914):
#0  0x77ad5e74 in ntdll!LdrAccessResource () from C:\Windows\system32\ntdll.dll
#1  0x77ad5620 in ntdll!ZwWaitForSingleObject () from C:\Windows\system32\ntdll.dll
#2  0x77219884 in WaitForSingleObjectEx () from C:\Windows\system32\kernel32.dll
#3  0x00000170 in ?? () at C:/Work/codeblocks_trunk/src/src/scriptingsettingsdlg.h:27
#4  0x00000000 in ?? ()
Thread 7 (Thread 6664.0x1a10):
#0  0x77ad5e74 in ntdll!LdrAccessResource () from C:\Windows\system32\ntdll.dll
#1  0x77ad5620 in ntdll!ZwWaitForSingleObject () from C:\Windows\system32\ntdll.dll
#2  0x77219884 in WaitForSingleObjectEx () from C:\Windows\system32\kernel32.dll
#3  0x00000168 in ?? () at C:/Work/codeblocks_trunk/src/src/scriptingsettingsdlg.h:27
#4  0x00000000 in ?? ()
Thread 6 (Thread 6664.0x1cfc):
#0  0x77ad5e74 in ntdll!LdrAccessResource () from C:\Windows\system32\ntdll.dll
#1  0x77ad5620 in ntdll!ZwWaitForSingleObject () from C:\Windows\system32\ntdll.dll
#2  0x77219884 in WaitForSingleObjectEx () from C:\Windows\system32\kernel32.dll
#3  0x0000015c in ?? () at C:/Work/codeblocks_trunk/src/src/scriptingsettingsdlg.h:27
#4  0x00000000 in ?? ()
Thread 5 (Thread 6664.0xd88):
#0  0x77ad5e74 in ntdll!LdrAccessResource () from C:\Windows\system32\ntdll.dll
#1  0x77ad5620 in ntdll!ZwWaitForSingleObject () from C:\Windows\system32\ntdll.dll
#2  0x77219884 in WaitForSingleObjectEx () from C:\Windows\system32\kernel32.dll
#3  0x00000158 in ?? () at C:/Work/codeblocks_trunk/src/src/scriptingsettingsdlg.h:27
#4  0x00000000 in ?? ()
Thread 3 (Thread 6664.0x16ac):
#0  0x77ad5e74 in ntdll!LdrAccessResource () from C:\Windows\system32\ntdll.dll
#1  0x77ad50b0 in ntdll!ZwRemoveIoCompletion () from C:\Windows\system32\ntdll.dll
#2  0x7721d11e in KERNEL32!GetQueuedCompletionStatusEx () from C:\Windows\system32\kernel32.dll
#3  0x76c803c8 in RPCRT4!NdrTypeFree () from C:\Windows\system32\rpcrt4.dll
#4  0x00000108 in ?? ()
#5  0x05dffed8 in ?? ()
#6  0x76c804fd in RPCRT4!NdrTypeFree () from C:\Windows\system32\rpcrt4.dll
#7  0xffffffff in ?? ()
#8  0x05dfff44 in ?? ()
#9  0x76c8011c in RPCRT4!NdrTypeFree () from C:\Windows\system32\rpcrt4.dll
#10 0x05dfff7c in ?? ()
#11 0x76c800e3 in RPCRT4!NdrTypeFree () from C:\Windows\system32\rpcrt4.dll
#12 0x00c09480 in ?? ()
#13 0x76c80166 in RPCRT4!NdrTypeFree () from C:\Windows\system32\rpcrt4.dll
#14 0x00c08d38 in ?? ()
#15 0x7721d0e9 in KERNEL32!AcquireSRWLockExclusive () from C:\Windows\system32\kernel32.dll
#16 0x77ab19bb in ntdll!RtlInitializeNtUserPfn () from C:\Windows\system32\ntdll.dll
#17 0x77ab198e in ntdll!RtlInitializeNtUserPfn () from C:\Windows\system32\ntdll.dll
#18 0x00000000 in ?? ()
Thread 1 (Thread 6664.0xb04):
#0  0x77ad5e74 in ntdll!LdrAccessResource () from C:\Windows\system32\ntdll.dll
#1  0x77ad5620 in ntdll!ZwWaitForSingleObject () from C:\Windows\system32\ntdll.dll
#2  0x77aae16a in ntdll!RtlAddAccessDeniedObjectAce () from C:\Windows\system32\ntdll.dll
#3  0x77aae04d in ntdll!RtlAddAccessDeniedObjectAce () from C:\Windows\system32\ntdll.dll
#4  0x6277b829 in wxCriticalSection::Enter() () from C:\Work\codeblocks_trunk\src\devel\wxmsw28u_gcc_custom.dll
#5  0x65f0d1fd in wxCriticalSectionLocker (this=0x22f4f8, cs=...) at C:/Work/wxWidgets-2.8.10/include/wx/thread.h:286
#6  0x65eda619 in ParserThread::ParseBufferForNamespaces (this=0x22f5a0, buffer=..., result=...) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\parser\parserthread.cpp:261
warning: (Internal error: pc 0x22f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x22f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x22f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x22f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x1ef in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x1ef in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x1ef in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x1ef in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x1ef in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x16f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x16f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x16f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x16f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x16f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x167 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x167 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x167 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x167 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x167 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x15b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x15b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x15b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x15b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x15b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x157 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x157 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x157 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x157 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x157 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x107 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x107 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x107 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x107 in read in psymtab, but not in symtab.)
#7  0x65ed63c9 in Parser::ParseBufferForNamespaces (this=0xe91d7f8, buffer=..., result=...) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\parser\parser.cpp:595
#8  0x65eac80c in CodeCompletion::ParseFunctionsAndFillToolbar (this=0x84d6458, force=false) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\codecompletion.cpp:2143
#9  0x65eadcbd in CodeCompletion::OnStartParsingFunctions (this=0x84d6458, event=...) at C:\Work\codeblocks_trunk\src\plugins\codecompletion\codecompletion.cpp:2416
#10 0x62783c28 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from C:\Work\codeblocks_trunk\src\devel\wxmsw28u_gcc_custom.dll
#11 0x62783d61 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from C:\Work\codeblocks_trunk\src\devel\wxmsw28u_gcc_custom.dll
#12 0x6278412c in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Work\codeblocks_trunk\src\devel\wxmsw28u_gcc_custom.dll
#13 0x6288cbdd in wxTimerBase::Notify() () from C:\Work\codeblocks_trunk\src\devel\wxmsw28u_gcc_custom.dll
#14 0x627c28f4 in wxTimerProc () from C:\Work\codeblocks_trunk\src\devel\wxmsw28u_gcc_custom.dll
#15 0x77c4fd72 in USER32!GetWindowMinimizeRect () from C:\Windows\system32\user32.dll
#16 0x00000000 in ?? ()

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Request : C::B View::notebook enhancements
« Reply #84 on: January 26, 2011, 03:01:18 pm »
This looks like a CC problem.
Can you try to disable the CC and try to reproduce 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!]

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Request : C::B View::notebook enhancements
« Reply #85 on: January 26, 2011, 03:07:04 pm »
This looks like a CC problem.
Can you try to disable the CC and try to reproduce it.
Sorry, now I cannot reproduce it anymore, with or without CC enabled... it seems it's related with a very particular set-up, i.e. which tab was active and to which I go after...

But I'll keep in mind the suggestion and next time I try to disable CC....

Edit:
I was able to reproduce it again and it really seems that when CC is disable I have no bugs anymore... Since using C::B without CC is not an option, what would be the next step? Start another Post?
« Last Edit: January 26, 2011, 03:52:42 pm by daniloz »

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Request : C::B View::notebook enhancements
« Reply #86 on: January 26, 2011, 03:53:09 pm »
It really seems that when CC is disable I have no bugs anymore... Since using C::B without CC is not an option, what would be the next step? Start another Post?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Request : C::B View::notebook enhancements
« Reply #87 on: January 26, 2011, 04:05:30 pm »
If you can provide a minimal sample + steps to reproduce, it will be best.
The other option is to build C::B with debug info and to start debugging in order to find the cause for the crash:)
(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: 7255
Re: Request : C::B View::notebook enhancements
« Reply #88 on: January 27, 2011, 08:54:24 am »
What happens if you change the editor from the open files list ?
« Last Edit: January 27, 2011, 09:04:32 am by jens »

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Request : C::B View::notebook enhancements
« Reply #89 on: January 27, 2011, 09:22:40 am »
@jens:
I cannot reproduce the problem anymore now... It's really annoying because sometimes it's easily reproducible and sometimes it's not just happening for a long time... But I soon as I can reproduce it again, I'll try the open files list...

@oBFusCATed:
Right now, I cannot reduce the problem to a minimal sample...

@all:
One thing I noticed, though, is that when I have the freeze, it occurs before the line under caret gets highlighted in the editor. Maybe that gives you a clue... :-)

From my side, I'd be more than happy to help by doing some debugging, but I'm still not sure what I have to look for (and, of course, first I need to be able to reproduce the freeze again).

One more info: I've turned on the  debug output on parserthread.cpp
Code
#define CC_PARSERTHREAD_DEBUG_OUTPUT 1
and I see lots of messages in the DebugLog panel (as expected). If I change from one tab to another before waiting for *all* messages to show up, i.e. while the logging is in progress, it freezes here, no matter what!
I'm just not sure if this is because the parser hasn't finished and that causes the freeze or it's just a display problem, that the DebugLog is flooded with messages and moving to another editor tab just cannot be treated by the painting thread... Anyway, just FYI.