From ab238dc6e4496f1d25bc008ef695ac49ee53ecd8 Mon Sep 17 00:00:00 2001 From: Gabriel Jacobo Date: Mon, 16 Jun 2014 09:54:33 -0300 Subject: [PATCH] Assorted fixes for NaCl. Hat tip to Sylvain Becker --- README-nacl.txt | 1 + src/video/nacl/SDL_naclvideo.c | 4 ++-- src/video/nacl/SDL_naclwindow.c | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README-nacl.txt b/README-nacl.txt index 44114de0c..0d58f2013 100644 --- a/README-nacl.txt +++ b/README-nacl.txt @@ -90,4 +90,5 @@ For more information on how nacl_io and mount points work, see: TODO - Known Issues ================================================================================ * Testing of all systems with a real application (something other than SDL's tests) +* Key events don't seem to work properly diff --git a/src/video/nacl/SDL_naclvideo.c b/src/video/nacl/SDL_naclvideo.c index 724d7bf3f..90cc0f225 100644 --- a/src/video/nacl/SDL_naclvideo.c +++ b/src/video/nacl/SDL_naclvideo.c @@ -139,6 +139,7 @@ int NACL_VideoInit(_THIS) { SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; SDL_DisplayMode mode; + SDL_zero(mode); mode.format = driverdata->format; mode.w = driverdata->w; mode.h = driverdata->h; @@ -147,8 +148,7 @@ int NACL_VideoInit(_THIS) { if (SDL_AddBasicVideoDisplay(&mode) < 0) { return -1; } - - SDL_zero(mode); + SDL_AddDisplayMode(&_this->displays[0], &mode); PSInterfaceInit(); diff --git a/src/video/nacl/SDL_naclwindow.c b/src/video/nacl/SDL_naclwindow.c index dca145291..9b1de5654 100644 --- a/src/video/nacl/SDL_naclwindow.c +++ b/src/video/nacl/SDL_naclwindow.c @@ -51,6 +51,9 @@ NACL_CreateWindow(_THIS, SDL_Window * window) window->flags |= SDL_WINDOW_INPUT_FOCUS; /* always has input focus */ window->flags |= SDL_WINDOW_OPENGL; + SDL_SetMouseFocus(window); + SDL_SetKeyboardFocus(window); + return 0; }