+ fixes #0002433: Window weirdness after changing constraint value in sketcher

This commit is contained in:
wmayer 2016-03-11 13:33:23 +01:00
parent 4bccc5cc6e
commit 32760491a6
6 changed files with 135 additions and 0 deletions

View File

@ -191,6 +191,31 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
processed = true;
}
// issue #0002433: avoid to swallow the UP event if down the
// scene graph somewhere a dialog gets opened
else if (press) {
SbTime tmp = (ev->getTime() - mouseDownConsumedEvent.getTime());
float dci = (float)QApplication::doubleClickInterval()/1000.0f;
// a double-click?
if (tmp.getValue() < dci) {
mouseDownConsumedEvent = *event;
mouseDownConsumedEvent.setTime(ev->getTime());
processed = true;
}
else {
mouseDownConsumedEvent.setTime(ev->getTime());
// 'ANY' is used to mark that we don't know yet if it will
// be a double-click event.
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
}
}
else if (!press) {
if (mouseDownConsumedEvent.getButton() == SoMouseButtonEvent::BUTTON1) {
// now handle the postponed event
inherited::processSoEvent(&mouseDownConsumedEvent);
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
}
}
break;
case SoMouseButtonEvent::BUTTON2:
// If we are in edit mode then simply ignore the RMB events

View File

@ -227,6 +227,31 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
processed = true;
}
// issue #0002433: avoid to swallow the UP event if down the
// scene graph somewhere a dialog gets opened
else if (press) {
SbTime tmp = (ev->getTime() - mouseDownConsumedEvent.getTime());
float dci = (float)QApplication::doubleClickInterval()/1000.0f;
// a double-click?
if (tmp.getValue() < dci) {
mouseDownConsumedEvent = *event;
mouseDownConsumedEvent.setTime(ev->getTime());
processed = true;
}
else {
mouseDownConsumedEvent.setTime(ev->getTime());
// 'ANY' is used to mark that we don't know yet if it will
// be a double-click event.
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
}
}
else if (!press) {
if (mouseDownConsumedEvent.getButton() == SoMouseButtonEvent::BUTTON1) {
// now handle the postponed event
inherited::processSoEvent(&mouseDownConsumedEvent);
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
}
}
break;
case SoMouseButtonEvent::BUTTON2:
// If we are in edit mode then simply ignore the RMB events

View File

@ -218,6 +218,31 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
processed = true;
this->lockrecenter = true;
}
// issue #0002433: avoid to swallow the UP event if down the
// scene graph somewhere a dialog gets opened
else if (press) {
SbTime tmp = (ev->getTime() - mouseDownConsumedEvent.getTime());
float dci = (float)QApplication::doubleClickInterval()/1000.0f;
// a double-click?
if (tmp.getValue() < dci) {
mouseDownConsumedEvent = *event;
mouseDownConsumedEvent.setTime(ev->getTime());
processed = true;
}
else {
mouseDownConsumedEvent.setTime(ev->getTime());
// 'ANY' is used to mark that we don't know yet if it will
// be a double-click event.
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
}
}
else if (!press) {
if (mouseDownConsumedEvent.getButton() == SoMouseButtonEvent::BUTTON1) {
// now handle the postponed event
inherited::processSoEvent(&mouseDownConsumedEvent);
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
}
}
break;
case SoMouseButtonEvent::BUTTON2:
// If we are in edit mode then simply ignore the RMB events

View File

@ -276,6 +276,9 @@ public:
protected:
SbBool processSoEvent(const SoEvent * const ev);
private:
SoMouseButtonEvent mouseDownConsumedEvent;
};
class GuiExport CADNavigationStyle : public UserNavigationStyle {
@ -293,6 +296,7 @@ protected:
private:
SbBool lockButton1;
SoMouseButtonEvent mouseDownConsumedEvent;
};
class GuiExport BlenderNavigationStyle : public UserNavigationStyle {
@ -310,6 +314,7 @@ protected:
private:
SbBool lockButton1;
SoMouseButtonEvent mouseDownConsumedEvent;
};
class GuiExport MayaGestureNavigationStyle : public UserNavigationStyle {
@ -348,6 +353,9 @@ public:
protected:
SbBool processSoEvent(const SoEvent * const ev);
private:
SoMouseButtonEvent mouseDownConsumedEvent;
};
class GuiExport GestureNavigationStyle : public UserNavigationStyle {
@ -387,6 +395,8 @@ public:
protected:
SbBool processSoEvent(const SoEvent * const ev);
private:
SoMouseButtonEvent mouseDownConsumedEvent;
};
} // namespace Gui

View File

@ -187,6 +187,31 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
processed = true;
}
// issue #0002433: avoid to swallow the UP event if down the
// scene graph somewhere a dialog gets opened
else if (press) {
SbTime tmp = (ev->getTime() - mouseDownConsumedEvent.getTime());
float dci = (float)QApplication::doubleClickInterval()/1000.0f;
// a double-click?
if (tmp.getValue() < dci) {
mouseDownConsumedEvent = *event;
mouseDownConsumedEvent.setTime(ev->getTime());
processed = true;
}
else {
mouseDownConsumedEvent.setTime(ev->getTime());
// 'ANY' is used to mark that we don't know yet if it will
// be a double-click event.
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
}
}
else if (!press) {
if (mouseDownConsumedEvent.getButton() == SoMouseButtonEvent::BUTTON1) {
// now handle the postponed event
inherited::processSoEvent(&mouseDownConsumedEvent);
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
}
}
break;
case SoMouseButtonEvent::BUTTON2:
// If we are in edit mode then simply ignore the RMB events

View File

@ -195,6 +195,31 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
processed = true;
}
// issue #0002433: avoid to swallow the UP event if down the
// scene graph somewhere a dialog gets opened
else if (press) {
SbTime tmp = (ev->getTime() - mouseDownConsumedEvent.getTime());
float dci = (float)QApplication::doubleClickInterval()/1000.0f;
// a double-click?
if (tmp.getValue() < dci) {
mouseDownConsumedEvent = *event;
mouseDownConsumedEvent.setTime(ev->getTime());
processed = true;
}
else {
mouseDownConsumedEvent.setTime(ev->getTime());
// 'ANY' is used to mark that we don't know yet if it will
// be a double-click event.
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
}
}
else if (!press) {
if (mouseDownConsumedEvent.getButton() == SoMouseButtonEvent::BUTTON1) {
// now handle the postponed event
inherited::processSoEvent(&mouseDownConsumedEvent);
mouseDownConsumedEvent.setButton(SoMouseButtonEvent::ANY);
}
}
break;
case SoMouseButtonEvent::BUTTON2:
// If we are in edit mode then simply ignore the RMB events