mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 12:12:25 +01:00
- update for windows mouse pointer in fullscreen mode. Alt-Enter enables mouse pointer so user can scroll off screen.
This commit is contained in:
parent
9508dad51b
commit
340d637ae1
@ -783,6 +783,7 @@ void showCursor(bool b) {
|
||||
//SDL_GetMouseState( &x, &y );
|
||||
}
|
||||
SDL_ShowCursor(b ? SDL_ENABLE : SDL_DISABLE);
|
||||
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
if(b) {
|
||||
//SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
//SDL_WarpMouse(x,y);
|
||||
|
@ -91,6 +91,8 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits) {
|
||||
<< depthBits << " depth-buffer). SDL Error is: " << SDL_GetError();
|
||||
throw std::runtime_error(msg.str());
|
||||
}
|
||||
|
||||
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
}
|
||||
|
||||
void PlatformContextGl::end() {
|
||||
|
@ -186,9 +186,7 @@ bool Window::handleEvent() {
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
||||
if(Window::isActive && Window::getUseDefaultCursorOnly() == false) {
|
||||
showCursor(!Window::isActive);
|
||||
}
|
||||
showCursor(!Window::isActive || Window::getUseDefaultCursorOnly());
|
||||
}
|
||||
// Check if the program has lost window focus
|
||||
else if (event.active.state == SDL_APPACTIVE) {
|
||||
@ -200,9 +198,7 @@ bool Window::handleEvent() {
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
||||
if(Window::isActive && Window::getUseDefaultCursorOnly() == false) {
|
||||
showCursor(!Window::isActive);
|
||||
}
|
||||
showCursor(!Window::isActive || Window::getUseDefaultCursorOnly());
|
||||
}
|
||||
// Check if the program has lost window focus
|
||||
else if (event.active.state == SDL_APPMOUSEFOCUS) {
|
||||
@ -214,9 +210,7 @@ bool Window::handleEvent() {
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
||||
if(Window::isActive && Window::getUseDefaultCursorOnly() == false) {
|
||||
showCursor(!Window::isActive);
|
||||
}
|
||||
showCursor(!Window::isActive || Window::getUseDefaultCursorOnly());
|
||||
}
|
||||
else {
|
||||
if (event.active.gain == 0) {
|
||||
@ -227,9 +221,7 @@ bool Window::handleEvent() {
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d, event.active.state = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive,event.active.state);
|
||||
if(Window::isActive && Window::getUseDefaultCursorOnly() == false) {
|
||||
showCursor(!Window::isActive);
|
||||
}
|
||||
showCursor(!Window::isActive || Window::getUseDefaultCursorOnly());
|
||||
}
|
||||
|
||||
}
|
||||
@ -431,7 +423,7 @@ void Window::toggleFullscreen() {
|
||||
if(Window::isFullScreen == true) {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] Window::isFullScreen == true [%d]\n",__FILE__,__FUNCTION__,__LINE__,handle);
|
||||
ShowWindow(handle, SW_MAXIMIZE);
|
||||
if(Window::isActive && Window::getUseDefaultCursorOnly() == false) {
|
||||
if(Window::getUseDefaultCursorOnly() == false) {
|
||||
showCursor(false);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user