VirtualBox

Changeset 98302 in vbox for trunk/src/VBox/Frontends/VBoxSDL


Ignore:
Timestamp:
Jan 25, 2023 9:07:43 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155507
Message:

FE/SDL. bugref:9449. Removing secure label related code.

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

Legend:

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

    r98300 r98302  
    6969NS_DECL_CLASSINFO(VBoxSDLFBOverlay)
    7070#endif
    71 
    72 #ifdef VBOX_SECURELABEL
    73 /* function pointers */
    74 extern "C"
    75 {
    76 DECLSPEC int (SDLCALL *pTTF_Init)(void);
    77 DECLSPEC TTF_Font* (SDLCALL *pTTF_OpenFont)(const char *file, int ptsize);
    78 DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Solid)(TTF_Font *font, const char *text, SDL_Color fg);
    79 DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Blended)(TTF_Font *font, const char *text, SDL_Color fg);
    80 DECLSPEC void (SDLCALL *pTTF_CloseFont)(TTF_Font *font);
    81 DECLSPEC void (SDLCALL *pTTF_Quit)(void);
    82 }
    83 #endif /* VBOX_SECURELABEL */
    8471
    8572static bool gfSdlInitialized = false;           /**< if SDL was initialized */
     
    151138    mBytesPerLine   = 0;
    152139    mfSameSizeRequested = false;
    153 #ifdef VBOX_SECURELABEL
    154     mLabelFont      = NULL;
    155     mLabelHeight    = 0;
    156     mLabelOffs      = 0;
    157 #endif
    158 
    159140    mfUpdates = false;
    160141
     
    195176        mSurfVRAM = NULL;
    196177    }
    197 
    198 #ifdef VBOX_SECURELABEL
    199     if (mLabelFont)
    200         pTTF_CloseFont(mLabelFont);
    201     if (pTTF_Quit)
    202         pTTF_Quit();
    203 #endif
    204 
    205178    RTCritSectDelete(&mUpdateLock);
    206179}
     
    344317    if (!heightReduction)
    345318        return E_POINTER;
    346 #ifdef VBOX_SECURELABEL
    347     *heightReduction = mLabelHeight;
    348 #else
    349319    *heightReduction = 0;
    350 #endif
    351320    return S_OK;
    352321}
     
    805774    {
    806775        newWidth  = RT_MIN(mGuestXRes, mMaxScreenWidth);
    807 #ifdef VBOX_SECURELABEL
    808         newHeight = RT_MIN(mGuestYRes + mLabelHeight, mMaxScreenHeight);
    809 #else
    810776        newHeight = RT_MIN(mGuestYRes, mMaxScreenHeight);
    811 #endif
    812777    }
    813778
     
    875840    }
    876841#endif /* VBOX_WITH_SDL2 */
    877 #ifdef VBOX_SECURELABEL
    878     /*
    879      * For non fixed SDL resolution, the above call tried to add the label height
    880      * to the guest height. If it worked, we have an offset. If it didn't the below
    881      * code will try again with the original guest resolution.
    882      */
    883     if (mFixedSDLWidth == ~(uint32_t)0)
    884     {
    885         /* if it didn't work, then we have to go for the original resolution and paint over the guest */
    886         if (!mScreenSurface)
    887         {
    888             mScreenSurface = SDL_SetVideoMode(newWidth, newHeight - mLabelHeight, 0, sdlFlags);
    889         }
    890         else
    891         {
    892             /* we now have some extra space */
    893             mTopOffset = mLabelHeight;
    894         }
    895     }
    896     else
    897     {
    898         /* in case the guest resolution is small enough, we do have a top offset */
    899         if (mFixedSDLHeight - mGuestYRes >= mLabelHeight)
    900             mTopOffset = mLabelHeight;
    901 
    902         /* we also might have to center the guest picture */
    903         if (mFixedSDLWidth > mGuestXRes)
    904             mCenterXOffset = (mFixedSDLWidth - mGuestXRes) / 2;
    905         if (mFixedSDLHeight > mGuestYRes + mLabelHeight)
    906             mCenterYOffset = (mFixedSDLHeight - (mGuestYRes + mLabelHeight)) / 2;
    907     }
    908 #endif /* VBOX_SECURELABEL */
    909 
    910842}
    911843
     
    948880    /* this is how many pixels we have to cut off from the height for this specific blit */
    949881    int yCutoffGuest = 0;
    950 
    951 #ifdef VBOX_SECURELABEL
    952     bool fPaintLabel = false;
    953     /* if we have a label and no space for it, we have to cut off a bit */
    954     if (mLabelHeight && !mTopOffset)
    955     {
    956         if (y < (int)mLabelHeight)
    957             yCutoffGuest = mLabelHeight - y;
    958     }
    959 #endif
    960 
    961882    /**
    962883     * If we get a SDL window relative update, we
     
    967888    if (!fGuestRelative)
    968889    {
    969 #ifdef VBOX_SECURELABEL
    970         /* repaint the label if necessary */
    971         if (y < (int)mLabelHeight)
    972             fPaintLabel = true;
    973 #endif
    974890        x = 0;
    975891        w = mGuestXRes;
     
    991907     */
    992908    dstRect.x = x + mCenterXOffset;
    993 #ifdef VBOX_SECURELABEL
    994     dstRect.y = RT_MAX(mLabelHeight, y + yCutoffGuest + mTopOffset) + mCenterYOffset;
    995 #else
    996909    dstRect.y = y + yCutoffGuest + mTopOffset + mCenterYOffset;
    997 #endif
    998910    dstRect.w = w;
    999911    dstRect.h = RT_MAX(0, h - yCutoffGuest);
     
    1011923    SDL_DestroyTexture(pNewTexture);
    1012924#endif
    1013 
    1014 #ifdef VBOX_SECURELABEL
    1015     if (fPaintLabel)
    1016         paintSecureLabel(0, 0, 0, 0, false);
    1017 #endif
    1018925    RTCritSectLeave(&mUpdateLock);
    1019926}
     
    1075982}
    1076983#endif
    1077 
    1078 
    1079 #ifdef VBOX_SECURELABEL
    1080 
    1081 /**
    1082  * Setup the secure labeling parameters
    1083  *
    1084  * @returns         VBox status code
    1085  * @param height    height of the secure label area in pixels
    1086  * @param font      file path fo the TrueType font file
    1087  * @param pointsize font size in points
    1088  */
    1089 int VBoxSDLFB::initSecureLabel(uint32_t height, char *font, uint32_t pointsize, uint32_t labeloffs)
    1090 {
    1091     LogFlow(("VBoxSDLFB:initSecureLabel: new offset: %d pixels, new font: %s, new pointsize: %d\n",
    1092               height, font, pointsize));
    1093     mLabelHeight = height;
    1094     mLabelOffs = labeloffs;
    1095     Assert(font);
    1096     pTTF_Init();
    1097     mLabelFont = pTTF_OpenFont(font, pointsize);
    1098     if (!mLabelFont)
    1099     {
    1100         AssertMsgFailed(("Failed to open TTF font file %s\n", font));
    1101         return VERR_OPEN_FAILED;
    1102     }
    1103     mSecureLabelColorFG = 0x0000FF00;
    1104     mSecureLabelColorBG = 0x00FFFF00;
    1105     repaint();
    1106     return VINF_SUCCESS;
    1107 }
    1108 
    1109 /**
    1110  * Set the secure label text and repaint the label
    1111  *
    1112  * @param   text UTF-8 string of new label
    1113  * @remarks must be called from the SDL thread!
    1114  */
    1115 void VBoxSDLFB::setSecureLabelText(const char *text)
    1116 {
    1117     mSecureLabelText = text;
    1118     paintSecureLabel(0, 0, 0, 0, true);
    1119 }
    1120 
    1121 /**
    1122  * Sets the secure label background color.
    1123  *
    1124  * @param   colorFG encoded RGB value for text
    1125  * @param   colorBG encored RGB value for background
    1126  * @remarks must be called from the SDL thread!
    1127  */
    1128 void VBoxSDLFB::setSecureLabelColor(uint32_t colorFG, uint32_t colorBG)
    1129 {
    1130     mSecureLabelColorFG = colorFG;
    1131     mSecureLabelColorBG = colorBG;
    1132     paintSecureLabel(0, 0, 0, 0, true);
    1133 }
    1134 
    1135 /**
    1136  * Paint the secure label if required
    1137  *
    1138  * @param   fForce Force the repaint
    1139  * @remarks must be called from the SDL thread!
    1140  */
    1141 void VBoxSDLFB::paintSecureLabel(int x, int y, int w, int h, bool fForce)
    1142 {
    1143     RT_NOREF(x, w, h);
    1144 # ifdef VBOXSDL_WITH_X11
    1145     AssertMsg(gSdlNativeThread == RTThreadNativeSelf(), ("Wrong thread! SDL is not threadsafe!\n"));
    1146 # endif
    1147     /* only when the function is present */
    1148     if (!pTTF_RenderUTF8_Solid)
    1149         return;
    1150     /* check if we can skip the paint */
    1151     if (!fForce && ((uint32_t)y > mLabelHeight))
    1152     {
    1153         return;
    1154     }
    1155     /* first fill the background */
    1156     SDL_Rect rect = {0, 0, (Uint16)mScreen->w, (Uint16)mLabelHeight};
    1157     SDL_FillRect(mScreen, &rect, SDL_MapRGB(mScreen->format,
    1158                                             (mSecureLabelColorBG & 0x00FF0000) >> 16,   /* red   */
    1159                                             (mSecureLabelColorBG & 0x0000FF00) >> 8,   /* green */
    1160                                             mSecureLabelColorBG & 0x000000FF)); /* blue  */
    1161 
    1162     /* now the text */
    1163     if (    mLabelFont != NULL
    1164          && !mSecureLabelText.isEmpty()
    1165        )
    1166     {
    1167         SDL_Color clrFg = {(uint8_t)((mSecureLabelColorFG & 0x00FF0000) >> 16),
    1168                            (uint8_t)((mSecureLabelColorFG & 0x0000FF00) >> 8),
    1169                            (uint8_t)( mSecureLabelColorFG & 0x000000FF      ), 0};
    1170         SDL_Surface *sText = (pTTF_RenderUTF8_Blended != NULL)
    1171                                  ? pTTF_RenderUTF8_Blended(mLabelFont, mSecureLabelText.c_str(), clrFg)
    1172                                  : pTTF_RenderUTF8_Solid(mLabelFont, mSecureLabelText.c_str(), clrFg);
    1173         rect.x = 10;
    1174         rect.y = mLabelOffs;
    1175         SDL_BlitSurface(sText, NULL, mScreen, &rect);
    1176         SDL_FreeSurface(sText);
    1177     }
    1178     /* make sure to update the screen */
    1179     SDL_UpdateRect(mScreen, 0, 0, mScreen->w, mLabelHeight);
    1180 }
    1181 
    1182 #endif /* VBOX_SECURELABEL */
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h

    r98290 r98302  
    3838
    3939#include <iprt/critsect.h>
    40 
    41 #ifdef VBOX_SECURELABEL
    42 #include <SDL_ttf.h>
    43 /* function pointers */
    44 extern "C"
    45 {
    46 extern DECLSPEC int (SDLCALL *pTTF_Init)(void);
    47 extern DECLSPEC TTF_Font* (SDLCALL *pTTF_OpenFont)(const char *file, int ptsize);
    48 extern DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Solid)(TTF_Font *font, const char *text, SDL_Color fg);
    49 extern DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Shaded)(TTF_Font *font, const char *text, SDL_Color fg, SDL_Color bg);
    50 extern DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Blended)(TTF_Font *font, const char *text, SDL_Color fg);
    51 extern DECLSPEC void (SDLCALL *pTTF_CloseFont)(TTF_Font *font);
    52 extern DECLSPEC void (SDLCALL *pTTF_Quit)(void);
    53 }
    54 #endif /* VBOX_SECURELABEL && !VBOX_WITH_SDL2 */
    5540
    5641class VBoxSDLFBOverlay;
     
    132117    bool hasWindow(uint32_t id) { return SDL_GetWindowID(mpWindow) == id; }
    133118    int setWindowTitle(const char *pcszTitle);
    134 #endif
    135 #ifdef VBOX_SECURELABEL
    136     int  initSecureLabel(uint32_t height, char *font, uint32_t pointsize, uint32_t labeloffs);
    137     void setSecureLabelText(const char *text);
    138     void setSecureLabelColor(uint32_t colorFG, uint32_t colorBG);
    139     void paintSecureLabel(int x, int y, int w, int h, bool fForce);
    140119#endif
    141120    void setWinId(int64_t winId) { mWinId = winId; }
     
    196175    /** handle to window where framebuffer context is being drawn*/
    197176    int64_t mWinId;
    198 #ifdef VBOX_SECURELABEL
    199     /** current secure label text */
    200     Utf8Str mSecureLabelText;
    201     /** current secure label foreground color (RGB) */
    202     uint32_t mSecureLabelColorFG;
    203     /** current secure label background color (RGB) */
    204     uint32_t mSecureLabelColorBG;
    205     /** secure label font handle */
    206     TTF_Font *mLabelFont;
    207     /** secure label height in pixels */
    208     uint32_t mLabelHeight;
    209     /** secure label offset from the top of the secure label */
    210     uint32_t mLabelOffs;
    211 
    212 #endif
    213 
    214177    SDL_Surface *mSurfVRAM;
    215178
  • trunk/src/VBox/Frontends/VBoxSDL/Makefile.kmk

    r98246 r98302  
    6565ifdef VBOX_WITH_SDL2
    6666 VBoxSDL_DEFS     += VBOX_WITH_SDL2
    67 endif
    68 if !defined(VBOX_WITH_SDL2)
    69  ifdef VBOX_WITH_SECURELABEL
    70   VBoxSDL_DEFS    += VBOX_SECURELABEL
    71  endif
    7267endif
    7368VBoxSDL_DEFS.freebsd = VBOXSDL_WITH_X11
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r98301 r98302  
    111111*   Defined Constants And Macros                                                                                                 *
    112112*********************************************************************************************************************************/
    113 #ifdef VBOX_SECURELABEL
    114 /** extra data key for the secure label */
    115 #define VBOXSDL_SECURELABEL_EXTRADATA "VBoxSDL/SecureLabel"
    116 /** label area height in pixels */
    117 #define SECURE_LABEL_HEIGHT 20
    118 #endif
    119 
    120113/** Enables the rawr[0|3], patm, and casm options. */
    121114#define VBOXSDL_ADVANCED_OPTIONS
     
    248241#endif
    249242
    250 #ifdef VBOX_SECURELABEL
    251 #ifdef RT_OS_WINDOWS
    252 #define LIBSDL_TTF_NAME "SDL_ttf"
    253 #else
    254 #define LIBSDL_TTF_NAME "libSDL_ttf-2.0.so.0"
    255 #endif
    256 RTLDRMOD gLibrarySDL_ttf = NIL_RTLDRMOD;
    257 #endif
    258 
    259243static RTSEMEVENT g_EventSemSDLEvents;
    260244static volatile int32_t g_cNotifyUpdateEventsPending;
     
    343327        {
    344328            case VBoxEventType_OnExtraDataChanged:
    345             {
    346 #ifdef VBOX_SECURELABEL
    347                 ComPtr<IExtraDataChangedEvent> pEDCEv = aEvent;
    348                 Assert(pEDCEv);
    349                 Bstr bstrMachineId;
    350                 pEDCEv->COMGETTER(MachineId)(bstrMachineId.asOutParam());
    351                 if (gpMachine)
    352                 {
    353                     /*
    354                      * check if we're interested in the message
    355                      */
    356                     Bstr bstrOurId;
    357                     gpMachine->COMGETTER(Id)(bstrOurId.asOutParam());
    358                     if (bstrOurId == bstrMachineId)
    359                     {
    360                         Bstr bstrKey;
    361                         pEDCEv->COMGETTER(Key)(bstrKey.asOutParam());
    362                         if (bstrKey == VBOXSDL_SECURELABEL_EXTRADATA)
    363                         {
    364                             /*
    365                              * Notify SDL thread of the string update
    366                              */
    367                             SDL_Event event  = {0};
    368                             event.type       = SDL_USEREVENT;
    369                             event.user.type  = SDL_USER_EVENT_SECURELABEL_UPDATE;
    370                             PushSDLEventForSure(&event);
    371                         }
    372                     }
    373                 }
    374 #endif
    375329                break;
    376             }
    377 
    378330            default:
    379331                AssertFailed();
     
    688640             "  --settingspw <pw>        Specify the settings password\n"
    689641             "  --settingspwfile <file>  Specify a file containing the settings password\n"
    690 #ifdef VBOX_SECURELABEL
    691              "  --securelabel            Display a secure VM label at the top of the screen\n"
    692              "  --seclabelfnt            TrueType (.ttf) font file for secure session label\n"
    693              "  --seclabelsiz            Font point size for secure session label (default 12)\n"
    694              "  --seclabelofs            Font offset within the secure label (default 0)\n"
    695              "  --seclabelfgcol <rgb>    Secure label text color RGB value in 6 digit hexadecimal (eg: FFFF00)\n"
    696              "  --seclabelbgcol <rgb>    Secure label background color RGB value in 6 digit hexadecimal (eg: FF0000)\n"
    697 #endif
    698642#ifdef VBOXSDL_ADVANCED_OPTIONS
    699643             "  --warpdrive <pct>        Sets the warp driver rate in percent (100 = normal)\n"
     
    909853    const char *pcszSettingsPw = NULL;
    910854    const char *pcszSettingsPwFile = NULL;
    911 #ifdef VBOX_SECURELABEL
    912     BOOL fSecureLabel = false;
    913     uint32_t secureLabelPointSize = 12;
    914     uint32_t secureLabelFontOffs = 0;
    915     char *secureLabelFontFile = NULL;
    916     uint32_t secureLabelColorFG = 0x0000FF00;
    917     uint32_t secureLabelColorBG = 0x00FFFF00;
    918 #endif
    919855#ifdef VBOXSDL_ADVANCED_OPTIONS
    920856    uint32_t u32WarpDrive = 0;
     
    12901226            pcszSettingsPwFile = argv[curArg];
    12911227        }
    1292 #ifdef VBOX_SECURELABEL
    1293         else if (   !strcmp(argv[curArg], "--securelabel")
    1294                  || !strcmp(argv[curArg], "-securelabel"))
    1295         {
    1296             fSecureLabel = true;
    1297             LogFlow(("Secure labelling turned on\n"));
    1298         }
    1299         else if (   !strcmp(argv[curArg], "--seclabelfnt")
    1300                  || !strcmp(argv[curArg], "-seclabelfnt"))
    1301         {
    1302             if (++curArg >= argc)
    1303             {
    1304                 RTPrintf("Error: missing font file name for secure label!\n");
    1305                 return 1;
    1306             }
    1307             secureLabelFontFile = argv[curArg];
    1308         }
    1309         else if (   !strcmp(argv[curArg], "--seclabelsiz")
    1310                  || !strcmp(argv[curArg], "-seclabelsiz"))
    1311         {
    1312             if (++curArg >= argc)
    1313             {
    1314                 RTPrintf("Error: missing font point size for secure label!\n");
    1315                 return 1;
    1316             }
    1317             secureLabelPointSize = atoi(argv[curArg]);
    1318         }
    1319         else if (   !strcmp(argv[curArg], "--seclabelofs")
    1320                  || !strcmp(argv[curArg], "-seclabelofs"))
    1321         {
    1322             if (++curArg >= argc)
    1323             {
    1324                 RTPrintf("Error: missing font pixel offset for secure label!\n");
    1325                 return 1;
    1326             }
    1327             secureLabelFontOffs = atoi(argv[curArg]);
    1328         }
    1329         else if (   !strcmp(argv[curArg], "--seclabelfgcol")
    1330                  || !strcmp(argv[curArg], "-seclabelfgcol"))
    1331         {
    1332             if (++curArg >= argc)
    1333             {
    1334                 RTPrintf("Error: missing text color value for secure label!\n");
    1335                 return 1;
    1336             }
    1337             sscanf(argv[curArg], "%X", &secureLabelColorFG);
    1338         }
    1339         else if (   !strcmp(argv[curArg], "--seclabelbgcol")
    1340                  || !strcmp(argv[curArg], "-seclabelbgcol"))
    1341         {
    1342             if (++curArg >= argc)
    1343             {
    1344                 RTPrintf("Error: missing background color value for secure label!\n");
    1345                 return 1;
    1346             }
    1347             sscanf(argv[curArg], "%X", &secureLabelColorBG);
    1348         }
    1349 #endif
    13501228#ifdef VBOXSDL_ADVANCED_OPTIONS
    13511229        else if (   !strcmp(argv[curArg], "--warpdrive")
     
    19881866    }
    19891867
    1990 #ifdef VBOX_SECURELABEL
    1991     if (fSecureLabel)
    1992     {
    1993         if (!secureLabelFontFile)
    1994         {
    1995             RTPrintf("Error: no font file specified for secure label!\n");
    1996             goto leave;
    1997         }
    1998         /* load the SDL_ttf library and get the required imports */
    1999         vrc = RTLdrLoadSystem(LIBSDL_TTF_NAME, true /*fNoUnload*/, &gLibrarySDL_ttf);
    2000         if (RT_SUCCESS(vrc))
    2001             vrc = RTLdrGetSymbol(gLibrarySDL_ttf, "TTF_Init", (void**)&pTTF_Init);
    2002         if (RT_SUCCESS(vrc))
    2003             vrc = RTLdrGetSymbol(gLibrarySDL_ttf, "TTF_OpenFont", (void**)&pTTF_OpenFont);
    2004         if (RT_SUCCESS(vrc))
    2005             vrc = RTLdrGetSymbol(gLibrarySDL_ttf, "TTF_RenderUTF8_Solid", (void**)&pTTF_RenderUTF8_Solid);
    2006         if (RT_SUCCESS(vrc))
    2007         {
    2008             /* silently ignore errors here */
    2009             vrc = RTLdrGetSymbol(gLibrarySDL_ttf, "TTF_RenderUTF8_Blended", (void**)&pTTF_RenderUTF8_Blended);
    2010             if (RT_FAILURE(vrc))
    2011                 pTTF_RenderUTF8_Blended = NULL;
    2012             vrc = VINF_SUCCESS;
    2013         }
    2014         if (RT_SUCCESS(vrc))
    2015             vrc = RTLdrGetSymbol(gLibrarySDL_ttf, "TTF_CloseFont", (void**)&pTTF_CloseFont);
    2016         if (RT_SUCCESS(vrc))
    2017             vrc = RTLdrGetSymbol(gLibrarySDL_ttf, "TTF_Quit", (void**)&pTTF_Quit);
    2018         if (RT_SUCCESS(vrc))
    2019             vrc = gpFramebuffer[0]->initSecureLabel(SECURE_LABEL_HEIGHT, secureLabelFontFile, secureLabelPointSize, secureLabelFontOffs);
    2020         if (RT_FAILURE(vrc))
    2021         {
    2022             RTPrintf("Error: could not initialize secure labeling: rc = %Rrc\n", vrc);
    2023             goto leave;
    2024         }
    2025         Bstr bstrLabel;
    2026         gpMachine->GetExtraData(Bstr(VBOXSDL_SECURELABEL_EXTRADATA).raw(), bstrLabel.asOutParam());
    2027         Utf8Str labelUtf8(bstrLabel);
    2028         /*
    2029          * Now update the label
    2030          */
    2031         gpFramebuffer[0]->setSecureLabelColor(secureLabelColorFG, secureLabelColorBG);
    2032         gpFramebuffer[0]->setSecureLabelText(labelUtf8.c_str());
    2033     }
    2034 #endif
    2035 
    20361868#ifdef VBOXSDL_WITH_X11
    20371869    /* NOTE1: We still want Ctrl-C to work, so we undo the SDL redirections.
     
    24922324                            }
    24932325                            uResizeWidth  = event.window.data1;
    2494 #ifdef VBOX_SECURELABEL
    2495                             if (fSecureLabel)
    2496                                 uResizeHeight = RT_MAX(0, event.window.data2 - SECURE_LABEL_HEIGHT);
    2497                             else
    2498 #endif
    2499                                 uResizeHeight = event.window.data2;
     2326                            uResizeHeight = event.window.data2;
    25002327                            if (gSdlResizeTimer)
    25012328                                SDL_RemoveTimer(gSdlResizeTimer);
     
    27782605                    }
    27792606                    uResizeWidth  = event.resize.w;
    2780 #ifdef VBOX_SECURELABEL
    2781                     if (fSecureLabel)
    2782                         uResizeHeight = RT_MAX(0, event.resize.h - SECURE_LABEL_HEIGHT);
    2783                     else
    2784 #endif
    2785                         uResizeHeight = event.resize.h;
     2607                    uResizeHeight = event.resize.h;
    27862608                    if (gSdlResizeTimer)
    27872609                        SDL_RemoveTimer(gSdlResizeTimer);
     
    28922714                goto leave;
    28932715            }
    2894 
    2895 #ifdef VBOX_SECURELABEL
    2896             /*
    2897              * User specific secure label update event
    2898              */
    2899             case SDL_USER_EVENT_SECURELABEL_UPDATE:
    2900             {
    2901                 /*
    2902                  * Query the new label text
    2903                  */
    2904                 Bstr bstrLabel;
    2905                 gpMachine->GetExtraData(Bstr(VBOXSDL_SECURELABEL_EXTRADATA).raw(), bstrLabel.asOutParam());
    2906                 Utf8Str labelUtf8(bstrLabel);
    2907                 /*
    2908                  * Now update the label
    2909                  */
    2910                 gpFramebuffer[0]->setSecureLabelText(labelUtf8.c_str());
    2911                 break;
    2912             }
    2913 #endif /* VBOX_SECURELABEL */
    2914 
    29152716            /*
    29162717             * User specific pointer shape change event
     
    30912892
    30922893    VBoxSDLFB::uninit();
    3093 
    3094 #ifdef VBOX_SECURELABEL
    3095     /* must do this after destructing the framebuffer */
    3096     if (gLibrarySDL_ttf)
    3097         RTLdrClose(gLibrarySDL_ttf);
    3098 #endif
    30992894
    31002895    /* VirtualBox (server) listener unregistration. */
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.h

    r98103 r98302  
    6161/** custom SDL user event for terminating the session */
    6262#define SDL_USER_EVENT_TERMINATE          (SDL_USEREVENT + 8)
    63 /** custom SDL user event for secure label update notification */
    64 #define SDL_USER_EVENT_SECURELABEL_UPDATE (SDL_USEREVENT + 9)
    6563/** custom SDL user event for pointer shape change request */
    66 #define SDL_USER_EVENT_POINTER_CHANGE     (SDL_USEREVENT + 10)
     64#define SDL_USER_EVENT_POINTER_CHANGE     (SDL_USEREVENT + 9)
    6765/** custom SDL user event for a regular timer */
    68 #define SDL_USER_EVENT_TIMER              (SDL_USEREVENT + 11)
     66#define SDL_USER_EVENT_TIMER              (SDL_USEREVENT + 10)
    6967/** custom SDL user event for resetting mouse cursor */
    70 #define SDL_USER_EVENT_GUEST_CAP_CHANGED  (SDL_USEREVENT + 12)
     68#define SDL_USER_EVENT_GUEST_CAP_CHANGED  (SDL_USEREVENT + 11)
    7169/** custom SDL user event for window resize done */
    72 #define SDL_USER_EVENT_WINDOW_RESIZE_DONE (SDL_USEREVENT + 13)
     70#define SDL_USER_EVENT_WINDOW_RESIZE_DONE (SDL_USEREVENT + 12)
    7371
    7472
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