summaryrefslogtreecommitdiff
path: root/src/gui/widgets/window.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-23 03:33:47 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-23 03:33:47 +0300
commit48f2996ccc789d740edc4b425a3e00f378a9095a (patch)
tree8117023506896ffbe204eeb61b8cdafaa0463f8e /src/gui/widgets/window.cpp
parent8040656ae1d1dea330754d4595b2737b7eb7959a (diff)
downloadplus-48f2996ccc789d740edc4b425a3e00f378a9095a.tar.gz
plus-48f2996ccc789d740edc4b425a3e00f378a9095a.tar.bz2
plus-48f2996ccc789d740edc4b425a3e00f378a9095a.tar.xz
plus-48f2996ccc789d740edc4b425a3e00f378a9095a.zip
Restore mouse cursor if window set visible and have mouse over.
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r--src/gui/widgets/window.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 19d0b2fea..879190932 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -490,14 +490,31 @@ void Window::setVisible(bool visible, bool forceSticky)
// Check if the window is off screen...
if (visible)
+ {
ensureOnScreen();
+ }
else
+ {
mResizeHandles = 0;
+ }
if (isStickyButtonLock())
gcn::Window::setVisible(visible);
else
gcn::Window::setVisible((!forceSticky && isSticky()) || visible);
+ if (visible)
+ {
+ if (gui)
+ {
+ gcn::MouseEvent *event = reinterpret_cast<gcn::MouseEvent*>(
+ gui->createMouseEvent(this));
+ if (event)
+ {
+ mouseMoved(*event);
+ delete event;
+ }
+ }
+ }
}
void Window::scheduleDelete()
@@ -560,13 +577,18 @@ void Window::mouseReleased(gcn::MouseEvent &event A_UNUSED)
mMoved = false;
}
+void Window::mouseEntered(gcn::MouseEvent &event)
+{
+ updateResizeHandler(event);
+}
+
void Window::mouseExited(gcn::MouseEvent &event A_UNUSED)
{
if (mGrip && !mouseResize && gui)
gui->setCursorType(Gui::CURSOR_POINTER);
}
-void Window::mouseMoved(gcn::MouseEvent &event)
+void Window::updateResizeHandler(gcn::MouseEvent &event)
{
if (!gui)
return;
@@ -595,7 +617,11 @@ void Window::mouseMoved(gcn::MouseEvent &event)
default:
gui->setCursorType(Gui::CURSOR_POINTER);
}
+}
+void Window::mouseMoved(gcn::MouseEvent &event)
+{
+ updateResizeHandler(event);
if (viewport)
viewport->hideBeingPopup();
}