mirror of
https://github.com/glest/glest-source.git
synced 2025-09-26 23:49:03 +02:00
- attempt to fix mouse cyrsor issues
This commit is contained in:
@@ -201,12 +201,30 @@ bool Window::handleEvent() {
|
||||
codeLocation = "k";
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] SDL_ACTIVEEVENT.\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
// Check if the program has lost keyboard focus
|
||||
// Check if the program has lost keyboard focus
|
||||
/*
|
||||
if (event.active.state == SDL_APPINPUTFOCUS) {
|
||||
if (event.active.gain == 0) {
|
||||
Window::isActive = false;
|
||||
}
|
||||
else if (event.active.gain == 1) {
|
||||
//else if (event.active.gain == 1) {
|
||||
else {
|
||||
Window::isActive = true;
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
||||
|
||||
bool willShowCursor = (!Window::isActive || (Window::lastShowMouseState == SDL_ENABLE) || Window::getUseDefaultCursorOnly());
|
||||
showCursor(willShowCursor);
|
||||
}
|
||||
*/
|
||||
// Check if the program has lost window focus
|
||||
if (event.active.state == SDL_APPACTIVE) {
|
||||
if (event.active.gain == 0) {
|
||||
Window::isActive = false;
|
||||
}
|
||||
//else if (event.active.gain == 1) {
|
||||
else {
|
||||
Window::isActive = true;
|
||||
}
|
||||
|
||||
@@ -215,38 +233,30 @@ bool Window::handleEvent() {
|
||||
bool willShowCursor = (!Window::isActive || (Window::lastShowMouseState == SDL_ENABLE) || Window::getUseDefaultCursorOnly());
|
||||
showCursor(willShowCursor);
|
||||
}
|
||||
// Check if the program has lost window focus
|
||||
else if (event.active.state == SDL_APPACTIVE) {
|
||||
// Check if the program has lost window focus
|
||||
/*
|
||||
if (event.active.state == SDL_APPMOUSEFOCUS) {
|
||||
if (event.active.gain == 0) {
|
||||
Window::isActive = false;
|
||||
}
|
||||
else if (event.active.gain == 1) {
|
||||
Window::isActive = true;
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
||||
|
||||
bool willShowCursor = (!Window::isActive || (Window::lastShowMouseState == SDL_ENABLE) || Window::getUseDefaultCursorOnly());
|
||||
showCursor(willShowCursor);
|
||||
}
|
||||
// Check if the program has lost window focus
|
||||
else if (event.active.state == SDL_APPMOUSEFOCUS) {
|
||||
if (event.active.gain == 0) {
|
||||
Window::isActive = false;
|
||||
}
|
||||
else if (event.active.gain == 1) {
|
||||
//else if (event.active.gain == 1) {
|
||||
else {
|
||||
Window::isActive = true;
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
||||
bool willShowCursor = (!Window::isActive || (Window::lastShowMouseState == SDL_ENABLE) || Window::getUseDefaultCursorOnly());
|
||||
showCursor(willShowCursor);
|
||||
}
|
||||
else {
|
||||
}
|
||||
*/
|
||||
if (event.active.state != SDL_APPMOUSEFOCUS &&
|
||||
event.active.state != SDL_APPINPUTFOCUS &&
|
||||
event.active.state != SDL_APPACTIVE) {
|
||||
if (event.active.gain == 0) {
|
||||
Window::isActive = false;
|
||||
}
|
||||
else if (event.active.gain == 1) {
|
||||
//else if (event.active.gain == 1) {
|
||||
else {
|
||||
Window::isActive = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user