Index: trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp	(revision 98188)
+++ trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp	(revision 98246)
@@ -773,5 +773,5 @@
     else
     {
-        mSurfVRAM = SDL_CreateRGBSurface(SDL_SWSURFACE, mGuestXRes, mGuestYRes, mBitsPerPixel,
+        mSurfVRAM = SDL_CreateRGBSurface(SDL_SWSURFACE, mGuestXRes, mGuestYRes, 32,
                                          Rmask, Gmask, Bmask, Amask);
         LogFlow(("VBoxSDL:: using SDL_SWSURFACE\n"));
@@ -1089,4 +1089,5 @@
     RTCritSectEnter(&mUpdateLock);
     Log(("Updates %d, %d,%d %dx%d\n", mfUpdates, x, y, w, h));
+    // printf("Updates %d, %d,%d %dx%d\n", mfUpdates, x, y, w, h);
     if (!mfUpdates)
     {
@@ -1160,16 +1161,19 @@
     dstRect.h = RT_MAX(0, h - yCutoffGuest);
 
+
+    /* hardware surfaces don't need update notifications */
+#if defined(VBOX_WITH_SDL2)
+    AssertRelease(mScreen->flags & SDL_PREALLOC);
+    SDL_Texture *pNewTexture = SDL_CreateTextureFromSurface(mpRenderer, mSurfVRAM);
+    /** @todo Do we need to update the dirty rect for the texture for SDL2 here as well? */
+    //SDL_RenderClear(mpRenderer);
+    SDL_RenderCopy(mpRenderer, pNewTexture, &srcRect, &dstRect);
+    SDL_RenderPresent(mpRenderer);
+    SDL_DestroyTexture(pNewTexture);
+#else
     /*
      * Now we just blit
      */
     SDL_BlitSurface(mSurfVRAM, &srcRect, mScreen, &dstRect);
-    /* hardware surfaces don't need update notifications */
-#if defined(VBOX_WITH_SDL2)
-    AssertRelease(mScreen->flags & SDL_PREALLOC);
-    /** @todo Do we need to update the dirty rect for the texture for SDL2 here as well? */
-    SDL_RenderClear(mpRenderer);
-    SDL_RenderCopy(mpRenderer, mpTexture, &dstRect, &dstRect);
-    SDL_RenderPresent(mpRenderer);
-#else
     if ((mScreen->flags & SDL_HWSURFACE) == 0)
         SDL_UpdateRect(mScreen, dstRect.x, dstRect.y, dstRect.w, dstRect.h);
Index: trunk/src/VBox/Frontends/VBoxSDL/Makefile.kmk
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/Makefile.kmk	(revision 98188)
+++ trunk/src/VBox/Frontends/VBoxSDL/Makefile.kmk	(revision 98246)
@@ -127,4 +127,5 @@
 # tstSDL
 #
+ifndef VBOX_WITH_SDL2
 PROGRAMS += tstSDL
 tstSDL_TEMPLATE = VBoxR3TstExe
@@ -140,4 +141,5 @@
 tstSDL_DEFS.linux = VBOX_OPENGL
 endif
+
 
 tstSDL_LIBS = \
@@ -158,5 +160,5 @@
 tstSDL_LDFLAGS.darwin = \
 	-framework Foundation -framework AppKit
-
+endif
 ## @todo What was this stuff doing here? The exception config is saying two different things, and why just -O for release builds?
 #tstSDL_CXXFLAGS.win = \
Index: trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp	(revision 98188)
+++ trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp	(revision 98246)
@@ -596,5 +596,9 @@
                 {
 # if defined(VBOXSDL_WITH_X11)
+#  ifdef VBOX_WITH_SDL2
+                    pSWEv->COMSETTER(WinId)((LONG64)info.info.x11.window);
+#  else
                     pSWEv->COMSETTER(WinId)((LONG64)info.info.x11.wmwindow);
+#  endif
 # elif defined(RT_OS_WINDOWS)
 #  ifdef VBOX_WITH_SDL2
@@ -811,8 +815,10 @@
      */
     {
+#ifndef VBOX_WITH_SDL2
         const SDL_version *pVersion = SDL_Linked_Version();
         if (  SDL_VERSIONNUM(pVersion->major, pVersion->minor, pVersion->patch)
             < SDL_VERSIONNUM(1, 2, 14))
             RTEnvSet("SDL_DISABLE_LOCK_KEYS", "1");
+#endif
     }
 #endif
@@ -3410,5 +3416,5 @@
         case SDLK_RSHIFT:           return 0x36;
         case SDLK_KP_MULTIPLY:
-        case SDLK_PRINT:            return 0x37; /* fixme */
+            //case SDLK_PRINT:            return 0x37; /* fixme */
         case SDLK_LALT:             return 0x38;
         case SDLK_MODE: /* alt gr*/
@@ -3427,26 +3433,26 @@
         case SDLK_F10:              return 0x44;
         case SDLK_PAUSE:            return 0x45; /* not right */
-        case SDLK_NUMLOCK:          return 0x45;
-        case SDLK_SCROLLOCK:        return 0x46;
-        case SDLK_KP7:              return 0x47;
+            //case SDLK_NUMLOCK:          return 0x45;
+            //case SDLK_SCROLLOCK:        return 0x46;
+            //case SDLK_KP7:              return 0x47;
         case SDLK_HOME:             return 0x47 | 0x100;
-        case SDLK_KP8:              return 0x48;
+            //case SDLK_KP8:              return 0x48;
         case SDLK_UP:               return 0x48 | 0x100;
-        case SDLK_KP9:              return 0x49;
+            //case SDLK_KP9:              return 0x49;
         case SDLK_PAGEUP:           return 0x49 | 0x100;
         case SDLK_KP_MINUS:         return 0x4a;
-        case SDLK_KP4:              return 0x4b;
+            //case SDLK_KP4:              return 0x4b;
         case SDLK_LEFT:             return 0x4b | 0x100;
-        case SDLK_KP5:              return 0x4c;
-        case SDLK_KP6:              return 0x4d;
+            //case SDLK_KP5:              return 0x4c;
+            //case SDLK_KP6:              return 0x4d;
         case SDLK_RIGHT:            return 0x4d | 0x100;
         case SDLK_KP_PLUS:          return 0x4e;
-        case SDLK_KP1:              return 0x4f;
+            //case SDLK_KP1:              return 0x4f;
         case SDLK_END:              return 0x4f | 0x100;
-        case SDLK_KP2:              return 0x50;
+            //case SDLK_KP2:              return 0x50;
         case SDLK_DOWN:             return 0x50 | 0x100;
-        case SDLK_KP3:              return 0x51;
+            //case SDLK_KP3:              return 0x51;
         case SDLK_PAGEDOWN:         return 0x51 | 0x100;
-        case SDLK_KP0:              return 0x52;
+            //case SDLK_KP0:              return 0x52;
         case SDLK_INSERT:           return 0x52 | 0x100;
         case SDLK_KP_PERIOD:        return 0x53;
