diff options
-rw-r--r-- | src/gui/widgets/window.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index f8622bb20..dd7627b23 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -769,9 +769,22 @@ void Window::mousePressed(MouseEvent &event) if (popupMenu) { event.consume(); - popupMenu->showWindowPopup(this, - viewport->mMouseX, - viewport->mMouseY); + + if (viewport) + { + popupMenu->showWindowPopup(this, + viewport->mMouseX, + viewport->mMouseY); + } + else + { + int mouseX = 0; + int mouseY = 0; + Gui::getMouseState(&mouseX, &mouseY); + popupMenu->showWindowPopup(this, + mouseX, + mouseY); + } } } } |