User forums > Help

Code::Blocks Linux Stability Issues, Solutions?

<< < (2/4) > >>

BlueHazzard:
i can reproduce this in windows wx3.0.3.
Simply open a project and move the mouse in an open editor. Then make a right click and immediately a left click.
If i press cancel codeblocks locks it self and i have to force kill it.

BlueHazzard:
This is somehow funny, because according documentation only windows should get this error messages:
http://docs.wxwidgets.org/3.0/classwx_mouse_capture_lost_event.html


--- Quote ---This event is currently emitted under Windows only.
--- End quote ---


--- Quote ---If i press cancel codeblocks locks it self and i have to force kill it.
--- End quote ---
this is wrong. The cause of this lock was that the mouse does not work. If i use the keyboard to select "cancel" all works as the assert never triggered. If i use the mouse to select a button of the error message, the message box jumps into the background of the app and i am not able to bring anything into foreground but the task manager. So this messes pretty hard with the event and window system. I try now to process this event and look if the assert does not trigger and some unexpected behavior pops up...

BlueHazzard:
This fixes the assert message on windows.

--- Code: ---diff --git a/src/include/cbstyledtextctrl.h b/src/include/cbstyledtextctrl.h
index 3dfe95161..54d271c82 100644
--- a/src/include/cbstyledtextctrl.h
+++ b/src/include/cbstyledtextctrl.h
@@ -78,6 +78,7 @@ class DLLIMPORT cbStyledTextCtrl : public wxScintilla
         void MakeNearbyLinesVisible(int line);
     private:
         void OnContextMenu(wxContextMenuEvent& event);
+        void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);
         void OnKillFocus(wxFocusEvent& event);
         void OnSetFocus(wxFocusEvent& event);
         void OnMouseMiddleDown(wxMouseEvent& event);
diff --git a/src/sdk/cbstyledtextctrl.cpp b/src/sdk/cbstyledtextctrl.cpp
index 2382a3396..fd256f354 100644
--- a/src/sdk/cbstyledtextctrl.cpp
+++ b/src/sdk/cbstyledtextctrl.cpp
@@ -35,6 +35,7 @@ std::map<int, std::set<int> > cbStyledTextCtrl::CommentLexerStyles;

 BEGIN_EVENT_TABLE(cbStyledTextCtrl, wxScintilla)
     EVT_CONTEXT_MENU(cbStyledTextCtrl::OnContextMenu)
+    EVT_MOUSE_CAPTURE_LOST(cbStyledTextCtrl::OnMouseCaptureLost)
     EVT_KILL_FOCUS  (cbStyledTextCtrl::OnKillFocus)
     EVT_MIDDLE_DOWN (cbStyledTextCtrl::OnMouseMiddleDown)
     EVT_MIDDLE_UP   (cbStyledTextCtrl::OnMouseMiddleClick)
@@ -112,6 +113,11 @@ void cbStyledTextCtrl::OnContextMenu(wxContextMenuEvent& event)
     }
 }

+void cbStyledTextCtrl::OnMouseCaptureLost(wxMouseCaptureLostEvent& event)
+{
+
+}
+
 void cbStyledTextCtrl::OnMouseMiddleDown(wxMouseEvent& event)
 {
     m_middleClickPos = PositionFromPoint(wxPoint(event.GetX(), event.GetY()));


--- End code ---
There is still a cosmetic flaw that the context menu is displayed ater the left click is triggered.
The cause of this bug is probably that the context menu needs to much time to build and display. The context event handler is not exited in time before the new mouse event is triggered and so the second event gets lost. At the moment i have no idea for a proper fix, because we have to close the context menu (but how to close before it even is finished with building), or resend the mouse event with some time delay (really bad hack in my opinion).

oBFusCATed:
I cannot reproduce this issue on linux using rev11166...

The context menu opens and I click on run to cursor item. Using wx3.0.2...

BlueHazzard:
i am also not able to reproduce this on linux mint 18 gtk2 wx3.0.2

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version