File jumpnbump-1.50-Exit-fullscreen-mode-when-you-quit.diff of Package jumpnbump

From 568f2432f3de8ef5d3fea76313fef78f813534c2 Mon Sep 17 00:00:00 2001
From: Ansgar Burchardt <ansgar-guest@alioth.debian.org>
Date: Mon, 8 Dec 2008 01:23:07 +0100
Subject: [PATCH 1/8] Exit fullscreen mode when you quit

see http://bugs.debian.org/338705
---
 globals.pre |    1 +
 main.c      |    1 +
 sdl/gfx.c   |    5 +++++
 3 files changed, 7 insertions(+), 0 deletions(-)

Index: jumpnbump-1.61/globals.pre
===================================================================
--- jumpnbump-1.61.orig/globals.pre
+++ jumpnbump-1.61/globals.pre
@@ -344,6 +344,7 @@ void register_mask(void *pixels);
 #ifdef USE_SDL
 /* long filelength(int handle); */
 void fs_toggle();
+void exit_fullscreen();
 int intr_sysupdate();
 #endif
 
Index: jumpnbump-1.61/main.c
===================================================================
--- jumpnbump-1.61.orig/main.c
+++ jumpnbump-1.61/main.c
@@ -2652,6 +2652,7 @@ void deinit_program(void)
 		free(mask_pic);
 
 	remove_keyb_handler();
+	exit_fullscreen();
 
 #ifdef DOS
 	regs.x.ax = 0x3;
Index: jumpnbump-1.61/sdl/gfx.c
===================================================================
--- jumpnbump-1.61.orig/sdl/gfx.c
+++ jumpnbump-1.61/sdl/gfx.c
@@ -246,6 +246,11 @@ void fs_toggle()
 		fprintf(stderr, "SDL ERROR: %s\n", SDL_GetError());
 }
 
+void exit_fullscreen()
+{
+	if (fullscreen)
+		fs_toggle();
+}
 
 void wait_vrt(int mix)
 {
openSUSE Build Service is sponsored by