summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-rw-r--r--src/gui/widgets/textfield.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 07fde23cd..41084c867 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -741,10 +741,13 @@ void TextField::mousePressed(gcn::MouseEvent &mouseEvent)
mPopupMenu = new PopupMenu();
mPopupMenu->postInit();
}
- int x = 0;
- int y = 0;
- SDL_GetMouseState(&x, &y);
- mPopupMenu->showTextFieldPopup(x, y, this);
+ if (gui)
+ {
+ int x = 0;
+ int y = 0;
+ gui->getMouseState(&x, &y);
+ mPopupMenu->showTextFieldPopup(x, y, this);
+ }
}
}
else