Skip to content

Commit

Permalink
+ fixes #2433: Window weirdness after changing constraint value in sk…
Browse files Browse the repository at this point in the history
…etcher
  • Loading branch information
wwmayer committed Mar 11, 2016
1 parent 4bccc5c commit 3276049
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Gui/BlenderNavigationStyle.cpp
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions src/Gui/CADNavigationStyle.cpp
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions src/Gui/InventorNavigationStyle.cpp
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions src/Gui/NavigationStyle.h
Expand Up @@ -276,6 +276,9 @@ class GuiExport InventorNavigationStyle : public UserNavigationStyle {

protected:
SbBool processSoEvent(const SoEvent * const ev);

private:
SoMouseButtonEvent mouseDownConsumedEvent;
};

class GuiExport CADNavigationStyle : public UserNavigationStyle {
Expand All @@ -293,6 +296,7 @@ class GuiExport CADNavigationStyle : public UserNavigationStyle {

private:
SbBool lockButton1;
SoMouseButtonEvent mouseDownConsumedEvent;
};

class GuiExport BlenderNavigationStyle : public UserNavigationStyle {
Expand All @@ -310,6 +314,7 @@ class GuiExport BlenderNavigationStyle : public UserNavigationStyle {

private:
SbBool lockButton1;
SoMouseButtonEvent mouseDownConsumedEvent;
};

class GuiExport MayaGestureNavigationStyle : public UserNavigationStyle {
Expand Down Expand Up @@ -348,6 +353,9 @@ class GuiExport TouchpadNavigationStyle : public UserNavigationStyle {

protected:
SbBool processSoEvent(const SoEvent * const ev);

private:
SoMouseButtonEvent mouseDownConsumedEvent;
};

class GuiExport GestureNavigationStyle : public UserNavigationStyle {
Expand Down Expand Up @@ -387,6 +395,8 @@ class GuiExport OpenCascadeNavigationStyle : public UserNavigationStyle {
protected:
SbBool processSoEvent(const SoEvent * const ev);

private:
SoMouseButtonEvent mouseDownConsumedEvent;
};

} // namespace Gui
Expand Down
25 changes: 25 additions & 0 deletions src/Gui/OpenCascadeNavigationStyle.cpp
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions src/Gui/TouchpadNavigationStyle.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 3276049

Please sign in to comment.