[chocolate-doom] 04/13: Allow alt-tab away while running fullscreen

Jonathan Dowland jmtd at moszumanska.debian.org
Mon Jan 30 15:06:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

jmtd pushed a commit to annotated tag chocolate-doom-0.0.2
in repository chocolate-doom.

commit 90a8fb8c18d4039bb6178608f9bf7fa16ae82547
Author: Simon Howard <fraggle at gmail.com>
Date:   Thu Sep 8 22:05:17 2005 +0000

    Allow alt-tab away while running fullscreen
    
    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 94
---
 src/d_main.c  | 10 +++++++---
 src/i_video.c | 23 +++++++++++++++++++----
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/src/d_main.c b/src/d_main.c
index 5dbf066..060b6c5 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: d_main.c 71 2005-09-04 18:44:23Z fraggle $
+// $Id: d_main.c 94 2005-09-08 22:05:17Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.13  2005/09/08 22:05:17  fraggle
+// Allow alt-tab away while running fullscreen
+//
 // Revision 1.12  2005/09/04 18:44:22  fraggle
 // shut up compiler warnings
 //
@@ -74,7 +77,7 @@
 //-----------------------------------------------------------------------------
 
 
-static const char rcsid[] = "$Id: d_main.c 71 2005-09-04 18:44:23Z fraggle $";
+static const char rcsid[] = "$Id: d_main.c 94 2005-09-08 22:05:17Z fraggle $";
 
 #define	BGCOLOR		7
 #define	FGCOLOR		8
@@ -446,7 +449,8 @@ void D_DoomLoop (void)
 	S_UpdateSounds (players[consoleplayer].mo);// move positional sounds
 
 	// Update display, next frame, with current state.
-	D_Display ();
+        if (screenvisible)
+            D_Display ();
     }
 }
 
diff --git a/src/i_video.c b/src/i_video.c
index c1da0a9..cd9397a 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: i_video.c 83 2005-09-07 20:44:23Z fraggle $
+// $Id: i_video.c 94 2005-09-08 22:05:17Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.24  2005/09/08 22:05:17  fraggle
+// Allow alt-tab away while running fullscreen
+//
 // Revision 1.23  2005/09/07 20:44:23  fraggle
 // Fix up names of functions
 // Make the quit button work (pops up the "quit doom?" prompt).
@@ -107,7 +110,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: i_video.c 83 2005-09-07 20:44:23Z fraggle $";
+rcsid[] = "$Id: i_video.c 94 2005-09-08 22:05:17Z fraggle $";
 
 #include <ctype.h>
 #include <SDL.h>
@@ -142,8 +145,9 @@ static int windowwidth, windowheight;
 
 static boolean native_surface;
 
-boolean fullscreen = 1;
-boolean grabmouse = 1;
+boolean fullscreen = true;
+boolean grabmouse = true;
+boolean screenvisible;
 
 // Blocky mode,
 // replace each 320x200 pixel with multiply*multiply pixels.
@@ -203,6 +207,10 @@ static void UpdateFocus(void)
     // (not minimised)
 
     window_focused = (state & SDL_APPINPUTFOCUS) && (state & SDL_APPACTIVE);
+
+    // Should the screen be grabbed?
+
+    screenvisible = (state & SDL_APPACTIVE) != 0;
 }
 
 void I_BeginRead(void)
@@ -517,6 +525,13 @@ void I_FinishUpdate (void)
 
     UpdateGrab();
 
+    // Don't update the screen if the window isn't visible.
+    // Not doing this breaks under Windows when we alt-tab away 
+    // while fullscreen.
+
+    if (!(SDL_GetAppState() & SDL_APPACTIVE))
+        return;
+
     // draws little dots on the bottom of the screen
     if (devparm)
     {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/chocolate-doom.git



More information about the Pkg-games-commits mailing list