Commit de8729c8 authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

Remove mouse events on render when no trace is loaded (can cause segfault if...

Remove mouse events on render when no trace is loaded (can cause segfault if click on where containers should be)
parent cf21c184
...@@ -199,7 +199,11 @@ Hook_event::~Hook_event(){ ...@@ -199,7 +199,11 @@ Hook_event::~Hook_event(){
* *
**********************************/ **********************************/
void Hook_event::mousePressEvent(QMouseEvent * event){ void Hook_event::mousePressEvent(QMouseEvent * event){
/* Do nothing if no trace is loaded */
if(_state == DRAWING_STATE_WAITING) {
return;
}
/* If a right click was triggered, just restore the previous zoom */ /* If a right click was triggered, just restore the previous zoom */
if( Qt::RightButton == event->button() ){ if( Qt::RightButton == event->button() ){
...@@ -304,7 +308,10 @@ void Hook_event::mouseDoubleClickEvent ( QMouseEvent * event ){ ...@@ -304,7 +308,10 @@ void Hook_event::mouseDoubleClickEvent ( QMouseEvent * event ){
void Hook_event::mouseMoveEvent(QMouseEvent * event){ void Hook_event::mouseMoveEvent(QMouseEvent * event){
if (!_mouse_pressed) return; /* Do nothing if no trace is loaded */
if(_state == DRAWING_STATE_WAITING || !_mouse_pressed) {
return;
}
//if (_mouse_pressed_inside_container) //if (_mouse_pressed_inside_container)
// _new_mouse_x = Info::Screen::width; // _new_mouse_x = Info::Screen::width;
...@@ -327,6 +334,10 @@ void Hook_event::mouseReleaseEvent(QMouseEvent * event){ ...@@ -327,6 +334,10 @@ void Hook_event::mouseReleaseEvent(QMouseEvent * event){
_connected=true; _connected=true;
} }
/* Do nothing if no trace is loaded */
if(_state == DRAWING_STATE_WAITING) {
return;
}
Element_pos invert_buf_x; Element_pos invert_buf_x;
Element_pos invert_buf_y; Element_pos invert_buf_y;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment