prevent crashes when unexpectedly forced to exit fullscreen mode
(e.g. using windows keys in fullscreen) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2251
This commit is contained in:
parent
df11f825b8
commit
206a21502e
3 changed files with 17 additions and 3 deletions
|
@ -345,6 +345,7 @@ void VGA_SetBlinking(Bitu enabled);
|
|||
void VGA_SetCGA2Table(Bit8u val0,Bit8u val1);
|
||||
void VGA_SetCGA4Table(Bit8u val0,Bit8u val1,Bit8u val2,Bit8u val3);
|
||||
void VGA_ActivateHardwareCursor(void);
|
||||
void VGA_KillDrawing(void);
|
||||
|
||||
extern VGA_Type vga;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: sdlmain.cpp,v 1.86 2005-07-19 19:45:32 qbix79 Exp $ */
|
||||
/* $Id: sdlmain.cpp,v 1.87 2005-07-28 19:53:42 c2woody Exp $ */
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
|
@ -40,6 +40,7 @@
|
|||
#include "support.h"
|
||||
#include "debug.h"
|
||||
#include "mapper.h"
|
||||
#include "vga.h"
|
||||
|
||||
//#define DISABLE_JOYSTICK
|
||||
|
||||
|
@ -979,8 +980,16 @@ void GFX_Events() {
|
|||
CaptureMouse();
|
||||
SetPriority(sdl.priority.focus);
|
||||
} else {
|
||||
if (sdl.mouse.locked)
|
||||
CaptureMouse();
|
||||
if (sdl.mouse.locked) {
|
||||
#ifdef WIN32
|
||||
if (sdl.desktop.fullscreen) {
|
||||
VGA_KillDrawing();
|
||||
sdl.desktop.fullscreen=false;
|
||||
GFX_ResetScreen();
|
||||
}
|
||||
#endif
|
||||
CaptureMouse();
|
||||
}
|
||||
SetPriority(sdl.priority.nofocus);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -523,3 +523,7 @@ void VGA_SetupDrawing(Bitu val) {
|
|||
PIC_AddEvent(VGA_VerticalTimer,vga.draw.delay.vtotal);
|
||||
}
|
||||
};
|
||||
|
||||
void VGA_KillDrawing(void) {
|
||||
PIC_RemoveEvents(VGA_DrawPart);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue