mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 09:13:39 +01:00
Show/hide the cursor correctly.
It uses a counter, so we may need to call it more than once.
This commit is contained in:
1 parent
315559afe6
commit
810cb967f9
1 file changed
+17
-12
+17
-12
@@ -62,6 +62,7 @@ namespace MainWindow
|
||||
static HMENU menu;
|
||||
|
||||
static HINSTANCE hInst;
|
||||
static int cursorCounter = 0;
|
||||
|
||||
//W32Util::LayeredWindow *layer;
|
||||
#define MAX_LOADSTRING 100
|
||||
@@ -177,6 +178,19 @@ namespace MainWindow
|
||||
ResizeDisplay();
|
||||
}
|
||||
|
||||
void CorrectCursor() {
|
||||
if (g_bFullScreen && globalUIState == UISTATE_INGAME) {
|
||||
while (cursorCounter >= 0) {
|
||||
cursorCounter = ShowCursor(FALSE);
|
||||
}
|
||||
} else {
|
||||
if (cursorCounter < 0) {
|
||||
cursorCounter = ShowCursor(TRUE);
|
||||
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setTexScalingLevel(int num) {
|
||||
g_Config.iTexScalingLevel = num;
|
||||
if(gpu) gpu->ClearCacheNextFrame();
|
||||
@@ -393,12 +407,7 @@ namespace MainWindow
|
||||
|
||||
case WM_TIMER:
|
||||
// Hack: Take the opportunity to also show/hide the mouse cursor in fullscreen mode.
|
||||
if (g_bFullScreen && globalUIState == UISTATE_INGAME) {
|
||||
ShowCursor(FALSE);
|
||||
} else {
|
||||
ShowCursor(TRUE);
|
||||
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||
}
|
||||
CorrectCursor();
|
||||
SetTimer(hWnd, TIMER_CURSORUPDATE, CURSORUPDATE_INTERVAL_MS, 0);
|
||||
return 0;
|
||||
|
||||
@@ -1472,9 +1481,6 @@ namespace MainWindow
|
||||
|
||||
void _ViewNormal(HWND hWnd)
|
||||
{
|
||||
ShowCursor(TRUE);
|
||||
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||
|
||||
// put caption and border styles back
|
||||
DWORD dwOldStyle = ::GetWindowLong(hWnd, GWL_STYLE);
|
||||
DWORD dwNewStyle = dwOldStyle | WS_CAPTION | WS_THICKFRAME;
|
||||
@@ -1493,14 +1499,12 @@ namespace MainWindow
|
||||
|
||||
// reset full screen indicator
|
||||
g_bFullScreen = FALSE;
|
||||
CorrectCursor();
|
||||
ResizeDisplay();
|
||||
}
|
||||
|
||||
void _ViewFullScreen(HWND hWnd)
|
||||
{
|
||||
if (globalUIState == UISTATE_INGAME)
|
||||
ShowCursor(FALSE);
|
||||
|
||||
// keep in mind normal window rectangle
|
||||
::GetWindowRect(hWnd, &g_normalRC);
|
||||
|
||||
@@ -1522,6 +1526,7 @@ namespace MainWindow
|
||||
|
||||
// set full screen indicator
|
||||
g_bFullScreen = TRUE;
|
||||
CorrectCursor();
|
||||
ResizeDisplay();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user