User forums > Using Code::Blocks
Linux crashes
tiwag:
for me Ctrl+Prior and Ctrl +Next are only working in Windows, where i have them by default assigned to the prev. & next bookmark keys.
when i wanted to do so in ubuntu, it scrolls the editor window horizontally.
[edit]
in the meanwhile i did a complete re-build of my C::B rev 1823 on ubuntu linux and tested again,
Ctrl+Prior & Ctrl+Next are working like a charm !!!
sorry Pecan, with my last C::B rev 1816 on ubuntu linux i must have forgotten to rebuild cbKeyBinder :oops:
Der Meister:
If finally found the reason for the lock-up if Code::Blocks wants to save a modified Layout during shutdown (I described it here) and probably a solution for this.
The problem is that the 'Edit' menu (and probably other menus) is re-created when the annoying dialog should get closed (or even before? I don't know, doesn't matter anyway). Although the function 'MainFrame::OnEditMenuUpdateUI' (and probably the handlers for the other menus, too) checks if Code::Blocks is shutting down (and does nothing if this is true) it does not help here because 'Manager::appShuttingDown' is still false here. If I set it to true just before 'MainFrame::SaveWindowState' is called from 'MainFrame::OnApplicationClose' (this is line 1869 in 'src/src/main.cpp') everything works perfect.
Here is the little hack I used to test this:
--- Code: ---$ svn diff src/src/main.cpp Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 1823)
+++ src/src/main.cpp (working copy)
@@ -1866,7 +1866,9 @@
return;
}
- SaveWindowState();
+ Manager::appShuttingDown = true;
+ SaveWindowState();
+ Manager::appShuttingDown = false;
m_LayoutManager.DetachPane(Manager::Get()->GetProjectManager()->GetNotebook());
m_LayoutManager.DetachPane(Manager::Get()->GetMessageManager()->GetNotebook());
--- End code ---
Of course, this is no real solution because I had to make 'Manager::appShuttingDown' public to get this hack working ( :wink: ) but this was the easiest way to test this. And I don't really know how this should be integrated into the currect interface/etc. without being a dirty hack.
rickg22:
If it's a matter of events, why not just disable the main Window and prevent the events from getting triggered in the first place?
Der Meister:
Well, if that works it would probably be a good solution. I just used this hack because I saw that 'MainFrame::OnEditMenuUpdateUI' already has this check and wanted to test if this function causes the problem. Another thing is that I'm still not really familiar with wxWidgets and Code::Blocks (from the view of a developer) - thus I don't find the obvious/best solution in most cases, yet. ;)
Der Meister:
--- Quote from: rickg22 on January 20, 2006, 10:18:06 pm ---If it's a matter of events, why not just disable the main Window and prevent the events from getting triggered in the first place?
--- End quote ---
Did you mean 'wxWindow::Disable()'? This doesn't work. It just prevents the user from triggering new events but the UpdateUI-Events are still generated.
Anyway, I just found another solution that seems to be rather good (*no* hack ;) ) and it doesn't require big changes. 'MainFrame::OnApplicationClose' already sets a variable called 'MainFrame::m_InitiatedShutdown' to true to indicate that Code::Blocks will shut down. Just check this variable in addition to 'Manager::isappShuttingDown' and it works:
--- Code: ---$ svn diff src/src/main.cpp
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 1823)
+++ src/src/main.cpp (working copy)
@@ -2462,7 +2462,7 @@
void MainFrame::OnFileMenuUpdateUI(wxUpdateUIEvent& event)
{
- if(Manager::isappShuttingDown())
+ if(Manager::isappShuttingDown() || m_InitiatedShutdown)
{
event.Skip();
return;
@@ -2500,7 +2500,7 @@
void MainFrame::OnEditMenuUpdateUI(wxUpdateUIEvent& event)
{
- if(Manager::isappShuttingDown())
+ if(Manager::isappShuttingDown() || m_InitiatedShutdown)
{
event.Skip();
return;
@@ -2566,7 +2566,7 @@
void MainFrame::OnViewMenuUpdateUI(wxUpdateUIEvent& event)
{
- if(Manager::isappShuttingDown())
+ if(Manager::isappShuttingDown() || m_InitiatedShutdown)
{
event.Skip();
return;
@@ -2607,7 +2607,7 @@
void MainFrame::OnSearchMenuUpdateUI(wxUpdateUIEvent& event)
{
- if(Manager::isappShuttingDown())
+ if(Manager::isappShuttingDown() || m_InitiatedShutdown)
{
event.Skip();
return;
@@ -2632,7 +2632,7 @@
void MainFrame::OnProjectMenuUpdateUI(wxUpdateUIEvent& event)
{
- if(Manager::isappShuttingDown())
+ if(Manager::isappShuttingDown() || m_InitiatedShutdown)
{
event.Skip();
return;
@@ -2653,7 +2653,7 @@
void MainFrame::OnEditorUpdateUI(CodeBlocksEvent& event)
{
- if(Manager::isappShuttingDown())
+ if(Manager::isappShuttingDown() || m_InitiatedShutdown)
{
event.Skip();
return;
@@ -2898,7 +2898,7 @@
void MainFrame::OnRequestDockWindow(CodeBlocksDockEvent& event)
{
- if (Manager::isappShuttingDown())
+ if(Manager::isappShuttingDown() || m_InitiatedShutdown)
return;
wxPaneInfo info;
--- End code ---
I'm not sure if the change in 'MainFrame::OnRequestDockWindow' is necessary but it should not harm anything.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version