mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
SDL: Prevent windowevents from triggering keys.
There was no break, unintentional fall-through.
This commit is contained in:
parent
29eea477b9
commit
dcda4967fe
@ -672,35 +672,39 @@ int main(int argc, char *argv[]) {
|
||||
case SDL_QUIT:
|
||||
g_QuitRequested = 1;
|
||||
break;
|
||||
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
case SDL_WINDOWEVENT:
|
||||
switch (event.window.event) {
|
||||
switch (event.window.event) {
|
||||
case SDL_WINDOWEVENT_RESIZED:
|
||||
{
|
||||
Uint32 window_flags = SDL_GetWindowFlags(g_Screen);
|
||||
bool fullscreen = (window_flags & SDL_WINDOW_FULLSCREEN);
|
||||
{
|
||||
Uint32 window_flags = SDL_GetWindowFlags(g_Screen);
|
||||
bool fullscreen = (window_flags & SDL_WINDOW_FULLSCREEN);
|
||||
|
||||
pixel_xres = event.window.data1;
|
||||
pixel_yres = event.window.data2;
|
||||
dp_xres = (float)pixel_xres * dpi_scale;
|
||||
dp_yres = (float)pixel_yres * dpi_scale;
|
||||
NativeResized();
|
||||
pixel_xres = event.window.data1;
|
||||
pixel_yres = event.window.data2;
|
||||
dp_xres = (float)pixel_xres * dpi_scale;
|
||||
dp_yres = (float)pixel_yres * dpi_scale;
|
||||
NativeResized();
|
||||
|
||||
#if defined(PPSSPP)
|
||||
// Set variable here in case fullscreen was toggled by hotkey
|
||||
g_Config.bFullScreen = fullscreen;
|
||||
// Set variable here in case fullscreen was toggled by hotkey
|
||||
g_Config.bFullScreen = fullscreen;
|
||||
|
||||
// Hide/Show cursor correctly toggling fullscreen
|
||||
if (lastUIState == UISTATE_INGAME && fullscreen && !g_Config.bShowTouchControls) {
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
} else if (lastUIState != UISTATE_INGAME || !fullscreen) {
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
// Hide/Show cursor correctly toggling fullscreen
|
||||
if (lastUIState == UISTATE_INGAME && fullscreen && !g_Config.bShowTouchControls) {
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
} else if (lastUIState != UISTATE_INGAME || !fullscreen) {
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case SDL_KEYDOWN:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user