-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL: Allow toggling fullscreen/windowed mode #31
Conversation
Prevent intermittent crashing when prefs contains empty lines or lines with no spaces.
If mouse is grabbed on OS X, every time the mouse cursor icon changes the cursor is recentered. Workaround similar to Windows in video_set_cursor().
Issue: cebix#26 On non-Mac platforms, driver_fullscreen constructor sets up software cursor, but switch_to_current_mode() ask for a hardware cursor, possibly due to a typo. Neither one ends up being drawn, so the cursor goes invisible. This change makes them agree to use a software cursor. We should eventually move to just one place deciding which cursor to use, so they don't have to be kept in sync.
The old SDL_QuitSubsystem workaround is probably obsolete, and causes flicker on resolution changes.
It always points to a member of an SDL_Surface, which is freed by SDL.
mouse_last_x, mouse_last_y and driver_window::mouse_moved() look like remnants of X11 video, they're never really used.
We want to have just one base driver that can handle both fullscreen and windowed mode, so that we can easily switch between modes. Create a virtual init() method to do construction, so we can move common code from the derived classes into the base init().
Including blitter, gray ramp, frame buffer initialization.
Also decide in just one place whether to use hardware or software cursor.
They don't use anything special from fullscreen/windowed derived classes. Also, get rid of unneeded friend declarations.
Split init() into one-time initialization, and adaptation to a new video mode.
Oh, I forgot to mention testing! I tested on both 32-bit and 64-bit Intel Mac and Linux. Previous versions of this patchset were tested on Windows and PPC Mac. I also tried to test on PPC Linux, but that build seems altogether broken due to sheepthreads stuff. I have no idea if the really weird builds like Amiga and NetBSD/68k are still working, but I tried to not do anything that would break them. There are still things that don't work perfectly with this patch, but as far as I can they're all things that also worked badly before, eg: VOSF or B2 banks with certain bit depths still look weird, and mouse-grabbing and resolution switching don't work well together. |
Op 24 april 2013, om 10:59, schreef Dave Vasilevsky notifications@github.com:
Maybe a stupid question, but what is this about? What is "mouse-grabbing" in this context? As far as I know there never was a Ctrl-F5 key-combo in MacOS and, according to Apple documentation, in OSX Ctrl-F5 will move the focus to the toolbar in some applications. Ronald. |
It's not a Mac feature, it's a macemu feature that's been around for awhile, apparently. If you're using SDL video in windowed mode, Ctrl-F5 should cause the mouse to be "grabbed" by SS/B2, so that the cursor can't leave the window. This is useful for games I guess? Anyhow I just wanted to make sure my patch didn't break it, and it's hard to do that if it's not even working right in the first place, at least on OS X which is my main development platform. So I had to fix it. |
SDL: Allow toggling fullscreen/windowed mode
Awesome, thanks! |
…ked to fullscreen display for guest OS"
ADB mouse event buffering proposed by OulanB
Currently if you launch SheepShaver or BasiliskII in fullscreen mode or windowed mode, you stay in that mode until you quit the emulator. On OS X this is especially bad: since fullscreen SDL gives no way to access the host OS, you're stuck in SS/B2. This patch allows you to use Ctrl-Return to toggle between fullscreen or windowed mode.
Sorry if it's a bit of a monster patch, here's a breakdown:
I managed to rebase so it's pretty clean, I think each commit clearly makes sense in sequence. Thanks for taking a look!