- Timestamp:
- Jan 25, 2023 4:18:56 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155514
- Location:
- trunk/src/VBox/Frontends/VBoxSDL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp ¶
r98303 r98304 191 191 if (!RTEnvExist("SDL_VIDEODRIVER")) 192 192 { 193 # ifndef VBOX_WITH_SDL2194 /* 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 # else197 193 RTEnvSet("SDL_VIDEODRIVER", "directx"); 198 # endif199 194 } 200 195 #endif -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp ¶
r98302 r98304 230 230 #endif 231 231 static SDL_Cursor *gpCustomCursor = 0; 232 #ifndef VBOX_WITH_SDL2233 static WMcursor *gpCustomOrigWMcursor = NULL;234 #endif235 232 static SDL_Cursor *gpOffCursor = NULL; 236 233 static SDL_TimerID gSdlResizeTimer = 0; … … 759 756 */ 760 757 { 761 #if ndef VBOX_WITH_SDL2758 #if 0 762 759 const SDL_version *pVersion = SDL_Linked_Version(); 763 760 if ( SDL_VERSIONNUM(pVersion->major, pVersion->minor, pVersion->patch) … … 776 773 { 777 774 Uint32 fInitSubSystem = SDL_INIT_VIDEO | SDL_INIT_TIMER; 778 #ifndef VBOX_WITH_SDL2779 fInitSubSystem |= SDL_INIT_NOPARACHUTE;780 #endif781 775 int rc = SDL_InitSubSystem(fInitSubSystem); 782 776 if (rc != 0) … … 785 779 return 1; 786 780 } 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 #endif795 781 RTPrintf("Please hit one or two function key(s) to get the --hostkey value...\n"); 796 797 782 SDL_Event event1; 798 783 while (SDL_WaitEvent(&event1)) … … 2569 2554 } 2570 2555 2571 #ifndef VBOX_WITH_SDL22556 #ifndef 0 2572 2557 /* 2573 2558 * The window has gained or lost focus. … … 2613 2598 } 2614 2599 #endif 2615 2616 2600 /* 2617 2601 * User specific update event. … … 2827 2811 AssertComRC(hrc); 2828 2812 } 2829 2830 #ifndef VBOX_WITH_SDL22831 /* restore the default cursor and free the custom one if any */2832 if (gpDefaultCursor)2833 {2834 # ifdef VBOXSDL_WITH_X112835 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 #endif2866 2813 2867 2814 LogFlow(("Releasing mouse, keyboard, remote desktop server, display, console...\n")); … … 4382 4329 dstShapePtr += data->width; 4383 4330 } 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's4398 // cursor handle with the handle we created4399 4400 WMcursor *pCustomTempWMCursor = gpCustomCursor->wm_cursor;4401 // see SDL12/src/video/wincommon/SDL_sysmouse.c4402 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 #endif4418 4331 } 4419 4332 … … 4470 4383 dstShapePtr += data->width; 4471 4384 } 4472 4473 #ifndef VBOX_WITH_SDL24474 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's4479 // cursor handle with the handle we created4480 4481 WMcursor *pCustomTempWMCursor = gpCustomCursor->wm_cursor;4482 4483 // see SDL12/src/video/x11/SDL_x11mouse.c4484 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 #endif4500 4385 } 4501 4386 XcursorImageDestroy(img);
Note:
See TracChangeset
for help on using the changeset viewer.