mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 00:23:35 +00:00
Hide mouse when it leaves the display
This commit is contained in:
parent
95fbfd9fe7
commit
af299eecc8
@ -462,6 +462,23 @@ void Manager::generateMessagesFromSheEvents()
|
||||
break;
|
||||
}
|
||||
|
||||
case she::Event::MouseEnter: {
|
||||
if (!mouse_events_from_she)
|
||||
continue;
|
||||
|
||||
jmouse_set_cursor(kArrowCursor);
|
||||
break;
|
||||
}
|
||||
|
||||
case she::Event::MouseLeave: {
|
||||
if (!mouse_events_from_she)
|
||||
continue;
|
||||
|
||||
jmouse_set_cursor(kNoCursor);
|
||||
setMouse(NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
case she::Event::MouseMove: {
|
||||
if (!mouse_events_from_she)
|
||||
continue;
|
||||
|
@ -242,11 +242,26 @@ bool jmouse_poll()
|
||||
return false;
|
||||
}
|
||||
|
||||
void _internal_no_mouse_position()
|
||||
{
|
||||
moved = true;
|
||||
m_x[1] = -1;
|
||||
m_y[1] = -1;
|
||||
m_x[0] = -1;
|
||||
m_y[0] = -1;
|
||||
}
|
||||
|
||||
void _internal_set_mouse_position(const gfx::Point& newPos)
|
||||
{
|
||||
moved = true;
|
||||
m_x[1] = m_x[0];
|
||||
m_y[1] = m_y[0];
|
||||
if (m_x[0] >= 0) {
|
||||
m_x[1] = m_x[0];
|
||||
m_y[1] = m_y[0];
|
||||
}
|
||||
else {
|
||||
m_x[1] = newPos.x;
|
||||
m_y[1] = newPos.y;
|
||||
}
|
||||
m_x[0] = newPos.x;
|
||||
m_y[0] = newPos.y;
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ namespace ui {
|
||||
|
||||
bool jmouse_poll();
|
||||
|
||||
void _internal_no_mouse_position();
|
||||
void _internal_set_mouse_position(const gfx::Point& newPos);
|
||||
void _internal_set_mouse_buttons(MouseButtons buttons);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user