From 226202ff807dc860991af0d6665ef9e9b48c1bed Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 28 Jan 2014 16:14:15 +0300 Subject: Move direct SDL_GetMouseState calls into method in gui class. --- src/gui/widgets/textfield.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gui/widgets/textfield.cpp') 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 -- cgit v1.2.3-60-g2f50