VirtualBox

Changeset 98304 in vbox for trunk/src


Ignore:
Timestamp:
Jan 25, 2023 4:18:56 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155514
Message:

FE/SDL. bugref:9449. Removing more SDL 1.2 bits.

Location:
trunk/src/VBox/Frontends/VBoxSDL
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp

    r98303 r98304  
    191191    if (!RTEnvExist("SDL_VIDEODRIVER"))
    192192    {
    193 # ifndef VBOX_WITH_SDL2
    194         /* Always select the windib driver by default, as the directx one is known to be broken on newer Windows OSes. */
    195         RTEnvSet("SDL_VIDEODRIVER", "windib");
    196 # else
    197193        RTEnvSet("SDL_VIDEODRIVER", "directx");
    198 # endif
    199194    }
    200195#endif
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r98302 r98304  
    230230#endif
    231231static SDL_Cursor *gpCustomCursor = 0;
    232 #ifndef VBOX_WITH_SDL2
    233 static WMcursor   *gpCustomOrigWMcursor = NULL;
    234 #endif
    235232static SDL_Cursor *gpOffCursor = NULL;
    236233static SDL_TimerID gSdlResizeTimer = 0;
     
    759756     */
    760757    {
    761 #ifndef VBOX_WITH_SDL2
     758#if 0
    762759        const SDL_version *pVersion = SDL_Linked_Version();
    763760        if (  SDL_VERSIONNUM(pVersion->major, pVersion->minor, pVersion->patch)
     
    776773    {
    777774        Uint32 fInitSubSystem = SDL_INIT_VIDEO | SDL_INIT_TIMER;
    778 #ifndef VBOX_WITH_SDL2
    779         fInitSubSystem |= SDL_INIT_NOPARACHUTE;
    780 #endif
    781775        int rc = SDL_InitSubSystem(fInitSubSystem);
    782776        if (rc != 0)
     
    785779            return 1;
    786780        }
    787         /* we need a video window for the keyboard stuff to work */
    788 #ifndef VBOX_WITH_SDL2 /** @todo Is this correct? */
    789         if (!SDL_SetVideoMode(640, 480, 16, SDL_SWSURFACE))
    790         {
    791             RTPrintf("Error: could not set SDL video mode\n");
    792             return 1;
    793         }
    794 #endif
    795781        RTPrintf("Please hit one or two function key(s) to get the --hostkey value...\n");
    796 
    797782        SDL_Event event1;
    798783        while (SDL_WaitEvent(&event1))
     
    25692554            }
    25702555
    2571 #ifndef VBOX_WITH_SDL2
     2556#ifndef 0
    25722557            /*
    25732558             * The window has gained or lost focus.
     
    26132598            }
    26142599#endif
    2615 
    26162600            /*
    26172601             * User specific update event.
     
    28272811        AssertComRC(hrc);
    28282812    }
    2829 
    2830 #ifndef VBOX_WITH_SDL2
    2831     /* restore the default cursor and free the custom one if any */
    2832     if (gpDefaultCursor)
    2833     {
    2834 # ifdef VBOXSDL_WITH_X11
    2835         Cursor pDefaultTempX11Cursor = 0;
    2836         if (gfXCursorEnabled)
    2837         {
    2838             pDefaultTempX11Cursor = *(Cursor*)gpDefaultCursor->wm_cursor;
    2839             *(Cursor*)gpDefaultCursor->wm_cursor = gpDefaultOrigX11Cursor;
    2840         }
    2841 # endif /* VBOXSDL_WITH_X11 */
    2842         SDL_SetCursor(gpDefaultCursor);
    2843 # if defined(VBOXSDL_WITH_X11) && !defined(VBOX_WITHOUT_XCURSOR)
    2844         if (gfXCursorEnabled)
    2845             XFreeCursor(gSdlInfo.info.x11.display, pDefaultTempX11Cursor);
    2846 # endif /* VBOXSDL_WITH_X11 && !VBOX_WITHOUT_XCURSOR */
    2847     }
    2848 
    2849     if (gpCustomCursor)
    2850     {
    2851         WMcursor *pCustomTempWMCursor = gpCustomCursor->wm_cursor;
    2852         gpCustomCursor->wm_cursor = gpCustomOrigWMcursor;
    2853         SDL_FreeCursor(gpCustomCursor);
    2854         if (pCustomTempWMCursor)
    2855         {
    2856 # if defined(RT_OS_WINDOWS)
    2857             ::DestroyCursor(*(HCURSOR *)pCustomTempWMCursor);
    2858 # elif defined(VBOXSDL_WITH_X11) && !defined(VBOX_WITHOUT_XCURSOR)
    2859             if (gfXCursorEnabled)
    2860                 XFreeCursor(gSdlInfo.info.x11.display, *(Cursor *)pCustomTempWMCursor);
    2861 # endif /* VBOXSDL_WITH_X11 && !VBOX_WITHOUT_XCURSOR */
    2862             free(pCustomTempWMCursor);
    2863         }
    2864     }
    2865 #endif
    28662813
    28672814    LogFlow(("Releasing mouse, keyboard, remote desktop server, display, console...\n"));
     
    43824329                dstShapePtr += data->width;
    43834330            }
    4384 
    4385 #ifndef VBOX_WITH_SDL2 /** @BUGBUG Implement alpha cursor support handling. */
    4386             ICONINFO ii;
    4387             ii.fIcon = FALSE;
    4388             ii.xHotspot = data->xHot;
    4389             ii.yHotspot = data->yHot;
    4390             ii.hbmMask = hMonoBitmap;
    4391             ii.hbmColor = hBitmap;
    4392 
    4393             HCURSOR hAlphaCursor = ::CreateIconIndirect(&ii);
    4394             Assert(hAlphaCursor);
    4395             if (hAlphaCursor)
    4396             {
    4397                 // here we do a dirty trick by substituting a Window Manager's
    4398                 // cursor handle with the handle we created
    4399 
    4400                 WMcursor *pCustomTempWMCursor = gpCustomCursor->wm_cursor;
    4401                 // see SDL12/src/video/wincommon/SDL_sysmouse.c
    4402                 void *wm_cursor = malloc(sizeof(HCURSOR) + sizeof(uint8_t *) * 2);
    4403                 *(HCURSOR *)wm_cursor = hAlphaCursor;
    4404 
    4405                 gpCustomCursor->wm_cursor = (WMcursor *)wm_cursor;
    4406                 SDL_SetCursor(gpCustomCursor);
    4407                 SDL_ShowCursor(SDL_ENABLE);
    4408 
    4409                 if (pCustomTempWMCursor)
    4410                 {
    4411                     ::DestroyCursor(*(HCURSOR *)pCustomTempWMCursor);
    4412                     free(pCustomTempWMCursor);
    4413                 }
    4414 
    4415                 ok = true;
    4416             }
    4417 #endif
    44184331        }
    44194332
     
    44704383                    dstShapePtr += data->width;
    44714384                }
    4472 
    4473 #ifndef VBOX_WITH_SDL2
    4474                 Cursor cur = XcursorImageLoadCursor(gSdlInfo.info.x11.display, img);
    4475                 Assert(cur);
    4476                 if (cur)
    4477                 {
    4478                     // here we do a dirty trick by substituting a Window Manager's
    4479                     // cursor handle with the handle we created
    4480 
    4481                     WMcursor *pCustomTempWMCursor = gpCustomCursor->wm_cursor;
    4482 
    4483                     // see SDL12/src/video/x11/SDL_x11mouse.c
    4484                     void *wm_cursor = malloc(sizeof(Cursor));
    4485                     *(Cursor *)wm_cursor = cur;
    4486 
    4487                     gpCustomCursor->wm_cursor = (WMcursor *)wm_cursor;
    4488                     SDL_SetCursor(gpCustomCursor);
    4489                     SDL_ShowCursor(SDL_ENABLE);
    4490 
    4491                     if (pCustomTempWMCursor)
    4492                     {
    4493                         XFreeCursor(gSdlInfo.info.x11.display, *(Cursor *)pCustomTempWMCursor);
    4494                         free(pCustomTempWMCursor);
    4495                     }
    4496 
    4497                     ok = true;
    4498                 }
    4499 #endif
    45004385            }
    45014386            XcursorImageDestroy(img);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette